Skip to content

Expose more functions#10

Merged
CedricGuillemet merged 4 commits into
BabylonJS:mainfrom
CedricGuillemet:exposeMissingFunctions
May 12, 2026
Merged

Expose more functions#10
CedricGuillemet merged 4 commits into
BabylonJS:mainfrom
CedricGuillemet:exposeMissingFunctions

Conversation

@CedricGuillemet
Copy link
Copy Markdown

@CedricGuillemet CedricGuillemet commented Mar 19, 2026

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_WEBMIN guards 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 thread spirv_msl.cpp
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
@CedricGuillemet CedricGuillemet merged commit e1d29b3 into BabylonJS:main May 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants