summaryrefslogtreecommitdiffstats
path: root/src/vulkan/gen8_state.c
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-11-13 10:24:57 -0800
committerChad Versace <[email protected]>2015-11-13 10:44:09 -0800
commitba467467f49577381be651643dd7ff184b998590 (patch)
tree9fae76e81b846109946723ad7a9cf525b0bddb19 /src/vulkan/gen8_state.c
parentaf392916ff3856c8e606212914c1623674c49aff (diff)
anv: Use enum isl_tiling everywhere
In anv_surface and anv_image_create_info, replace member 'uint8_t tile_mode' with 'enum isl_tiling'. As a nice side-effect, this patch also reduces bug potential because the hardware enum values for tile modes are unstable across hardware generations.
Diffstat (limited to 'src/vulkan/gen8_state.c')
-rw-r--r--src/vulkan/gen8_state.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c
index ce69377fd77..22fe21db1a8 100644
--- a/src/vulkan/gen8_state.c
+++ b/src/vulkan/gen8_state.c
@@ -162,13 +162,22 @@ gen8_image_view_init(struct anv_image_view *iview,
[VK_CHANNEL_SWIZZLE_A] = SCS_ALPHA
};
+ static const uint8_t isl_to_gen_tiling[] = {
+ [ISL_TILING_LINEAR] = LINEAR,
+ [ISL_TILING_X] = XMAJOR,
+ [ISL_TILING_Y] = YMAJOR,
+ [ISL_TILING_Yf] = YMAJOR,
+ [ISL_TILING_Ys] = YMAJOR,
+ [ISL_TILING_W] = WMAJOR,
+ };
+
struct GEN8_RENDER_SURFACE_STATE surface_state = {
.SurfaceType = image->surface_type,
.SurfaceArray = image->array_size > 1,
.SurfaceFormat = format_info->surface_format,
.SurfaceVerticalAlignment = anv_valign[surface->v_align],
.SurfaceHorizontalAlignment = anv_halign[surface->h_align],
- .TileMode = surface->tile_mode,
+ .TileMode = isl_to_gen_tiling[surface->tiling],
.VerticalLineStride = 0,
.VerticalLineStrideOffset = 0,
.SamplerL2BypassModeDisable = true,