anv: Add a device parameter to format_for_descriptor_type

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>
This commit is contained in:
Jason Ekstrand
2020-02-21 12:35:27 -06:00
parent 3d22de05ca
commit d2185f0c3f
4 changed files with 11 additions and 6 deletions

View File

@@ -975,7 +975,8 @@ void anv_CmdBindTransformFeedbackBuffersEXT(
}
enum isl_format
anv_isl_format_for_descriptor_type(VkDescriptorType type)
anv_isl_format_for_descriptor_type(const struct anv_device *device,
VkDescriptorType type)
{
switch (type) {
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:

View File

@@ -1355,7 +1355,7 @@ anv_descriptor_set_write_buffer(struct anv_device *device,
struct anv_buffer_view *bview =
&set->buffer_views[bind_layout->buffer_view_index + element];
bview->format = anv_isl_format_for_descriptor_type(type);
bview->format = anv_isl_format_for_descriptor_type(device, type);
bview->range = bind_range;
bview->address = bind_addr;

View File

@@ -4208,7 +4208,8 @@ VkResult anv_image_create(VkDevice _device,
VkImage *pImage);
enum isl_format
anv_isl_format_for_descriptor_type(VkDescriptorType type);
anv_isl_format_for_descriptor_type(const struct anv_device *device,
VkDescriptorType type);
static inline VkExtent3D
anv_sanitize_image_extent(const VkImageType imageType,

View File

@@ -2539,7 +2539,8 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
unsigned constant_data_size = shader->prog_data->const_data_size;
const enum isl_format format =
anv_isl_format_for_descriptor_type(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
anv_isl_format_for_descriptor_type(cmd_buffer->device,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
anv_fill_buffer_surface_state(cmd_buffer->device,
surface_state, format,
constant_data, constant_data_size, 1);
@@ -2558,7 +2559,8 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
anv_cmd_buffer_alloc_surface_state(cmd_buffer);
const enum isl_format format =
anv_isl_format_for_descriptor_type(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
anv_isl_format_for_descriptor_type(cmd_buffer->device,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
anv_fill_buffer_surface_state(cmd_buffer->device, surface_state,
format,
cmd_buffer->state.compute.num_workgroups,
@@ -2693,7 +2695,8 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
surface_state =
anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64);
enum isl_format format =
anv_isl_format_for_descriptor_type(desc->type);
anv_isl_format_for_descriptor_type(cmd_buffer->device,
desc->type);
anv_fill_buffer_surface_state(cmd_buffer->device, surface_state,
format, address, range, 1);