You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AbstractShaderProgram::link(): linking failed with the following message:
(26,2-71): error X3500: array reference cannot be used as an l-value; not natively addressable
Warning: D3D shader compilation failed with default flags.
Failed to create D3D shaders.
Assertion link() failed in ../src/Magnum/Shaders/MeshVisualizer.cpp on line 107
Array subscripting syntax can also be applied to vectors to provide numeric indexing. So in
vec4 pos;
pos[2] refers to the third element of pos and is equivalent to pos.z. This allows variable indexing into a vector, as well as a generic way of accessing components. Any integer expression can be used as the subscript. The first component is at index zero. Reading from or writing to a vector using a constant integral expression with a value that is negative or greater than or equal to the size of the vector is illegal. When indexing with non-constant expressions, behavior is undefined if the index is negative or greater than or equal to the size of the vector.
Proposed solution is to work around this using ugly branch, but that might harm performance elsewhere.
int i =int(mod(vertexIndex, 3.0));
if(i ==0) barycentric.x =1.0;
elseif(i ==1) barycentric.y =1.0;
else barycentric.z =1.0;
Better (and future proof) solution would be to implement some ANGLE autodetection and enable this only if we might be running on ANGLE. Sadly there doesn't seem to be any easy way to do it.
The text was updated successfully, but these errors were encountered:
As reported in mosra/kotel#1, the ANGLE GLSL-to-HLSL converter fails to compile the shader because of non-constant vector component indexing in src/Magnum/Shaders/MeshVisualizer.vert:
The offending line is:
GLSL ES 1.0 specification allows this (section 5.5), so it should be supported in ANGLE too:
Proposed solution is to work around this using ugly branch, but that might harm performance elsewhere.
Better (and future proof) solution would be to implement some ANGLE autodetection and enable this only if we might be running on ANGLE. Sadly there doesn't seem to be any easy way to do it.
The text was updated successfully, but these errors were encountered: