anv: Remove all support for BufferViews
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.
This commit is contained in:
@@ -605,11 +605,6 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
case ANV_DESCRIPTOR_TYPE_SAMPLER:
|
case ANV_DESCRIPTOR_TYPE_SAMPLER:
|
||||||
/* Nothing for us to do here */
|
/* Nothing for us to do here */
|
||||||
continue;
|
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: {
|
case ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET: {
|
||||||
bo = desc->buffer->bo;
|
bo = desc->buffer->bo;
|
||||||
bo_offset = desc->buffer->offset + desc->offset;
|
bo_offset = desc->buffer->offset + desc->offset;
|
||||||
|
@@ -1429,44 +1429,19 @@ anv_fill_buffer_surface_state(struct anv_device *device, void *state,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VkResult
|
VkResult anv_CreateBufferView(
|
||||||
anv_buffer_view_create(
|
VkDevice _device,
|
||||||
struct anv_device * device,
|
const VkBufferViewCreateInfo* pCreateInfo,
|
||||||
const VkBufferViewCreateInfo* pCreateInfo,
|
VkBufferView* pView)
|
||||||
struct anv_buffer_view ** bview_out)
|
|
||||||
{
|
{
|
||||||
ANV_FROM_HANDLE(anv_buffer, buffer, pCreateInfo->buffer);
|
stub_return(VK_UNSUPPORTED);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void anv_DestroyBufferView(
|
void anv_DestroyBufferView(
|
||||||
VkDevice _device,
|
VkDevice _device,
|
||||||
VkBufferView _bview)
|
VkBufferView _bview)
|
||||||
{
|
{
|
||||||
ANV_FROM_HANDLE(anv_device, device, _device);
|
stub();
|
||||||
ANV_FROM_HANDLE(anv_buffer_view, bview, _bview);
|
|
||||||
|
|
||||||
anv_state_pool_free(&device->surface_state_pool, bview->surface_state);
|
|
||||||
anv_device_free(device, bview);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void anv_DestroySampler(
|
void anv_DestroySampler(
|
||||||
|
@@ -726,7 +726,6 @@ struct anv_descriptor_set_layout {
|
|||||||
|
|
||||||
enum anv_descriptor_type {
|
enum anv_descriptor_type {
|
||||||
ANV_DESCRIPTOR_TYPE_EMPTY = 0,
|
ANV_DESCRIPTOR_TYPE_EMPTY = 0,
|
||||||
ANV_DESCRIPTOR_TYPE_BUFFER_VIEW,
|
|
||||||
ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
|
ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
|
||||||
ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
|
ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
|
||||||
ANV_DESCRIPTOR_TYPE_SAMPLER,
|
ANV_DESCRIPTOR_TYPE_SAMPLER,
|
||||||
@@ -739,7 +738,6 @@ struct anv_descriptor {
|
|||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
union {
|
union {
|
||||||
struct anv_buffer_view *buffer_view;
|
|
||||||
struct anv_image_view *image_view;
|
struct anv_image_view *image_view;
|
||||||
};
|
};
|
||||||
struct anv_sampler *sampler;
|
struct anv_sampler *sampler;
|
||||||
@@ -1317,14 +1315,6 @@ struct anv_image {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
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 {
|
struct anv_image_view {
|
||||||
const struct anv_image *image; /**< VkImageViewCreateInfo::image */
|
const struct anv_image *image; /**< VkImageViewCreateInfo::image */
|
||||||
const struct anv_format *format; /**< VkImageViewCreateInfo::format */
|
const struct anv_format *format; /**< VkImageViewCreateInfo::format */
|
||||||
@@ -1371,10 +1361,6 @@ gen8_image_view_init(struct anv_image_view *iview,
|
|||||||
const VkImageViewCreateInfo* pCreateInfo,
|
const VkImageViewCreateInfo* pCreateInfo,
|
||||||
struct anv_cmd_buffer *cmd_buffer);
|
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,
|
void anv_fill_buffer_surface_state(struct anv_device *device, void *state,
|
||||||
const struct anv_format *format,
|
const struct anv_format *format,
|
||||||
uint32_t offset, uint32_t range);
|
uint32_t offset, uint32_t range);
|
||||||
@@ -1482,7 +1468,6 @@ ANV_DEFINE_HANDLE_CASTS(anv_queue, VkQueue)
|
|||||||
|
|
||||||
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_cmd_pool, VkCmdPool)
|
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_cmd_pool, VkCmdPool)
|
||||||
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_buffer, VkBuffer)
|
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, VkDescriptorSet)
|
||||||
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set_layout, VkDescriptorSetLayout)
|
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_descriptor_set_layout, VkDescriptorSetLayout)
|
||||||
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_device_memory, VkDeviceMemory)
|
ANV_DEFINE_NONDISP_HANDLE_CASTS(anv_device_memory, VkDeviceMemory)
|
||||||
|
@@ -59,30 +59,6 @@ gen7_fill_buffer_surface_state(void *state, const struct anv_format *format,
|
|||||||
GEN7_RENDER_SURFACE_STATE_pack(NULL, state, &surface_state);
|
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[] = {
|
static const uint32_t vk_to_gen_tex_filter[] = {
|
||||||
[VK_TEX_FILTER_NEAREST] = MAPFILTER_NEAREST,
|
[VK_TEX_FILTER_NEAREST] = MAPFILTER_NEAREST,
|
||||||
[VK_TEX_FILTER_LINEAR] = MAPFILTER_LINEAR
|
[VK_TEX_FILTER_LINEAR] = MAPFILTER_LINEAR
|
||||||
|
@@ -63,30 +63,6 @@ gen8_fill_buffer_surface_state(void *state, const struct anv_format *format,
|
|||||||
GEN8_RENDER_SURFACE_STATE_pack(NULL, state, &surface_state);
|
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[] = {
|
static const uint8_t anv_halign[] = {
|
||||||
[4] = HALIGN4,
|
[4] = HALIGN4,
|
||||||
[8] = HALIGN8,
|
[8] = HALIGN8,
|
||||||
|
Reference in New Issue
Block a user