aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-10-18 13:02:15 -0400
committerMarek Olšák <[email protected]>2019-10-23 21:12:52 -0400
commit28199aeee5254d195b63a71c290a365da4496f75 (patch)
tree240055f5e25aa5c80218a6a4d967c692c5b62d27 /src/compiler
parenteaffdad10820661172aa8808cc20c00bc928809e (diff)
st/mesa: assign driver locations for VS inputs for NIR before caching
fix up edge flags in the NIR pass, because st/mesa doesn't touch the inputs after caching Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_passthrough_edgeflags.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_lower_passthrough_edgeflags.c b/src/compiler/nir/nir_lower_passthrough_edgeflags.c
index f34078c8999..0afcaa0b125 100644
--- a/src/compiler/nir/nir_lower_passthrough_edgeflags.c
+++ b/src/compiler/nir/nir_lower_passthrough_edgeflags.c
@@ -39,6 +39,11 @@ lower_impl(nir_function_impl *impl)
glsl_vec4_type(), "edgeflag_in");
in->data.location = VERT_ATTRIB_EDGEFLAG;
+ /* The edge flag is the last input in st/mesa. */
+ assert(shader->num_inputs == util_bitcount64(shader->info.inputs_read));
+ in->data.driver_location = shader->num_inputs++;
+ shader->info.inputs_read |= BITFIELD64_BIT(VERT_ATTRIB_EDGEFLAG);
+
out = nir_variable_create(shader, nir_var_shader_out,
glsl_vec4_type(), "edgeflag_out");
out->data.location = VARYING_SLOT_EDGE;