[Mesa-dev] [PATCH 1/4] nir/lower_io: Use load_per_vertex_input intrinsics for TCS and TES.
Jason Ekstrand
jason at jlekstrand.net
Thu Nov 12 16:45:10 PST 2015
On Tue, Nov 10, 2015 at 1:21 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> Tessellation control shader inputs are an array indexed by the vertex
> number, like geometry shader inputs. There aren't per-patch TCS inputs.
>
> Tessellation evaluation shaders have both per-vertex and per-patch
> inputs. Per-vertex inputs get the new intrinsics; per-patch inputs
> continue to use the ordinary load_input intrinsics, as they already
> work like we want them to.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/glsl/nir/nir_lower_io.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
> index 688b48f..f04b9b8 100644
> --- a/src/glsl/nir/nir_lower_io.c
> +++ b/src/glsl/nir/nir_lower_io.c
> @@ -71,7 +71,9 @@ static bool
> stage_uses_per_vertex_inputs(struct lower_io_state *state)
> {
> gl_shader_stage stage = state->builder.shader->stage;
> - return stage == MESA_SHADER_GEOMETRY;
> + return stage == MESA_SHADER_TESS_CTRL ||
> + stage == MESA_SHADER_TESS_EVAL ||
> + stage == MESA_SHADER_GEOMETRY;
> }
>
> static unsigned
> @@ -185,7 +187,8 @@ nir_lower_io_block(nir_block *block, void *void_state)
> continue;
>
> bool per_vertex = stage_uses_per_vertex_inputs(state) &&
> - mode == nir_var_shader_in;
> + mode == nir_var_shader_in &&
> + !intrin->variables[0]->var->data.patch;
Why not just make it a is_per_vertex_input function?
>
> nir_ssa_def *indirect;
> nir_ssa_def *vertex_index;
> --
> 2.6.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list