We are trying to migrate our project from runtime compiled shaders to precompiled SPIRV. It was going well until I tried an AMD GPU (Windows 11, Radeon RX 6800S). I'm using plain uniforms for my transformation matrices. When I use glGetActiveUniform to get their type on NVidia, I get GL_FLOAT_MAT4. But when I do it on AMD, I get GL_FLOAT_VEC4 of size 4.
I don't want to have to make weird assumptions about mat4 being an array of vec4 only on certain systems. I also don't want to just move all mat4s to arrays of vec4, since this means I have to do extra work with uniform layout locations in the shaders. I could switch to some alternative way to pass my matrices in like SSBO, but I'd rather not yet, and this seems like basic usage that should work fine (and does on other devices). I'm assuming I goofed something up and not a driver bug, since it's such a basic problem. I created a minimal repro case and pushed it to a git repo. What might cause this? FYI, this repo assumes glslangValidator is available on the dev machine.
We are trying to migrate our project from runtime compiled shaders to precompiled SPIRV. It was going well until I tried an AMD GPU (Windows 11, Radeon RX 6800S). I'm using plain uniforms for my transformation matrices. When I use glGetActiveUniform to get their type on NVidia, I get GL_FLOAT_MAT4. But when I do it on AMD, I get GL_FLOAT_VEC4 of size 4.
I don't want to have to make weird assumptions about mat4 being an array of vec4 only on certain systems. I also don't want to just move all mat4s to arrays of vec4, since this means I have to do extra work with uniform layout locations in the shaders. I could switch to some alternative way to pass my matrices in like SSBO, but I'd rather not yet, and this seems like basic usage that should work fine (and does on other devices). I'm assuming I goofed something up and not a driver bug, since it's such a basic problem. I created a minimal repro case and pushed it to a git repo. What might cause this? FYI, this repo assumes glslangValidator is available on the dev machine.
https://github.com/cubeleo/GLSPIRVMatrixBugAMD.git