-
Notifications
You must be signed in to change notification settings - Fork 978
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
[hal/vulkan] Don't advertise features without prerequisites present. #5460
[hal/vulkan] Don't advertise features without prerequisites present. #5460
Conversation
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.
I feel like it would be easier to just inline the requirements.
features.set(F::STORAGE_RESOURCE_BINDING_ARRAY,
(features.contains(F::BUFFER_BINDING_ARRAY) && self.core.shader_storage_buffer_array_dynamic_indexing != 0) ||
(features.contains(F::TEXTURE_BINDING_ARRAY) && self.core.shader_storage_image_array_dynamic_indexing != 0)
);
features.set(F::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING,
(features.contains(F::TEXTURE_BINDING_ARRAY) && descriptor_indexing.shader_sampled_image_array_non_uniform_indexing != 0) &&
(features.contains(F::BUFFER_BINDING_ARRAY | F::STORAGE_RESOURCE_BINDING_ARRAY) && descriptor_indexing.shader_storage_buffer_array_non_uniform_indexing != 0)
);
features.set(F::UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING,
(features.contains(F::BUFFER_BINDING_ARRAY) && descriptor_indexing.shader_uniform_buffer_array_non_uniform_indexing != 0) &&
(features.contains(F::TEXTURE_BINDING_ARRAY | F::STORAGE_RESOURCE_BINDING_ARRAY) && descriptor_indexing.shader_storage_image_array_non_uniform_indexing != 0)
);
And remove the helper function altogether? ... I strongly agree. |
Yeah, I think it's more straightforward. Especially here because |
any movement on this one? |
71c2c33
to
f7cb8fd
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.
Nice!
@jimblandy looks like CI is failing. |
Don't advertise features like `STORAGE_RESOURCE_BINDING_ARRAY` unless at least one of the features it extends, like `BUFFER_BINDING_ARRAY` or `TEXTURE_BINDING_ARRAY`, is actually present. Replace the calls to `all_features_supported` with the equivalent inline code, and delete the function.
f7cb8fd
to
261ab09
Compare
Don't advertise features like
STORAGE_RESOURCE_BINDING_ARRAY
unless at least one of the features it extends, likeBUFFER_BINDING_ARRAY
orTEXTURE_BINDING_ARRAY
, is actually present.See the comments on
PhysicalDevicefeatures::prequisites_satisfied
for more details.