case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
surface_state = desc->buffer_view->surface_state;
- bo = desc->buffer_view->buffer->bo;
- bo_offset = desc->buffer_view->buffer->offset;
+ bo = desc->buffer_view->bo;
+ bo_offset = desc->buffer_view->offset;
break;
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
if (!view)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
- view->buffer = buffer;
+ view->bo = buffer->bo;
+ view->offset = buffer->offset + pCreateInfo->offset;
+
view->surface_state =
anv_state_pool_alloc(&device->surface_state_pool, 64, 64);
anv_format_for_vk_format(pCreateInfo->format);
anv_fill_buffer_surface_state(device, view->surface_state.map, format,
- pCreateInfo->offset, pCreateInfo->range,
+ view->offset, pCreateInfo->range,
format->isl_layout->bpb / 8);
*pView = anv_buffer_view_to_handle(view);
struct anv_cmd_buffer *cmd_buffer);
struct anv_buffer_view {
- struct anv_buffer *buffer;
+ struct anv_bo *bo;
+ uint32_t offset; /**< Offset into bo. */
+
struct anv_state surface_state;
};