summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2015-09-30 17:17:35 -0700
committerKenneth Graunke <kenneth@whitecape.org>2015-11-04 10:18:56 -0800
commit4e2d956954c489b80665694532cd12c4a50dc441 (patch)
tree9512b5804fa7977afd1c2bcdc6d64fa21a834bb1
parent5e0edf8efc7623c10db378e5e871673fcff78bb9 (diff)
nir/lower_io: Use load_per_vertex_input intrinsics for TCS and TES.
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@whitecape.org>
-rw-r--r--src/glsl/nir/nir_lower_io.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/glsl/nir/nir_lower_io.c b/src/glsl/nir/nir_lower_io.c
index 688b48f467..f04b9b85e5 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;
nir_ssa_def *indirect;
nir_ssa_def *vertex_index;