i965: use drm_intel_gem_bo_map/unmap_gtt() when possible, otherwise dri_bo_subdata()
This wraps up the unfinished business from commit a9a363f829
This commit is contained in:
parent
b2a69ae879
commit
3321b6984e
|
@ -344,19 +344,23 @@ update_constant_buffer(struct brw_context *brw,
|
||||||
const struct gl_program_parameter_list *params,
|
const struct gl_program_parameter_list *params,
|
||||||
dri_bo *const_buffer)
|
dri_bo *const_buffer)
|
||||||
{
|
{
|
||||||
|
struct intel_context *intel = &brw->intel;
|
||||||
const int size = params->NumParameters * 4 * sizeof(GLfloat);
|
const int size = params->NumParameters * 4 * sizeof(GLfloat);
|
||||||
|
|
||||||
/* copy Mesa program constants into the buffer */
|
/* copy Mesa program constants into the buffer */
|
||||||
if (const_buffer && size > 0) {
|
if (const_buffer && size > 0) {
|
||||||
GLubyte *map;
|
|
||||||
|
|
||||||
assert(const_buffer);
|
assert(const_buffer);
|
||||||
assert(const_buffer->size >= size);
|
assert(const_buffer->size >= size);
|
||||||
|
|
||||||
dri_bo_map(const_buffer, GL_TRUE);
|
if (intel->intelScreen->kernel_exec_fencing) {
|
||||||
map = const_buffer->virtual;
|
drm_intel_gem_bo_map_gtt(const_buffer);
|
||||||
memcpy(map, params->ParameterValues, size);
|
memcpy(const_buffer->virtual, params->ParameterValues, size);
|
||||||
dri_bo_unmap(const_buffer);
|
drm_intel_gem_bo_unmap_gtt(const_buffer);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
dri_bo_subdata(const_buffer, 0, size, params->ParameterValues);
|
||||||
|
}
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
int i;
|
int i;
|
||||||
|
|
Loading…
Reference in New Issue