-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSL: Fix regression error in argument buffer runtime arrays. #2222
MSL: Fix regression error in argument buffer runtime arrays. #2222
Conversation
Argument buffers can contain multiple runtime arrays if they have fixed lengths as specified by the binding API. Regression error had assumed each runtime array is in separate argument buffer with undefined array length. - Add CompilerMSL::is_var_runtime_size_array() to include test for setting of array length via CompilerMSL::add_msl_resource_binding(). - Fixed unrelated test case MSL compile syntax failure when acceleration structure is the first entry point function argument (unrelated).
d06fb45
to
4a42191
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fragment void main0(, raytracing::acceleration_structure<raytracing::instancing> topLevelAS [[buffer(0)]]) | ||
fragment void main0(raytracing::acceleration_structure<raytracing::instancing> topLevelAS [[buffer(0)]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...How did this even pass before??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It don't think it ever did pass Metal compile. The shaders were new when added in da9c861, so no regression check, and I assume it was committed without an actual unit test run on macOS. Unit tests on other OS's bypass the Metal compile step, of course.
SPIRV-Cross Github CI doesn't build and test on macOS. Perhaps we should add a CI test sequence for that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPIRV-Cross Github CI definitely runs on macOS. Did that break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argument buffers can contain multiple runtime arrays if they have fixed lengths as specified by the binding API. Regression error had assumed each runtime array is in separate argument buffer with undefined array length.
Add
CompilerMSL::is_var_runtime_size_array()
to include test for setting of array length viaCompilerMSL::add_msl_resource_binding()
.Fixed unrelated test case MSL compile syntax failure when acceleration structure is the first entry point function argument (unrelated).
This has been tested in MoltenVK, but I couldn't think of a way of defining a SPRIV-Cross unit test for this, as it would involve calling
add_msl_resource_binding()
with some complex input.