https://bugs.freedesktop.org/show_bug.cgi?id=104777
Bug ID: 104777
Summary: Attaching multiple shader objects for the same stage
to a GLSL program triggers a linker error
Product: Mesa
Version: git
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Mesa core
Assignee: mesa-dev@lists.freedesktop.org
Reporter: matteo.myst...@gmail.com
QA Contact: mesa-dev@lists.freedesktop.org
Specifically, I get errors like:
"error: declarations for shader output `gl_BackSecondaryColor` are in
gl_PerVertex and gl_PerVertex"
and obviously neither gl_BackSecondaryColor or gl_PerVertex are actually
redefined in the shaders, those are just the GLSL builtin variables.
FWIW this breaks d3d8 and d3d9 support in Wine since we can use two GLSL vertex
shader objects for those (where the additional vertex shader "rearranges" the
outputs of the application's vertex shader).
It's a recent regression, bisection says:
9b894c88a688904860d0f37221b78fbcb168f216 is the first bad commit
commit 9b894c88a688904860d0f37221b78fbcb168f216
Author: Juan A. Suarez Romero <jasua...@igalia.com>
Date: Tue Jan 16 19:42:35 2018 +0100
glsl/linker: link-error using the same name in unnamed block and outside
According with OpenGL GLSL 4.20 spec, section 4.3.9, page 57:
"It is a link-time error if any particular shader interface
contains:
- two different blocks, each having no instance name, and each
having a member of the same name, or
- a variable outside a block, and a block with no instance name,
where the variable has the same name as a member in the block."
This means that it is a link error if for example we have a vertex
shader with the following definition.
"layout(location=0) uniform Data { float a; float b; };"
and a fragment shader with:
"uniform float a;"
As in both cases we refer to both uniforms as "a", and thus using
glGetUniformLocation() wouldn't know which one we mean.
This fixes KHR-GL*.shaders.uniform_block.common.name_matching.
v2: add fixed tests (Tapani)
Reviewed-by: Tapani Pälli <tapani.pa...@intel.com>
I haven't spent much time debugging the affected code yet but it looks like
get_interface_type() returns different glsl_type values for builtins coming
from different shader objects. Not sure how to fix it either.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev