Closed tklajnscek closed 4 years ago
How do you use your matrix in shader? If you are writing mul(vector, matrix), a row major matrix on CPU need to be transposed and copy to cbuffer. If it's mul(matrix, vector), you don't need the transpose matries on CPU, but the shader is in lower efficiency.
Describe the bug Options::packMatricesInRowMajor is inverted. Setting it to true, passes in '-Zpc' which makes the compiler generate column major matrices.
To Reproduce Inspect the source code:
Expected behavior The values need to be inverted. Reading the comment it seems that this might've been intentionally inverted to fix SPIRV codegen, but my DX12/Vulkan/GLES engine works correctly for all three APIs when I pass in -Zpr and my matrices are row major in memory.