diff options
author | Sergii Romantsov <[email protected]> | 2018-08-15 15:21:47 +0300 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-08-15 13:15:28 -0700 |
commit | efb28aa9705699794143b32e11f5c857db60e060 (patch) | |
tree | 622269f4e5cbd85931d2a4cce67ec854c81b2d22 | |
parent | 98b3b6367a919990bc2832183fdcf285ffeb4b8a (diff) |
i965: Emitting 3DSTATE_SO_BUFFER of 0-size.
Avoided filling of whole structure and bo-allocation if
size of surface is 0.
Signed-off-by: Sergii Romantsov <[email protected]>
-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) { |