mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
glsl: only add outward facing varyings to resourse list for SSO
An SSO program can have multiple stages and we only want to add the externally facing varyings. The current code was adding both the packed inputs and outputs for the first and last stage of each program. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
parent
4d2a7f5111
commit
0508d9504a
1 changed files with 10 additions and 7 deletions
|
|
@ -3433,7 +3433,7 @@ add_interface_variables(struct gl_shader_program *shProg,
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
add_packed_varyings(struct gl_shader_program *shProg, int stage)
|
add_packed_varyings(struct gl_shader_program *shProg, int stage, GLenum type)
|
||||||
{
|
{
|
||||||
struct gl_shader *sh = shProg->_LinkedShaders[stage];
|
struct gl_shader *sh = shProg->_LinkedShaders[stage];
|
||||||
GLenum iface;
|
GLenum iface;
|
||||||
|
|
@ -3454,12 +3454,15 @@ add_packed_varyings(struct gl_shader_program *shProg, int stage)
|
||||||
default:
|
default:
|
||||||
unreachable("unexpected type");
|
unreachable("unexpected type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type == iface) {
|
||||||
if (!add_program_resource(shProg, iface, var,
|
if (!add_program_resource(shProg, iface, var,
|
||||||
build_stageref(shProg, var->name,
|
build_stageref(shProg, var->name,
|
||||||
var->data.mode)))
|
var->data.mode)))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3724,9 +3727,9 @@ build_program_resource_list(struct gl_shader_program *shProg)
|
||||||
|
|
||||||
/* Program interface needs to expose varyings in case of SSO. */
|
/* Program interface needs to expose varyings in case of SSO. */
|
||||||
if (shProg->SeparateShader) {
|
if (shProg->SeparateShader) {
|
||||||
if (!add_packed_varyings(shProg, input_stage))
|
if (!add_packed_varyings(shProg, input_stage, GL_PROGRAM_INPUT))
|
||||||
return;
|
return;
|
||||||
if (!add_packed_varyings(shProg, output_stage))
|
if (!add_packed_varyings(shProg, output_stage, GL_PROGRAM_OUTPUT))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue