summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-05-13 12:38:12 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-05-17 12:17:22 -0700
commit1bda8d06e54ee56db89a00e7a9ed8577d724fc9f (patch)
tree204440f47818e91bb0a336864f135cf1e9c98f33
parent263a8cb52de2ef36a54b00cb1a31738ea09a0ac8 (diff)
downloadexternal_mesa3d-1bda8d06e54ee56db89a00e7a9ed8577d724fc9f.zip
external_mesa3d-1bda8d06e54ee56db89a00e7a9ed8577d724fc9f.tar.gz
external_mesa3d-1bda8d06e54ee56db89a00e7a9ed8577d724fc9f.tar.bz2
anv: Make format_for_descriptor return an isl_format
-rw-r--r--src/intel/vulkan/anv_cmd_buffer.c14
-rw-r--r--src/intel/vulkan/anv_descriptor_set.c6
-rw-r--r--src/intel/vulkan/anv_private.h4
3 files changed, 11 insertions, 13 deletions
diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c
index 5693fab..77f4283 100644
--- a/src/intel/vulkan/anv_cmd_buffer.c
+++ b/src/intel/vulkan/anv_cmd_buffer.c
@@ -688,17 +688,17 @@ add_surface_state_reloc(struct anv_cmd_buffer *cmd_buffer,
state.offset + dword * 4, bo, offset);
}
-const struct anv_format *
-anv_format_for_descriptor_type(VkDescriptorType type)
+enum isl_format
+anv_isl_format_for_descriptor_type(VkDescriptorType type)
{
switch (type) {
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
- return anv_format_for_vk_format(VK_FORMAT_R32G32B32A32_SFLOAT);
+ return ISL_FORMAT_R32G32B32A32_FLOAT;
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
- return anv_format_for_vk_format(VK_FORMAT_UNDEFINED);
+ return ISL_FORMAT_RAW;
default:
unreachable("Invalid descriptor type");
@@ -768,10 +768,10 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
surface_state =
anv_cmd_buffer_alloc_surface_state(cmd_buffer);
- const struct anv_format *format =
- anv_format_for_descriptor_type(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
+ const enum isl_format format =
+ anv_isl_format_for_descriptor_type(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
anv_fill_buffer_surface_state(cmd_buffer->device, surface_state,
- format->isl_format, bo_offset, 12, 1);
+ format, bo_offset, 12, 1);
bt_map[0] = surface_state.offset + state_offset;
add_surface_state_reloc(cmd_buffer, surface_state, bo, bo_offset);
diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c
index dd645c3..f7a9cb0 100644
--- a/src/intel/vulkan/anv_descriptor_set.c
+++ b/src/intel/vulkan/anv_descriptor_set.c
@@ -599,10 +599,8 @@ void anv_UpdateDescriptorSets(
&set->buffer_views[bind_layout->buffer_index];
view += write->dstArrayElement + j;
- const struct anv_format *format =
- anv_format_for_descriptor_type(write->descriptorType);
-
- view->format = format->isl_format;
+ view->format =
+ anv_isl_format_for_descriptor_type(write->descriptorType);
view->bo = buffer->bo;
view->offset = buffer->offset + write->pBufferInfo[j].offset;
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index e4b92d3..a5888d6 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -1675,8 +1675,8 @@ void anv_buffer_view_init(struct anv_buffer_view *view,
const VkBufferViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer);
-const struct anv_format *
-anv_format_for_descriptor_type(VkDescriptorType type);
+enum isl_format
+anv_isl_format_for_descriptor_type(VkDescriptorType type);
static inline struct VkExtent3D
anv_sanitize_image_extent(const VkImageType imageType,