panfrost/midgard: Assert guard texelFetch against cubemaps
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 24 Jun 2019 21:39:25 +0000 (14:39 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 25 Jun 2019 20:39:18 +0000 (13:39 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/midgard/midgard_compile.c

index 336edac2171f12d1650417e9831b8a51b6dbdbfa..09b11c2ddee2a81a196634e2fdd774d50937e779 100644 (file)
@@ -1482,6 +1482,9 @@ emit_texop_native(compiler_context *ctx, nir_tex_instr *instr,
                 switch (instr->src[i].src_type) {
                 case nir_tex_src_coord: {
                         if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE) {
+                                /* texelFetch is undefined on samplerCube */
+                                assert(midgard_texop != TEXTURE_OP_TEXEL_FETCH);
+
                                 /* For cubemaps, we need to load coords into
                                  * special r27, and then use a special ld/st op
                                  * to select the face and copy the xy into the