ir3: Validate bindless samp_tex correctly
authorConnor Abbott <cwabbott0@gmail.com>
Mon, 27 Jul 2020 10:46:28 +0000 (12:46 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Jul 2020 16:38:17 +0000 (16:38 +0000)
It's full instead of half precision, because the maximum number of
textures/samplers is much larger.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6086>

src/freedreno/ir3/ir3_validate.c

index 58b5bee1e87e2e38d50920daf5d57061a7037fd3..d094bd4becb45c1cfaf966f5360d9b52ce6d08de 100644 (file)
@@ -91,14 +91,17 @@ validate_instr(struct ir3_validate_ctx *ctx, struct ir3_instruction *instr)
 
                /* Validate that all src's are either half of full.
                 *
-                * Note: tex instructions w/ .s2en are a bit special in
-                * that the tex/samp src reg is half-reg irrespective of
-                * the precision of other srcs.  The tex/samp src is the
-                * first src reg when .s2en is set
+                * Note: tex instructions w/ .s2en are a bit special in that the
+                * tex/samp src reg is half-reg for non-bindless and full for
+                * bindless, irrespective of the precision of other srcs. The
+                * tex/samp src is the first src reg when .s2en is set
                 */
                if ((instr->flags & IR3_INSTR_S2EN) && (n < 2)) {
                        if (n == 0) {
-                               validate_assert(ctx, reg->flags & IR3_REG_HALF);
+                               if (instr->flags & IR3_INSTR_B)
+                                       validate_assert(ctx, !(reg->flags & IR3_REG_HALF));
+                               else
+                                       validate_assert(ctx, reg->flags & IR3_REG_HALF);
                        }
                } else if (n > 0) {
                        validate_assert(ctx, (last_reg->flags & IR3_REG_HALF) == (reg->flags & IR3_REG_HALF));