anv/cmd_buffer: Fix SURFACE_STATE for non-view buffer bindings
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 5 Nov 2015 03:51:46 +0000 (19:51 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 5 Nov 2015 03:56:18 +0000 (19:56 -0800)
We were treating it as if it's a BufferView and weren't taking the offset
into account properly.

src/vulkan/anv_cmd_buffer.c

index 57cc8a6456b324d898ff9bb78205343cb12619b9..5ce57f1d98e449d3884f4a6da6ebc259700359d3 100644 (file)
@@ -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: