freedreno/ir3: Allocate const space for tessellation parameters
authorKristian H. Kristensen <hoegsberg@google.com>
Wed, 23 Oct 2019 02:44:42 +0000 (19:44 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Fri, 8 Nov 2019 00:40:27 +0000 (16:40 -0800)
The tessellation stages need size and stride or the patch layout as
well as locations of attributes in the patch.  The tesselation stages
also use two system memory BOs and need the iovas of those.

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/freedreno/ir3/ir3_nir.c

index fc90fbe38686a3b745f75a55d7e1d6a9250ba934..afcd87a16b9353470a5ae0057b422ee786ebbedf 100644 (file)
@@ -460,6 +460,13 @@ ir3_setup_const_state(struct ir3_shader *shader, nir_shader *nir)
                const_state->offsets.primitive_param = constoff;
                constoff += 1;
                break;
+       case MESA_SHADER_TESS_CTRL:
+       case MESA_SHADER_TESS_EVAL:
+               constoff = align(constoff - 1, 4) + 3;
+               const_state->offsets.primitive_param = constoff;
+               const_state->offsets.primitive_map = constoff + 5;
+               constoff += 5 + DIV_ROUND_UP(nir->num_inputs, 4);
+               break;
        case MESA_SHADER_GEOMETRY:
                const_state->offsets.primitive_param = constoff;
                const_state->offsets.primitive_map = constoff + 1;