[Mesa-dev] [PATCH] isl: render target cube maps should be handled as 2D images, not cubes

Iago Toral Quiroga itoral at igalia.com
Fri Jan 6 13:41:19 UTC 2017


This fixes layered rendering Vulkan CTS tests with cube (arrays). We
also do this in the GL driver, see this code from gen8_depth_state.c
for example:

case GL_TEXTURE_CUBE_MAP_ARRAY:
case GL_TEXTURE_CUBE_MAP:
   /* The PRM claims that we should use BRW_SURFACE_CUBE for this
    * situation, but experiments show that gl_Layer doesn't work when we do
    * this.  So we use BRW_SURFACE_2D, since for rendering purposes this is
    * equivalent.
    */
   surftype = BRW_SURFACE_2D;
   depth *= 6;
   break;

So I guess we simply forgot to port this workaround to Vulkan.

Fixes:
dEQP-VK.geometry.layered.cube*
---

With this (and the previous patch I sent to fix the SBE state packet to not
skip the VUE header when we need the layer information) all the layered
rendering tests in Vulkan CTS seem to pass.

 src/intel/isl/isl_surface_state.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 3bb0abd..0960a90 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -113,8 +113,9 @@ get_surftype(enum isl_surf_dim dim, isl_surf_usage_flags_t usage)
       assert(!(usage & ISL_SURF_USAGE_CUBE_BIT));
       return SURFTYPE_1D;
    case ISL_SURF_DIM_2D:
-      if (usage & ISL_SURF_USAGE_STORAGE_BIT) {
-         /* Storage images are always plain 2-D, not cube */
+      if ((usage & ISL_SURF_USAGE_STORAGE_BIT) ||
+          (usage & ISL_SURF_USAGE_RENDER_TARGET_BIT)) {
+         /* Storage / Render images are always plain 2-D, not cube */
          return SURFTYPE_2D;
       } else if (usage & ISL_SURF_USAGE_CUBE_BIT) {
          return SURFTYPE_CUBE;
-- 
2.7.4



More information about the mesa-dev mailing list