glsl/linker: fix bug when checking precision qualifier
According to GLSL ES 3.2 spec, see table in 9.2.1 "Linked Shaders"
section, the precision qualifier should match for uniform variables.
This also applies to previous GLSL ES 3.x specs.
This 'if' checks the condition for uniform variables, while for UBOs
it is checked in link_interface_blocks.cpp.
Fixes: b50b82b8a5
("glsl/es31: precision qualifier doesn't need to match in shader interface block members")
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
@@ -1111,15 +1111,10 @@ cross_validate_globals(struct gl_shader_program *prog,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only in GLSL ES 3.10, the precision qualifier should not match
|
/* Check the precision qualifier matches for uniform variables on
|
||||||
* between block members defined in matched block names within a
|
* GLSL ES.
|
||||||
* shader interface.
|
|
||||||
*
|
|
||||||
* In GLSL ES 3.00 and ES 3.20, precision qualifier for each block
|
|
||||||
* member should match.
|
|
||||||
*/
|
*/
|
||||||
if (prog->IsES && (prog->data->Version != 310 ||
|
if (prog->IsES && !var->get_interface_type() &&
|
||||||
!var->get_interface_type()) &&
|
|
||||||
existing->data.precision != var->data.precision) {
|
existing->data.precision != var->data.precision) {
|
||||||
if ((existing->data.used && var->data.used) || prog->data->Version >= 300) {
|
if ((existing->data.used && var->data.used) || prog->data->Version >= 300) {
|
||||||
linker_error(prog, "declarations for %s `%s` have "
|
linker_error(prog, "declarations for %s `%s` have "
|
||||||
|
Reference in New Issue
Block a user