<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">On Jan 6, 2017 10:18, "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Thanks for catching this.  I wonder how I managed to switch the GL driver over to using ISL for emitting surface states without regressing anything...<div dir="auto"><br></div><div dir="auto">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></div></div><div class="elided-text"><div class="gmail_extra"><br><div class="gmail_quote">On Jan 6, 2017 05:42, "Iago Toral Quiroga" <<a href="mailto:itoral@igalia.com" target="_blank">itoral@igalia.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This fixes layered rendering Vulkan CTS tests with cube (arrays). We<br>
also do this in the GL driver, see this code from gen8_depth_state.c<br>
for example:<br>
<br>
case GL_TEXTURE_CUBE_MAP_ARRAY:<br>
case GL_TEXTURE_CUBE_MAP:<br>
   /* The PRM claims that we should use BRW_SURFACE_CUBE for this<br>
    * situation, but experiments show that gl_Layer doesn't work when we do<br>
    * this.  So we use BRW_SURFACE_2D, since for rendering purposes this is<br>
    * equivalent.<br>
    */<br>
   surftype = BRW_SURFACE_2D;<br>
   depth *= 6;<br>
   break;<br>
<br>
So I guess we simply forgot to port this workaround to Vulkan.<br>
<br>
Fixes:<br>
dEQP-VK.geometry.layered.cube*<br>
---<br>
<br>
With this (and the previous patch I sent to fix the SBE state packet to not<br>
skip the VUE header when we need the layer information) all the layered<br>
rendering tests in Vulkan CTS seem to pass.<br>
<br>
 src/intel/isl/isl_surface_sta<wbr>te.c | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/isl/isl_surface_st<wbr>ate.c b/src/intel/isl/isl_surface_st<wbr>ate.c<br>
index 3bb0abd..0960a90 100644<br>
--- a/src/intel/isl/isl_surface_st<wbr>ate.c<br>
+++ b/src/intel/isl/isl_surface_st<wbr>ate.c<br>
@@ -113,8 +113,9 @@ get_surftype(enum isl_surf_dim dim, isl_surf_usage_flags_t usage)<br>
       assert(!(usage & ISL_SURF_USAGE_CUBE_BIT));<br>
       return SURFTYPE_1D;<br>
    case ISL_SURF_DIM_2D:<br>
-      if (usage & ISL_SURF_USAGE_STORAGE_BIT) {<br>
-         /* Storage images are always plain 2-D, not cube */<br>
+      if ((usage & ISL_SURF_USAGE_STORAGE_BIT) ||<br>
+          (usage & ISL_SURF_USAGE_RENDER_TARGET_B<wbr>IT)) {<br>
+         /* Storage / Render images are always plain 2-D, not cube */<br>
          return SURFTYPE_2D;<br>
       } else if (usage & ISL_SURF_USAGE_CUBE_BIT) {<br></blockquote></div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">On second thought... I wonder if the right thing to do here wouldnt be to just change the other condition a bit to</div><div dir="auto"><br></div><div dir="auto">if ((usage & <span style="font-family:sans-serif">ISL_SURF_USAGE_CUBE_BIT) &&</span></div><div dir="auto"><span style="font-family:sans-serif">    (usage & </span><span style="font-family:sans-serif">ISL_SURF_USAGE_TEXTURE_BIT)) {</span></div><div dir="auto"><span style="font-family:sans-serif">   /* We need SURFTYPE_CUBE to make cube sampling work */</span></div><div dir="auto"><span style="font-family:sans-serif">   return SURFTYPE_CUBE;</span></div><div dir="auto"><span style="font-family:sans-serif">} else {</span></div><div dir="auto"><span style="font-family:sans-serif">   /* Everything else (render and storage) treat cubes a plain 2D array textures */</span></div><div dir="auto"><span style="font-family:sans-serif">   return SURFTYPE_2D;</span></div><div dir="auto"><span style="font-family:sans-serif">}</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">It seems like textures, and not render targets, are the special case here.</span></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          return SURFTYPE_CUBE;<br>
--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>
</div></blockquote></div><br></div></div></div>