We never *actually* supported them, we just used them for binding UBOs.
Now that we have BufferInfo and we aren't supporting texture buffers yet,
we should get rid of them until we can do them properly.
case ANV_DESCRIPTOR_TYPE_SAMPLER:
/* Nothing for us to do here */
continue;
- case ANV_DESCRIPTOR_TYPE_BUFFER_VIEW:
- surface_state = desc->buffer_view->surface_state;
- bo = desc->buffer_view->bo;
- 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;
}
}
-VkResult
-anv_buffer_view_create(
- struct anv_device * device,
- const VkBufferViewCreateInfo* pCreateInfo,
- struct anv_buffer_view ** bview_out)
+VkResult anv_CreateBufferView(
+ VkDevice _device,
+ const VkBufferViewCreateInfo* pCreateInfo,
+ VkBufferView* pView)
{
- ANV_FROM_HANDLE(anv_buffer, buffer, pCreateInfo->buffer);
- struct anv_buffer_view *bview;
-
- assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO);
-
- bview = anv_device_alloc(device, sizeof(*bview), 8,
- VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
- if (bview == NULL)
- return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
-
- *bview = (struct anv_buffer_view) {
- .bo = buffer->bo,
- .offset = buffer->offset + pCreateInfo->offset,
- .surface_state = anv_state_pool_alloc(&device->surface_state_pool, 64, 64),
- .format = anv_format_for_vk_format(pCreateInfo->format),
- .range = pCreateInfo->range,
- };
-
- *bview_out = bview;
-
- return VK_SUCCESS;
+ stub_return(VK_UNSUPPORTED);
}
void anv_DestroyBufferView(
VkDevice _device,
VkBufferView _bview)
{
- ANV_FROM_HANDLE(anv_device, device, _device);
- ANV_FROM_HANDLE(anv_buffer_view, bview, _bview);
-
- anv_state_pool_free(&device->surface_state_pool, bview->surface_state);
- anv_device_free(device, bview);
+ stub();
}
void anv_DestroySampler(
enum anv_descriptor_type {
ANV_DESCRIPTOR_TYPE_EMPTY = 0,
- ANV_DESCRIPTOR_TYPE_BUFFER_VIEW,
ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
ANV_DESCRIPTOR_TYPE_SAMPLER,
union {
struct {
union {
- struct anv_buffer_view *buffer_view;
struct anv_image_view *image_view;
};
struct anv_sampler *sampler;
};
};
-struct anv_buffer_view {
- struct anv_state surface_state; /**< RENDER_SURFACE_STATE */
- struct anv_bo *bo;
- uint32_t offset; /**< Offset into bo. */
- uint32_t range; /**< VkBufferViewCreateInfo::range */
- const struct anv_format *format; /**< VkBufferViewCreateInfo::format */
-};
-
struct anv_image_view {
const struct anv_image *image; /**< VkImageViewCreateInfo::image */
const struct anv_format *format; /**< VkImageViewCreateInfo::format */
const VkImageViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer);
-VkResult anv_buffer_view_create(struct anv_device *device,
- const VkBufferViewCreateInfo *pCreateInfo,
- struct anv_buffer_view **bview_out);
-
void anv_fill_buffer_surface_state(struct anv_device *device, void *state,
const struct anv_format *format,
uint32_t offset, uint32_t range);
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_cmd_pool, VkCmdPool)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer, VkBuffer)
-ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer_view, VkBufferView);
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set, VkDescriptorSet)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set_layout, VkDescriptorSetLayout)
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_device_memory, VkDeviceMemory)
GEN7_RENDER_SURFACE_STATE_pack(NULL, state, &surface_state);
}
-VkResult gen7_CreateBufferView(
- VkDevice _device,
- const VkBufferViewCreateInfo* pCreateInfo,
- VkBufferView* pView)
-{
- ANV_FROM_HANDLE(anv_device, device, _device);
- struct anv_buffer_view *bview;
- VkResult result;
-
- result = anv_buffer_view_create(device, pCreateInfo, &bview);
- if (result != VK_SUCCESS)
- return result;
-
- const struct anv_format *format =
- anv_format_for_vk_format(pCreateInfo->format);
-
- gen7_fill_buffer_surface_state(bview->surface_state.map, format,
- bview->offset, pCreateInfo->range);
-
- *pView = anv_buffer_view_to_handle(bview);
-
- return VK_SUCCESS;
-}
-
static const uint32_t vk_to_gen_tex_filter[] = {
[VK_TEX_FILTER_NEAREST] = MAPFILTER_NEAREST,
[VK_TEX_FILTER_LINEAR] = MAPFILTER_LINEAR
GEN8_RENDER_SURFACE_STATE_pack(NULL, state, &surface_state);
}
-VkResult gen8_CreateBufferView(
- VkDevice _device,
- const VkBufferViewCreateInfo* pCreateInfo,
- VkBufferView* pView)
-{
- ANV_FROM_HANDLE(anv_device, device, _device);
- struct anv_buffer_view *bview;
- VkResult result;
-
- result = anv_buffer_view_create(device, pCreateInfo, &bview);
- if (result != VK_SUCCESS)
- return result;
-
- const struct anv_format *format =
- anv_format_for_vk_format(pCreateInfo->format);
-
- gen8_fill_buffer_surface_state(bview->surface_state.map, format,
- bview->offset, pCreateInfo->range);
-
- *pView = anv_buffer_view_to_handle(bview);
-
- return VK_SUCCESS;
-}
-
static const uint8_t anv_halign[] = {
[4] = HALIGN4,
[8] = HALIGN8,