On Saturday, December 12, 2015 10:21:19 PM Jordan Justen wrote: > On 2015-12-11 13:23:57, Kenneth Graunke wrote: > > TCS outputs and TES inputs both refer to a common "patch URB entry" > > shared across all invocations. First, there are some number of > > per-patch entries. Then, there are per-vertex entries accessed via > > an offset for the variable and a stride times the vertex index. > > > > Because these calculations need to be done in both the vec4 and scalar > > backends, it's simpler to just compute the offset calculations in NIR. > > It doesn't necessarily make much sense to use per-vertex intrinsics > > afterwards, but that at least means we don't lose the per-patch vs. > > per-vertex information. > > > > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> > > --- > > src/mesa/drivers/dri/i965/brw_nir.c | 122 > > +++++++++++++++++++++++++++++++++++- > > 1 file changed, 120 insertions(+), 2 deletions(-) > > > > diff --git a/src/mesa/drivers/dri/i965/brw_nir.c > > b/src/mesa/drivers/dri/i965/brw_nir.c > > index 9cf4944..e46e177 100644 > > --- a/src/mesa/drivers/dri/i965/brw_nir.c > > +++ b/src/mesa/drivers/dri/i965/brw_nir.c > > @@ -133,6 +133,69 @@ remap_inputs_with_vue_map(nir_block *block, void > > *closure) > > return true; > > } > > > > +struct remap_patch_urb_offsets_state { > > + nir_builder b; > > + struct brw_vue_map vue_map; > > +}; > > + > > +static bool > > +remap_patch_urb_offsets(nir_block *block, void *closure) > > +{ > > + struct remap_patch_urb_offsets_state *state = closure; > > + > > + nir_foreach_instr_safe(block, instr) { > > + if (instr->type != nir_instr_type_intrinsic) > > + continue; > > + > > + nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); > > + > > + bool is_input = > > + intrin->intrinsic == nir_intrinsic_load_input || > > + intrin->intrinsic == nir_intrinsic_load_per_vertex_input; > > + > > + bool is_output = > > + intrin->intrinsic == nir_intrinsic_load_output || > > + intrin->intrinsic == nir_intrinsic_load_per_vertex_output || > > + intrin->intrinsic == nir_intrinsic_store_output || > > + intrin->intrinsic == nir_intrinsic_store_per_vertex_output; > > Can you call the functions you added previously? (i965: Separate base > offset/constant offset combining from remapping.) > > 7 & 8 Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com>
Oh, good call - I wrote this patch first, even though it came later in the series. That makes a ton of sense. I've changed it to: + gl_shader_stage stage = state->b.shader->stage; + + if ((stage == MESA_SHADER_TESS_CTRL && is_output(intrin)) || + (stage == MESA_SHADER_TESS_EVAL && is_input(intrin))) {
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev