isl: render target cube maps should be handled as 2D images, not cubes
authorIago Toral Quiroga <itoral@igalia.com>
Fri, 6 Jan 2017 11:29:45 +0000 (12:29 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Mon, 9 Jan 2017 10:43:07 +0000 (11:43 +0100)
commit030e5f07a553716dcab9793681c56e975c42af94
tree36eabe9dbe31fb9d401295b120d56bf4bd5a6d7f
parent566a0c43f0b9fbf5106161471dd5061c7275f761
isl: render target cube maps should be handled as 2D images, not cubes

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.

v2: tweak the conditions so the special case is cube texture sampling
    rather than anything else (Jason)

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

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/isl/isl_surface_state.c