-
Notifications
You must be signed in to change notification settings - Fork 244
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
Add sample_bias and gather functions #704
Conversation
CI was failing on "Capability SampledRect is not allowed by Vulkan 1.1 specification (or requires extension)", except locally it was fine, and I have more up to date spirv-tools than CI, so try bumping the CI version to see if it's just an out-of-date spirv-val
@@ -136,6 +136,42 @@ impl< | |||
ACCESS_QUALIFIER, | |||
> | |||
{ | |||
// Note: #[inline] is needed because in vulkan, the component must be a constant expression. |
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.
You could plausibly add a const COMPONENT: u32
generic parameter, #[rustc_legacy_const_generics(3)]
, and remove component: u32
from the normal parameter list. AFAICT, this would result in the same call syntax working, but it gets automatically converted to the const
generic.
(this is what core::arch
uses for constant arguments - not sure how appropriate it is here, but as it stands, the argument isn't even required to be constant)
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, it's a bit of a bizarre case - when compiling for Vulkan, it's required to be constant, but when not, it's free to be a variable. I feel like there's just no good solution here.
impl< | ||
SampledType: SampleType<FORMAT>, | ||
const DEPTH: ImageDepth, | ||
const FORMAT: ImageFormat, | ||
const ARRAYED: Arrayed, | ||
const SAMPLED: Sampled, | ||
const ACCESS_QUALIFIER: Option<AccessQualifier>, | ||
> HasQuerySizeLod | ||
for Image< | ||
SampledType, | ||
{ Dimensionality::Cube }, | ||
DEPTH, | ||
ARRAYED, | ||
{ Multisampled::False }, | ||
SAMPLED, | ||
FORMAT, | ||
ACCESS_QUALIFIER, | ||
> |
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 really wish we could use _
as a shorthand for generic impls, i.e.:
impl HasQuerySizeLod for Image<_, { Dimensionality::Cube }, _, _, { Multisampled::False }, _, _, _> {}
Fixes #703
Fixes #706