-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
gfx-rs/naga
#1802Labels
area: naga back-endOutputs of naga shader conversionOutputs of naga shader conversionhelp requiredWe need community help to make this happen.We need community help to make this happen.lang: GLSLOpenGL Shading LanguageOpenGL Shading Languagelang: SPIR-VVulkan's Shading LanguageVulkan's Shading LanguagenagaShader TranslatorShader Translatortype: bugSomething isn't workingSomething isn't working
Milestone
Description
WGSL expects a matCx2 to have a matrix stride of 8 (inner vector components to be aligned to 8 bytes including itself).
SPIR-V/GLSL/HLSL expect a matCx2 to have a matrix stride of 16 (inner vector components to be aligned to 16 bytes including itself).
Solution
Replace matCx2 with a sequence of C vec2's (since vec2s alignment is 8) and reconstruct the matrix in the shader.
References
WGSL Alignment and Size
GLSL Standard Uniform Block Layout
HLSL DirectXShaderCompiler Buffer-Packing Wiki
Vulkan Offset and Stride Assignment
Related issues
gfx-rs/naga#1400 (gfx-rs/naga#1400 (comment)), #4375, #4376 - inverse of this issue (concerning the frontends)
kvark and SludgePhD
Metadata
Metadata
Assignees
Labels
area: naga back-endOutputs of naga shader conversionOutputs of naga shader conversionhelp requiredWe need community help to make this happen.We need community help to make this happen.lang: GLSLOpenGL Shading LanguageOpenGL Shading Languagelang: SPIR-VVulkan's Shading LanguageVulkan's Shading LanguagenagaShader TranslatorShader Translatortype: bugSomething isn't workingSomething isn't working
Type
Projects
Status
No status