Test Shader compilation wtih WEBMIN flag#1638
Open
CedricGuillemet wants to merge 13 commits into
Open
Conversation
…nto TestShaderCompilation # Conflicts: # Dependencies/CMakeLists.txt
…nto TestShaderCompilation # Conflicts: # Apps/UnitTests/CMakeLists.txt
…nto TestShaderCompilation
…nto TestShaderCompilation # Conflicts: # Apps/UnitTests/CMakeLists.txt
…raversers. UniformTypeChangeTraverser and MoveNonSamplerUniformsIntoStruct only excluded samplers and matrices, so they happily visited the symbols representing whole `layout(std140) uniform` blocks (EbtBlock) and `uniform Foo foo;` struct instances (EbtStruct), rewriting them to vec4. Once that happened, spirv-cross emitted unnamed placeholder uniforms (e.g. `uniform vec4 _1195;`) and the matrix multiplies collapsed to scalar nonsense, then bgfx asserted on the empty uniform name (`Identifier can't be empty.`). Restrict both traversers to scalar/vector basic types (Float/Int/Uint/ Bool) so blocks and structs are left intact. Also throw early in CollectNonSamplerUniforms if a uniform name is empty, so any future regression surfaces in the compiler instead of as a deep bgfx assert. Add a TODO in CMakeLists.txt to point SPIRV-Cross back to the upstream BabylonJS fork once the corresponding PR there is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use a generated shader to check no mandatory glsl function missing in spirv-cross when using WEBMIN flag.
BabylonJS/SPIRV-Cross#10
Fix
UniformTypeChangeTraverserandMoveNonSamplerUniformsIntoStructwere also visiting wholelayout(std140) uniformblocks (EbtBlock) anduniform Foo foo;struct instances (EbtStruct) and rewriting them tovec4, producing unnamed placeholder uniforms in the spirv-cross output and aIdentifier can't be empty.assert in bgfx. Both traversers are now restricted to scalar/vector basic types (Float/Int/Uint/Bool).CollectNonSamplerUniformsalso throws early if a uniform name is empty so future regressions surface in the compiler instead of deep in bgfx.