*/
_mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters);
+ intel_bo_map_gtt_preferred(intel, const_buffer, GL_TRUE);
for (i = 0; i < params->NumParameters; i++) {
- dri_bo_subdata(const_buffer, i * 4 * sizeof(float), 4 * sizeof(float),
- params->ParameterValues[i]);
+ memcpy(const_buffer->virtual + i * 4 * sizeof(float),
+ params->ParameterValues[i],
+ 4 * sizeof(float));
}
+ intel_bo_unmap_gtt_preferred(intel, const_buffer);
return const_buffer;
}
return (value & (value - 1)) == 0;
}
+static inline void
+intel_bo_map_gtt_preferred(struct intel_context *intel,
+ drm_intel_bo *bo,
+ GLboolean write)
+{
+ if (intel->intelScreen->kernel_exec_fencing)
+ drm_intel_gem_bo_map_gtt(bo);
+ else
+ drm_intel_bo_map(bo, write);
+}
+
+static inline void
+intel_bo_unmap_gtt_preferred(struct intel_context *intel,
+ drm_intel_bo *bo)
+{
+ if (intel->intelScreen->kernel_exec_fencing)
+ drm_intel_gem_bo_unmap_gtt(bo);
+ else
+ drm_intel_bo_unmap(bo);
+}
+
#endif