-
Notifications
You must be signed in to change notification settings - Fork 692
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
[SPIR-V] Don't always force EXT_mesh_shader override #6194
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
Hi @rj12122! To run them, |
A few existing tests are failing. I think they show that this might be more complicated because we consider all extension enabled by default. |
I think the problem is that EXT_mesh_shader isn't enabled by allowAllKnownExtensions (see FeatureManager::enabledByDefault(Extension ext)) So with my change, having no explicit extensions will call allowAllKnownExtensions(), which will enable NV_mesh_shader and won't enable EXT_mesh_shader. I could save the value of opts.allowedExtensions.empty() into bool noExplicitExtensions before calling allowAllKnownExtensions(), then make the condition for enabling ext to Am I understanding right that if the user requests one extension, then they must request all extensions and can't rely on defaults? If not than what I just said wouldn't be right. Let me know if you think of a better way, thanks |
Sure, I'll add testing to the MR |
That's correct. We don't enable any other extensions not explicitly specified by the user if I think we should instead switch the |
@microsoft-github-policy-service agree [company="NVIDIA"] |
@microsoft-github-policy-service agree company="NVIDIA" |
I went with Natalie's suggestions in the current version |
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, thanks for adding the tests and making this change 😊
tools/clang/test/CodeGenSPIRV/meshshading.ext.no-explicit-exts-spv1.4.mesh.hlsl
Outdated
Show resolved
Hide resolved
tools/clang/test/CodeGenSPIRV/meshshading.nv.request-nv-with-spv1.4.mesh.hlsl
Outdated
Show resolved
Hide resolved
tools/clang/test/CodeGenSPIRV/meshshading.nv.request-nv-with-spv1.4.mesh.hlsl
Outdated
Show resolved
Hide resolved
tools/clang/test/CodeGenSPIRV/meshshading.nv.request-nv-with-spv1.4.mesh.hlsl
Outdated
Show resolved
Hide resolved
Huh I removed -fcgl from the tests (and the other changes from Keenuts) and they work locally but I see there are failing tests on github |
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.
Yeah, that's on me, I gave you the fix only for one test, not for both. Here are the 2 bits to change to fix it.
tools/clang/test/CodeGenSPIRV/meshshading.ext.no-explicit-exts-spv1.4.mesh.hlsl
Outdated
Show resolved
Hide resolved
tools/clang/test/CodeGenSPIRV/meshshading.ext.no-explicit-exts-spv1.4.mesh.hlsl
Outdated
Show resolved
Hide resolved
- This changes the FeatureManager class, so that EXT_mesh_shader is still the default choice for mesh shaders when SPIR-V 1.4 or above is supported, but is not forced even when NV_mesh_shader is requested. Before, it was impossible to choose NV_mesh_shader in that case. - We change EXT_mesh_shader's case in FeatureManager::enabledByDefault to be conditional on whether SPIR-V 1.4 or above is supported, where it used to be false. - We edit the feature manager constructor so that target environment is selected before enabling default extensions, to support the above change. - We remove the special case handling of EXT_mesh_shader from the FeatureManager constructor. Fixes #6193
- Remove -fcgl from tests.
- Make the %gl_GlobalInvocationID in the entry point optional in test cases since this can be optimized out of the spir-v output.
- Remove %gl_GlobalInvocationID from tests since it is optimized out without -fcgl.
Fixes #6193