From: Chad Versace Date: Fri, 8 Jan 2016 01:05:22 +0000 (-0800) Subject: anv/gen9: Fix cube surface state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1818463733639e039cffc94310556ace35dccff7;p=mesa.git anv/gen9: Fix cube surface state For gen9 SURFTYPE_CUBE, the RENDER_SURFACE_STATE's Depth, MinimumArrayElement, and RenderTargetViewExtent is in units of full cubes and so must be divided by 6. Fixes 'dEQP-VK.pipeline.image.view_type.cube_array.cube_array.*'. Now all of 'dEQP-VK.pipeline.image.*' passes. --- diff --git a/src/vulkan/gen8_state.c b/src/vulkan/gen8_state.c index a446cb26391..c29d100f9f5 100644 --- a/src/vulkan/gen8_state.c +++ b/src/vulkan/gen8_state.c @@ -212,7 +212,7 @@ genX(image_view_init)(struct anv_image_view *iview, .Depth = 0, /* TEMPLATE */ .SurfacePitch = surface->isl.row_pitch - 1, .RenderTargetViewExtent = 0, /* TEMPLATE */ - .MinimumArrayElement = range->baseArrayLayer, + .MinimumArrayElement = 0, /* TEMPLATE */ .NumberofMultisamples = MULTISAMPLECOUNT_1, .XOffset = 0, .YOffset = 0, @@ -240,7 +240,8 @@ genX(image_view_init)(struct anv_image_view *iview, switch (surface_state.SurfaceType) { case SURFTYPE_1D: case SURFTYPE_2D: - case SURFTYPE_CUBE: + surface_state.MinimumArrayElement = range->baseArrayLayer; + /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth: * * For SURFTYPE_1D, 2D, and CUBE: The range of this field is reduced @@ -259,7 +260,22 @@ genX(image_view_init)(struct anv_image_view *iview, */ surface_state.RenderTargetViewExtent = surface_state.Depth; break; + case SURFTYPE_CUBE: + #if ANV_GENx10 >= 90 + /* Like SURFTYPE_2D, but divided by 6. */ + surface_state.MinimumArrayElement = range->baseArrayLayer / 6; + surface_state.Depth = range->layerCount / 6 - 1; + surface_state.RenderTargetViewExtent = surface_state.Depth; + #else + /* Same as SURFTYPE_2D */ + surface_state.MinimumArrayElement = range->baseArrayLayer; + surface_state.Depth = range->layerCount - 1; + surface_state.RenderTargetViewExtent = surface_state.Depth; + #endif + break; case SURFTYPE_3D: + surface_state.MinimumArrayElement = range->baseArrayLayer; + /* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth: * * If the volume texture is MIP-mapped, this field specifies the