浏览代码

intel: When subdataing a busy buffer, use a temporary and blit in.

This cuts a massive number of waits in ET:QW, which uses a VBO ringbuffer.
Unfortunately it doesn't BufferData when wrapping back to 0, so we can't
be clever with tracking what's been initialized.
tags/mesa_7_7_rc1
Eric Anholt 16 年前
父节点
当前提交
3c05c1eb63
共有 1 个文件被更改,包括 16 次插入3 次删除
  1. 16
    3
      src/mesa/drivers/dri/intel/intel_buffer_objects.c

+ 16
- 3
src/mesa/drivers/dri/intel/intel_buffer_objects.c 查看文件

@@ -209,10 +209,23 @@ intel_bufferobj_subdata(GLcontext * ctx,
memcpy((char *)intel_obj->sys_buffer + offset, data, size);
else {
/* Flush any existing batchbuffer that might reference this data. */
if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer))
intelFlush(ctx);
if (drm_intel_bo_busy(intel_obj->buffer) ||
drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) {
drm_intel_bo *temp_bo;

dri_bo_subdata(intel_obj->buffer, offset, size, data);
temp_bo = drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64);

drm_intel_bo_subdata(temp_bo, 0, size, data);

intel_emit_linear_blit(intel,
intel_obj->buffer, offset,
temp_bo, 0,
size);

drm_intel_bo_unreference(temp_bo);
} else {
dri_bo_subdata(intel_obj->buffer, offset, size, data);
}
}
}


正在加载...
取消
保存