From: Jason Ekstrand Date: Thu, 5 Nov 2015 03:51:46 +0000 (-0800) Subject: anv/cmd_buffer: Fix SURFACE_STATE for non-view buffer bindings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a40f682c712f8d57b3d8fda5e3c2b0a785811d79;p=mesa.git anv/cmd_buffer: Fix SURFACE_STATE for non-view buffer bindings We were treating it as if it's a BufferView and weren't taking the offset into account properly. --- diff --git a/src/vulkan/anv_cmd_buffer.c b/src/vulkan/anv_cmd_buffer.c index 57cc8a6456b..5ce57f1d98e 100644 --- a/src/vulkan/anv_cmd_buffer.c +++ b/src/vulkan/anv_cmd_buffer.c @@ -611,13 +611,14 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer, bo_offset = desc->buffer_view->offset; break; case ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET: { + bo = desc->buffer->bo; + bo_offset = desc->buffer->offset + desc->offset; + surface_state = anv_cmd_buffer_alloc_surface_state(cmd_buffer); anv_fill_buffer_surface_state(cmd_buffer->device, surface_state.map, anv_format_for_vk_format(VK_FORMAT_R32G32B32A32_SFLOAT), - desc->offset, desc->range); - bo = desc->buffer_view->bo; - bo_offset = desc->buffer_view->offset; + bo_offset, desc->range); break; } case ANV_DESCRIPTOR_TYPE_IMAGE_VIEW: