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:
@@ -975,7 +975,8 @@ void anv_CmdBindTransformFeedbackBuffersEXT(
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum isl_format
|
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) {
|
switch (type) {
|
||||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
||||||
|
@@ -1355,7 +1355,7 @@ anv_descriptor_set_write_buffer(struct anv_device *device,
|
|||||||
struct anv_buffer_view *bview =
|
struct anv_buffer_view *bview =
|
||||||
&set->buffer_views[bind_layout->buffer_view_index + element];
|
&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->range = bind_range;
|
||||||
bview->address = bind_addr;
|
bview->address = bind_addr;
|
||||||
|
|
||||||
|
@@ -4208,7 +4208,8 @@ VkResult anv_image_create(VkDevice _device,
|
|||||||
VkImage *pImage);
|
VkImage *pImage);
|
||||||
|
|
||||||
enum isl_format
|
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
|
static inline VkExtent3D
|
||||||
anv_sanitize_image_extent(const VkImageType imageType,
|
anv_sanitize_image_extent(const VkImageType imageType,
|
||||||
|
@@ -2539,7 +2539,8 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
unsigned constant_data_size = shader->prog_data->const_data_size;
|
unsigned constant_data_size = shader->prog_data->const_data_size;
|
||||||
|
|
||||||
const enum isl_format format =
|
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,
|
anv_fill_buffer_surface_state(cmd_buffer->device,
|
||||||
surface_state, format,
|
surface_state, format,
|
||||||
constant_data, constant_data_size, 1);
|
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);
|
anv_cmd_buffer_alloc_surface_state(cmd_buffer);
|
||||||
|
|
||||||
const enum isl_format format =
|
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,
|
anv_fill_buffer_surface_state(cmd_buffer->device, surface_state,
|
||||||
format,
|
format,
|
||||||
cmd_buffer->state.compute.num_workgroups,
|
cmd_buffer->state.compute.num_workgroups,
|
||||||
@@ -2693,7 +2695,8 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
|
|||||||
surface_state =
|
surface_state =
|
||||||
anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64);
|
anv_state_stream_alloc(&cmd_buffer->surface_state_stream, 64, 64);
|
||||||
enum isl_format format =
|
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,
|
anv_fill_buffer_surface_state(cmd_buffer->device, surface_state,
|
||||||
format, address, range, 1);
|
format, address, range, 1);
|
||||||
|
Reference in New Issue
Block a user