mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
glsl: fix counting of vertex shader output slots used by explicit vars
The argument to count_attribute_slots should only be set to true for
vertex inputs, not for all vertex shader varyings.
Fixes KHR-GL45.enhanced_layouts.varying_locations
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit eefeff09a7)
This commit is contained in:
parent
c62dc8e61e
commit
70f7f60f0c
1 changed files with 2 additions and 1 deletions
|
|
@ -2017,7 +2017,8 @@ reserved_varying_slot(struct gl_linked_shader *stage,
|
|||
var_slot = var->data.location - VARYING_SLOT_VAR0;
|
||||
|
||||
unsigned num_elements = get_varying_type(var, stage->Stage)
|
||||
->count_attribute_slots(stage->Stage == MESA_SHADER_VERTEX);
|
||||
->count_attribute_slots(io_mode == ir_var_shader_in &&
|
||||
stage->Stage == MESA_SHADER_VERTEX);
|
||||
for (unsigned i = 0; i < num_elements; i++) {
|
||||
if (var_slot >= 0 && var_slot < MAX_VARYINGS_INCL_PATCH)
|
||||
slots |= UINT64_C(1) << var_slot;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue