[glsl-in] Matrix construction inconsistencies and errors #4897
Labels
area: naga front-end
lang: GLSL
OpenGL Shading Language
naga
Shader Translator
type: bug
Something isn't working
Description
The GLSL Documentation Wiki for Matrix construction isn't that clear to me: https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Matrix_constructors and the spec goes into further detail: https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.50.pdf (chapter 5.4.2, pp. 98..101)
The observation is as follows:
Constructing
mat2 d
throws an error:Composing 0's component type is not expected
.Constructing
mat2 e6
also throws and error:Composing expects 2 components but 1 were given
(somewhat misleading error)My reference is Shadertoy where b1 does not work but d works (and e6 as well). Example: https://www.shadertoy.com/view/4cl3Wn
I have no tried matrices of other shapes.
Since a lot of shaders on Shadertoy use mat2 construction in combination with swizzling, this seemingly account for 10% of validation errors pygfx/shadertoy#15.
Platform
using naga-cli 0.14.0 and wgpu-native 0.18.1.3 (all recent glsl commits are missed, it might be addressed already)
The text was updated successfully, but these errors were encountered: