v3d: Assert that we do request the normal texturing return data.
authorEric Anholt <eric@anholt.net>
Thu, 25 Apr 2019 18:23:55 +0000 (11:23 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 26 Apr 2019 19:42:30 +0000 (12:42 -0700)
An unused tex should be DCEed, but if it wasn't we'd run into trouble with
not doing a TMUWT.

src/broadcom/compiler/v3d40_tex.c

index 679f1f15f81c54bedfda4021e93a08e5c39a2055..e5a45c1f003f27fcb4ff62a94f24b6a1490b12df 100644 (file)
@@ -183,6 +183,8 @@ v3d40_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr)
         assert(p1_unpacked.output_type_32_bit ||
                p0_unpacked.return_words_of_texture_data < (1 << 2));
 
+        assert(p0_unpacked.return_words_of_texture_data != 0);
+
         uint32_t p0_packed;
         V3D41_TMU_CONFIG_PARAMETER_0_pack(NULL,
                                           (uint8_t *)&p0_packed,