mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 03:48:06 +02:00
compiler/nir: Increment shader input count and mark as used when adding new gl_PointCoord
In case a new gl_PointCoord shader input is created, increment shader input count and set valid driver_location to the new input variable, otherwise the input gets aliased to input 0 and shows up in NIR_PRINT output as whatever shader input 0 is instead of gl_PointCoord. Also set the input as used, otherwise it might get removed. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9214>
This commit is contained in:
parent
8027a7ba8a
commit
b19f1dc7d6
1 changed files with 2 additions and 0 deletions
|
|
@ -81,6 +81,8 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl,
|
|||
pntc = nir_variable_create(b.shader, nir_var_shader_in,
|
||||
glsl_vec_type(2), "gl_PointCoord");
|
||||
pntc->data.location = VARYING_SLOT_PNTC;
|
||||
pntc->data.driver_location = b.shader->num_inputs++;
|
||||
b.shader->info.inputs_read |= BITFIELD64_BIT(VARYING_SLOT_PNTC);
|
||||
}
|
||||
|
||||
new_coord = nir_load_var(&b, pntc);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue