diff options
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i965/genX_state_upload.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/genX_state_upload.c b/src/mesa/drivers/dri/i965/genX_state_upload.c index ea5ad55be59..c051848985f 100644 --- a/src/mesa/drivers/dri/i965/genX_state_upload.c +++ b/src/mesa/drivers/dri/i965/genX_state_upload.c @@ -3787,19 +3787,20 @@ genX(upload_3dstate_so_buffers)(struct brw_context *brw) for (int i = 0; i < 4; i++) { struct intel_buffer_object *bufferobj = intel_buffer_object(xfb_obj->Buffers[i]); + uint32_t start = xfb_obj->Offset[i]; + uint32_t end = ALIGN(start + xfb_obj->Size[i], 4); + uint32_t const size = end - start; - if (!bufferobj) { + if (!bufferobj || !size) { brw_batch_emit(brw, GENX(3DSTATE_SO_BUFFER), sob) { sob.SOBufferIndex = i; } continue; } - uint32_t start = xfb_obj->Offset[i]; assert(start % 4 == 0); - uint32_t end = ALIGN(start + xfb_obj->Size[i], 4); struct brw_bo *bo = - intel_bufferobj_buffer(brw, bufferobj, start, end - start, true); + intel_bufferobj_buffer(brw, bufferobj, start, size, true); assert(end <= bo->size); brw_batch_emit(brw, GENX(3DSTATE_SO_BUFFER), sob) { |