Expose more functions#10
Merged
CedricGuillemet merged 4 commits intoMay 12, 2026
Merged
Conversation
…exposeMissingFunctions # Conflicts: # spirv_hlsl.cpp
There was a problem hiding this comment.
Pull request overview
This PR adjusts SPIRV-Cross’ WEBMIN build configuration to expose additional MSL and HLSL codegen helpers that were previously excluded (or stubbed as invalid), enabling more shaders/opcodes to be validated under WEBMIN (as needed by the referenced BabylonNative unittest).
Changes:
- MSL: Move several helper implementations out of
SPIRV_CROSS_WEBMIN-guarded regions and remove corresponding WEBMIN stubs. - HLSL: Remove
SPIRV_CROSS_WEBMINguards that previously rejected certain opcodes (e.g.,OpFMod,OpFwidth*,OpIsNan/OpIsInf, logical ops) and expose required helper implementations. - General: Refactor/reorder function definitions to make the newly exposed functionality available in WEBMIN builds.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| spirv_msl.cpp | Exposes additional MSL helper implementations to WEBMIN and removes now-unneeded WEBMIN stubs. |
| spirv_hlsl.cpp | Enables more instruction emission paths under WEBMIN and moves helper implementations to be available in WEBMIN builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+24456
to
+24463
| // Pass internal array of spvUnsafeArray<> into wrapper functions | ||
| if (lhs_is_array_template && rhs_is_array_template && !msl_options.force_native_arrays) | ||
| statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ".elements, ", to_expression(rhs_id), ".elements);"); | ||
| if (lhs_is_array_template && !msl_options.force_native_arrays) | ||
| statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ".elements, ", to_expression(rhs_id), ");"); | ||
| else if (rhs_is_array_template && !msl_options.force_native_arrays) | ||
| statement("spvArrayCopy", tag, type.array.size(), "(", lhs, ", ", to_expression(rhs_id), ".elements);"); | ||
| else |
bkaradzic-microsoft
approved these changes
May 12, 2026
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 this unittest to check all mandatory glsl construction are valid with webmin flag on.
BabylonJS/BabylonNative#1638
Some functions were missing and are added in this PR.
Windows BN PG build:
before : 3.27 Mb (3,429,888 bytes)
after : 3.28Mb 3,446,272 bytes
+15Kb