diff options
Diffstat (limited to 'src/vulkan/gen7_state.c')
-rw-r--r-- | src/vulkan/gen7_state.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/vulkan/gen7_state.c b/src/vulkan/gen7_state.c index 3206f77b831..321dc3f0f5d 100644 --- a/src/vulkan/gen7_state.c +++ b/src/vulkan/gen7_state.c @@ -32,6 +32,30 @@ #include "gen7_pack.h" #include "gen75_pack.h" +static const uint8_t +anv_surftype(const struct anv_image *image, VkImageViewType view_type) +{ + switch (view_type) { + default: + unreachable("bad VkImageViewType"); + case VK_IMAGE_VIEW_TYPE_1D: + case VK_IMAGE_VIEW_TYPE_1D_ARRAY: + assert(image->type == VK_IMAGE_TYPE_1D); + return SURFTYPE_1D; + case VK_IMAGE_VIEW_TYPE_CUBE: + case VK_IMAGE_VIEW_TYPE_CUBE_ARRAY: + anv_finishme("%s:%s: cube images", __FILE__, __func__); + /* fallthrough */ + case VK_IMAGE_VIEW_TYPE_2D: + case VK_IMAGE_VIEW_TYPE_2D_ARRAY: + assert(image->type == VK_IMAGE_TYPE_2D); + return SURFTYPE_2D; + case VK_IMAGE_VIEW_TYPE_3D: + assert(image->type == VK_IMAGE_TYPE_3D); + return SURFTYPE_3D; + } +} + GENX_FUNC(GEN7, GEN75) void genX(fill_buffer_surface_state)(void *state, const struct anv_format *format, uint32_t offset, uint32_t range, @@ -242,7 +266,7 @@ genX(image_view_init)(struct anv_image_view *iview, isl_surf_get_image_alignment_sa(&surface->isl); struct GENX(RENDER_SURFACE_STATE) surface_state = { - .SurfaceType = image->surface_type, + .SurfaceType = anv_surftype(image, pCreateInfo->viewType), .SurfaceArray = image->array_size > 1, .SurfaceFormat = format->surface_format, .SurfaceVerticalAlignment = anv_valign[image_align_sa.height], |