diff --git a/crates/rustc_codegen_spirv/src/abi.rs b/crates/rustc_codegen_spirv/src/abi.rs
index ea290b3ac0..07076f329e 100644
--- a/crates/rustc_codegen_spirv/src/abi.rs
+++ b/crates/rustc_codegen_spirv/src/abi.rs
@@ -25,7 +25,6 @@ use std::collections::hash_map::Entry;
use std::fmt;
use num_traits::cast::FromPrimitive;
-use rspirv::spirv;
/// If a struct contains a pointer to itself, even indirectly, then doing a naiive recursive walk
/// of the fields will result in an infinite loop. Because pointers are the only thing that are
@@ -715,17 +714,17 @@ fn trans_intrinsic_type<'tcx>(
return Err(ErrorReported);
}
- fn type_from_variant_discriminant<'tcx, P: FromPrimitive>(
- cx: &CodegenCx<'tcx>,
- const_: &'tcx Const<'tcx>,
- ) -> P {
- let adt_def = const_.ty.ty_adt_def().unwrap();
- assert!(adt_def.is_enum());
- let destructured = cx.tcx.destructure_const(ParamEnv::reveal_all().and(const_));
- let idx = destructured.variant.unwrap();
- let value = const_.ty.discriminant_for_variant(cx.tcx, idx).unwrap().val as u64;
- <_>::from_u64(value).unwrap()
- }
+ // fn type_from_variant_discriminant<'tcx, P: FromPrimitive>(
+ // cx: &CodegenCx<'tcx>,
+ // const_: &'tcx Const<'tcx>,
+ // ) -> P {
+ // let adt_def = const_.ty.ty_adt_def().unwrap();
+ // assert!(adt_def.is_enum());
+ // let destructured = cx.tcx.destructure_const(ParamEnv::reveal_all().and(const_));
+ // let idx = destructured.variant.unwrap();
+ // let value = const_.ty.discriminant_for_variant(cx.tcx, idx).unwrap().val as u64;
+ // <_>::from_u64(value).unwrap()
+ // }
let sampled_type = match substs.type_at(0).kind() {
TyKind::Int(int) => match int {
@@ -760,25 +759,37 @@ fn trans_intrinsic_type<'tcx>(
}
};
- let dim: spirv::Dim = type_from_variant_discriminant(cx, substs.const_at(1));
- let depth: u32 = type_from_variant_discriminant(cx, substs.const_at(2));
- let arrayed: u32 = type_from_variant_discriminant(cx, substs.const_at(3));
- let multisampled: u32 = type_from_variant_discriminant(cx, substs.const_at(4));
- let sampled: u32 = type_from_variant_discriminant(cx, substs.const_at(5));
- let image_format: spirv::ImageFormat =
- type_from_variant_discriminant(cx, substs.const_at(6));
-
- let access_qualifier = {
- let option = cx
- .tcx
- .destructure_const(ParamEnv::reveal_all().and(substs.const_at(7)));
-
- match option.variant.map(|i| i.as_u32()).unwrap_or(0) {
- 0 => None,
- 1 => Some(type_from_variant_discriminant(cx, option.fields[0])),
- _ => unreachable!(),
+ // let dim: spirv::Dim = type_from_variant_discriminant(cx, substs.const_at(1));
+ // let depth: u32 = type_from_variant_discriminant(cx, substs.const_at(2));
+ // let arrayed: u32 = type_from_variant_discriminant(cx, substs.const_at(3));
+ // let multisampled: u32 = type_from_variant_discriminant(cx, substs.const_at(4));
+ // let sampled: u32 = type_from_variant_discriminant(cx, substs.const_at(5));
+ // let image_format: spirv::ImageFormat =
+ // type_from_variant_discriminant(cx, substs.const_at(6));
+
+ fn const_int_value<'tcx, P: FromPrimitive>(
+ cx: &CodegenCx<'tcx>,
+ const_: &'tcx Const<'tcx>,
+ ) -> Result
{
+ assert!(const_.ty.is_integral());
+ let value = const_.eval_bits(cx.tcx, ParamEnv::reveal_all(), const_.ty);
+ match P::from_u128(value) {
+ Some(v) => Ok(v),
+ None => {
+ cx.tcx
+ .sess
+ .err(&format!("Invalid value for Image const generic: {}", value));
+ Err(ErrorReported)
+ }
}
- };
+ }
+
+ let dim = const_int_value(cx, substs.const_at(1))?;
+ let depth = const_int_value(cx, substs.const_at(2))?;
+ let arrayed = const_int_value(cx, substs.const_at(3))?;
+ let multisampled = const_int_value(cx, substs.const_at(4))?;
+ let sampled = const_int_value(cx, substs.const_at(5))?;
+ let image_format = const_int_value(cx, substs.const_at(6))?;
let ty = SpirvType::Image {
sampled_type,
@@ -788,7 +799,6 @@ fn trans_intrinsic_type<'tcx>(
multisampled,
sampled,
image_format,
- access_qualifier,
};
Ok(ty.def(span, cx))
}
diff --git a/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs b/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs
index e57c347f6e..41ab7bb9a0 100644
--- a/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs
+++ b/crates/rustc_codegen_spirv/src/builder/spirv_asm.rs
@@ -343,7 +343,6 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
multisampled: inst.operands[4].unwrap_literal_int32(),
sampled: inst.operands[5].unwrap_literal_int32(),
image_format: inst.operands[6].unwrap_image_format(),
- access_qualifier: None,
}
.def(self.span(), self),
Op::TypeSampledImage => SpirvType::SampledImage {
diff --git a/crates/rustc_codegen_spirv/src/spirv_type.rs b/crates/rustc_codegen_spirv/src/spirv_type.rs
index 1c1eb76a1c..7b3d8b957d 100644
--- a/crates/rustc_codegen_spirv/src/spirv_type.rs
+++ b/crates/rustc_codegen_spirv/src/spirv_type.rs
@@ -4,9 +4,7 @@ use crate::codegen_cx::CodegenCx;
use bimap::BiHashMap;
use indexmap::IndexSet;
use rspirv::dr::Operand;
-use rspirv::spirv::{
- AccessQualifier, Capability, Decoration, Dim, ImageFormat, StorageClass, Word,
-};
+use rspirv::spirv::{Capability, Decoration, Dim, ImageFormat, StorageClass, Word};
use rustc_data_structures::fx::FxHashMap;
use rustc_span::def_id::DefId;
use rustc_span::Span;
@@ -75,7 +73,6 @@ pub enum SpirvType {
multisampled: u32,
sampled: u32,
image_format: ImageFormat,
- access_qualifier: Option,
},
Sampler,
SampledImage {
@@ -243,7 +240,6 @@ impl SpirvType {
multisampled,
sampled,
image_format,
- access_qualifier,
} => cx.emit_global().type_image_id(
id,
sampled_type,
@@ -253,7 +249,7 @@ impl SpirvType {
multisampled,
sampled,
image_format,
- access_qualifier,
+ None,
),
Self::Sampler => cx.emit_global().type_sampler_id(id),
Self::AccelerationStructureKhr => {
@@ -513,7 +509,6 @@ impl fmt::Debug for SpirvTypePrinter<'_, '_> {
multisampled,
sampled,
image_format,
- access_qualifier,
} => f
.debug_struct("Image")
.field("id", &self.id)
@@ -524,7 +519,6 @@ impl fmt::Debug for SpirvTypePrinter<'_, '_> {
.field("multisampled", &multisampled)
.field("sampled", &sampled)
.field("image_format", &image_format)
- .field("access_qualifier", &access_qualifier)
.finish(),
SpirvType::Sampler => f.debug_struct("Sampler").field("id", &self.id).finish(),
SpirvType::SampledImage { image_type } => f
@@ -670,7 +664,6 @@ impl SpirvTypePrinter<'_, '_> {
multisampled,
sampled,
image_format,
- access_qualifier,
} => f
.debug_struct("Image")
.field("sampled_type", &self.cx.debug_type(sampled_type))
@@ -680,7 +673,6 @@ impl SpirvTypePrinter<'_, '_> {
.field("multisampled", &multisampled)
.field("sampled", &sampled)
.field("image_format", &image_format)
- .field("access_qualifier", &access_qualifier)
.finish(),
SpirvType::Sampler => f.write_str("Sampler"),
SpirvType::SampledImage { image_type } => f
diff --git a/crates/spirv-std/macros/src/image.rs b/crates/spirv-std/macros/src/image.rs
index 3e4e9de2db..f3cd4eaa0d 100644
--- a/crates/spirv-std/macros/src/image.rs
+++ b/crates/spirv-std/macros/src/image.rs
@@ -25,7 +25,6 @@ type, or use `format` to set the image to a specific image format.";
/// Creates an `Image` type using the following syntax.
pub struct ImageType {
- access_qualifier: Option,
arrayed: Arrayed,
crate_root: Option,
depth: ImageDepth,
@@ -38,7 +37,6 @@ pub struct ImageType {
impl Parse for ImageType {
fn parse(input: ParseStream<'_>) -> syn::Result {
- let mut access_qualifier = None;
let mut sampled_type = None;
let mut dimensionality = None;
let mut arrayed = None;
@@ -86,20 +84,7 @@ impl Parse for ImageType {
} else if input.peek(syn::Ident) {
let ident = input.parse::().unwrap();
- if ident == "access" {
- let value = peek_and_eat_value!(syn::Ident)
- .as_ref()
- .map(|i| params::access_qualifier_from_str(&i.to_string()));
-
- if value.is_none() {
- return Err(syn::Error::new(
- ident.span(),
- "Expected argument for `access`.",
- ));
- }
-
- access_qualifier = value.unwrap().ok();
- } else if ident == "buffer" {
+ if ident == "buffer" {
set_unique!(dimensionality = Dimensionality::Buffer);
} else if ident == "cube" {
set_unique!(dimensionality = Dimensionality::Cube);
@@ -302,7 +287,6 @@ impl Parse for ImageType {
let sampled = sampled.unwrap_or(Sampled::Unknown);
Ok(Self {
- access_qualifier,
arrayed,
crate_root,
depth,
@@ -326,13 +310,6 @@ impl quote::ToTokens for ImageType {
punct
},
});
- let access_qualifier = match self.access_qualifier {
- Some(aq) => {
- let aq = params::access_qualifier_to_tokens(&aq);
- quote!(Some(#crate_root::image::#aq))
- }
- None => quote!(None),
- };
let dimensionality = params::dimensionality_to_tokens(&self.dimensionality);
let arrayed = params::arrayed_to_tokens(&self.arrayed);
let depth = params::image_depth_to_tokens(&self.depth);
@@ -344,13 +321,12 @@ impl quote::ToTokens for ImageType {
tokens.append_all(quote::quote! {
#crate_root::image::Image<
#crate_root::image::__private::#sampled_type,
- { #crate_root::image::#dimensionality },
- { #crate_root::image::#depth },
- { #crate_root::image::#arrayed },
- { #crate_root::image::#multisampled },
- { #crate_root::image::#sampled },
- { #crate_root::image::#format },
- { #access_qualifier },
+ { #crate_root::image::#dimensionality as u32 },
+ { #crate_root::image::#depth as u32 },
+ { #crate_root::image::#arrayed as u32 },
+ { #crate_root::image::#multisampled as u32 },
+ { #crate_root::image::#sampled as u32 },
+ { #crate_root::image::#format as u32 },
>
});
}
@@ -360,15 +336,6 @@ mod params {
use super::*;
use proc_macro2::TokenStream;
- pub fn access_qualifier_from_str(s: &str) -> Result {
- match s {
- "read" => Ok(AccessQualifier::ReadOnly),
- "write" => Ok(AccessQualifier::WriteOnly),
- "read_write" => Ok(AccessQualifier::ReadWrite),
- _ => Err("Invalid access qualifier."),
- }
- }
-
pub fn image_format_from_str(s: &str) -> Result {
Ok(match s {
"rgba32f" => ImageFormat::Rgba32f,
@@ -449,14 +416,6 @@ mod params {
}
}
- pub fn access_qualifier_to_tokens(aq: &AccessQualifier) -> TokenStream {
- match aq {
- AccessQualifier::ReadOnly => quote!(AccessQualifier::ReadOnly),
- AccessQualifier::WriteOnly => quote!(AccessQualifier::WriteOnly),
- AccessQualifier::ReadWrite => quote!(AccessQualifier::ReadWrite),
- }
- }
-
pub fn image_depth_to_tokens(id: &ImageDepth) -> TokenStream {
match id {
ImageDepth::True => quote!(ImageDepth::True),
diff --git a/crates/spirv-std/src/image.rs b/crates/spirv-std/src/image.rs
index 9e38533a30..8a12cc5c8a 100644
--- a/crates/spirv-std/src/image.rs
+++ b/crates/spirv-std/src/image.rs
@@ -52,21 +52,25 @@ pub type StorageImage3dI = crate::Image!(3D, type=i32, sampled=false, __crate_ro
pub type Cubemap = crate::Image!(cube, type=f32, sampled, __crate_root=crate);
+// TODO: Migrate Image parameters back to their enum values once #![feature(adt_const_params)] is
+// stabilized.
+
/// An opaque image type. Corresponds to `OpTypeImage`.
///
/// You likely want to write this type using the [`crate::Image!`] macro helper, as the generic
/// arguments here can get extremely verbose.
+///
+/// See SPIR-V OpTypeImage specification for the meaning of integer parameters.
#[spirv(generic_image_type)]
#[derive(Copy, Clone)]
pub struct Image<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
+ const DIM: u32, // Dimensionality,
+ const DEPTH: u32, // ImageDepth,
+ const ARRAYED: u32, // Arrayed,
+ const MULTISAMPLED: u32, // Multisampled,
+ const SAMPLED: u32, // Sampled,
+ const FORMAT: u32, // ImageFormat,
> {
_x: u32,
_marker: core::marker::PhantomData,
@@ -74,23 +78,12 @@ pub struct Image<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
- >
- Image<
- SampledType,
- DIM,
- DEPTH,
- ARRAYED,
- MULTISAMPLED,
- { Sampled::Yes },
- FORMAT,
- ACCESS_QUALIFIER,
- >
+ const DIM: u32,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const FORMAT: u32,
+ > Image
{
/// Fetch a single texel with a sampler set at compile time
#[crate::macros::gpu_only]
@@ -118,23 +111,12 @@ impl<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
- >
- Image<
- SampledType,
- DIM,
- DEPTH,
- ARRAYED,
- { Multisampled::False },
- SAMPLED,
- FORMAT,
- ACCESS_QUALIFIER,
- >
+ const DIM: u32,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
+ > Image
{
// Note: #[inline] is needed because in vulkan, the component must be a constant expression.
/// Gathers the requested component from four texels.
@@ -272,8 +254,8 @@ impl<
&self,
sampler: Sampler,
coordinate: impl ImageCoordinate,
- gradient_dx: impl ImageCoordinate,
- gradient_dy: impl ImageCoordinate,
+ gradient_dx: impl ImageCoordinate,
+ gradient_dy: impl ImageCoordinate,
) -> V
where
F: Float,
@@ -377,8 +359,8 @@ impl<
sampler: Sampler,
coordinate: impl ImageCoordinate,
depth_reference: f32,
- gradient_dx: impl ImageCoordinate,
- gradient_dy: impl ImageCoordinate,
+ gradient_dx: impl ImageCoordinate,
+ gradient_dy: impl ImageCoordinate,
) -> SampledType
where
F: Float,
@@ -410,21 +392,19 @@ impl<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const SAMPLED: Sampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
+ const DIM: u32,
+ const DEPTH: u32,
+ const SAMPLED: u32,
+ const FORMAT: u32,
>
Image<
SampledType,
DIM,
DEPTH,
- { Arrayed::False },
- { Multisampled::False },
+ { Arrayed::False as u32 },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
/// Sample the image with a project coordinate
@@ -433,7 +413,7 @@ impl<
pub fn sample_with_project_coordinate(
&self,
sampler: Sampler,
- project_coordinate: impl ImageCoordinate,
+ project_coordinate: impl ImageCoordinate,
) -> V
where
F: Float,
@@ -463,7 +443,7 @@ impl<
pub fn sample_with_project_coordinate_by_lod(
&self,
sampler: Sampler,
- project_coordinate: impl ImageCoordinate,
+ project_coordinate: impl ImageCoordinate,
lod: f32,
) -> V
where
@@ -496,9 +476,9 @@ impl<
pub fn sample_with_project_coordinate_by_gradient(
&self,
sampler: Sampler,
- project_coordinate: impl ImageCoordinate,
- gradient_dx: impl ImageCoordinate,
- gradient_dy: impl ImageCoordinate,
+ project_coordinate: impl ImageCoordinate,
+ gradient_dx: impl ImageCoordinate,
+ gradient_dy: impl ImageCoordinate,
) -> V
where
F: Float,
@@ -532,7 +512,7 @@ impl<
pub fn sample_depth_reference_with_project_coordinate(
&self,
sampler: Sampler,
- project_coordinate: impl ImageCoordinate,
+ project_coordinate: impl ImageCoordinate,
depth_reference: f32,
) -> SampledType
where
@@ -564,7 +544,7 @@ impl<
pub fn sample_depth_reference_with_project_coordinate_by_lod(
&self,
sampler: Sampler,
- coordinate: impl ImageCoordinate,
+ coordinate: impl ImageCoordinate,
depth_reference: f32,
lod: f32,
) -> SampledType
@@ -600,10 +580,10 @@ impl<
pub fn sample_depth_reference_with_project_coordinate_by_gradient(
&self,
sampler: Sampler,
- coordinate: impl ImageCoordinate,
+ coordinate: impl ImageCoordinate,
depth_reference: f32,
- gradient_dx: impl ImageCoordinate,
- gradient_dy: impl ImageCoordinate,
+ gradient_dx: impl ImageCoordinate,
+ gradient_dy: impl ImageCoordinate,
) -> SampledType
where
F: Float,
@@ -635,14 +615,12 @@ impl<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
- >
- Image
+ const DIM: u32,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const FORMAT: u32,
+ > Image
{
/// Read a texel from an image without a sampler.
#[crate::macros::gpu_only]
@@ -693,23 +671,12 @@ impl<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const ACCESS_QUALIFIER: Option,
- >
- Image<
- SampledType,
- DIM,
- DEPTH,
- ARRAYED,
- MULTISAMPLED,
- { Sampled::Unknown },
- FORMAT,
- ACCESS_QUALIFIER,
- >
+ const DIM: u32,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ > Image
{
/// Read a texel from an image without a sampler.
#[crate::macros::gpu_only]
@@ -760,21 +727,19 @@ impl<
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const FORMAT: u32,
>
Image<
SampledType,
- { Dimensionality::SubpassData },
+ { Dimensionality::SubpassData as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
- { Sampled::No },
+ { Sampled::No as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
/// Read a texel from subpass input attachment.
@@ -809,14 +774,13 @@ impl<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
- > Image
+ const DIM: u32,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
+ const FORMAT: u32,
+ > Image
{
/// Query the number of mipmap levels.
#[crate::macros::gpu_only]
@@ -846,7 +810,7 @@ impl<
pub fn query_lod>(
&self,
sampler: Sampler,
- coord: impl ImageCoordinate,
+ coord: impl ImageCoordinate,
) -> V
where
Self: HasQueryLevels,
@@ -898,23 +862,12 @@ impl<
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
- >
- Image<
- SampledType,
- DIM,
- DEPTH,
- ARRAYED,
- { Multisampled::False },
- SAMPLED,
- FORMAT,
- ACCESS_QUALIFIER,
- >
+ const DIM: u32,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
+ const FORMAT: u32,
+ > Image
{
/// Query the dimensions of Image, with no level of detail.
#[crate::macros::gpu_only]
@@ -943,21 +896,19 @@ impl<
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
+ const FORMAT: u32,
>
Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::True },
+ { Multisampled::True as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
/// Query the number of samples available per texel fetch in a multisample image.
@@ -990,24 +941,14 @@ pub struct SampledImage {
impl<
SampledType: SampleType,
- const DIM: Dimensionality,
- const DEPTH: ImageDepth,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const FORMAT: ImageFormat,
- const ACCESS_QUALIFIER: Option,
+ const DIM: u32,
+ const DEPTH: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
+ const FORMAT: u32,
>
SampledImage<
- Image<
- SampledType,
- DIM,
- DEPTH,
- ARRAYED,
- { Multisampled::False },
- SAMPLED,
- FORMAT,
- ACCESS_QUALIFIER,
- >,
+ Image,
>
{
/// Sample texels at `coord` from the sampled image.
@@ -1043,61 +984,55 @@ impl<
pub trait HasGather {}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasGather
for Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasGather
for Image<
SampledType,
- { Dimensionality::Rect },
+ { Dimensionality::Rect as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasGather
for Image<
SampledType,
- { Dimensionality::Cube },
+ { Dimensionality::Cube as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
@@ -1109,85 +1044,77 @@ impl<
pub trait HasQueryLevels {}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
> HasQueryLevels
for Image<
SampledType,
- { Dimensionality::OneD },
+ { Dimensionality::OneD as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
> HasQueryLevels
for Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
> HasQueryLevels
for Image<
SampledType,
- { Dimensionality::ThreeD },
+ { Dimensionality::ThreeD as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
> HasQueryLevels
for Image<
SampledType,
- { Dimensionality::Cube },
+ { Dimensionality::Cube as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
@@ -1200,275 +1127,215 @@ impl<
pub trait HasQuerySize {}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySize
for Image<
SampledType,
- { Dimensionality::OneD },
+ { Dimensionality::OneD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::True },
+ { Multisampled::True as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::OneD },
+ { Dimensionality::OneD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::Unknown },
+ { Multisampled::False as u32 },
+ { Sampled::Unknown as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::OneD },
+ { Dimensionality::OneD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::No },
+ { Multisampled::False as u32 },
+ { Sampled::No as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySize
for Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::True },
+ { Multisampled::True as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::Unknown },
+ { Multisampled::False as u32 },
+ { Sampled::Unknown as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::No },
+ { Multisampled::False as u32 },
+ { Sampled::No as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySize
for Image<
SampledType,
- { Dimensionality::ThreeD },
+ { Dimensionality::ThreeD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::True },
+ { Multisampled::True as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::ThreeD },
+ { Dimensionality::ThreeD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::Unknown },
+ { Multisampled::False as u32 },
+ { Sampled::Unknown as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::ThreeD },
+ { Dimensionality::ThreeD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::No },
+ { Multisampled::False as u32 },
+ { Sampled::No as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySize
for Image<
SampledType,
- { Dimensionality::Cube },
+ { Dimensionality::Cube as u32 },
DEPTH,
ARRAYED,
- { Multisampled::True },
+ { Multisampled::True as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::Cube },
+ { Dimensionality::Cube as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::Unknown },
+ { Multisampled::False as u32 },
+ { Sampled::Unknown as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
-impl<
- SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const ACCESS_QUALIFIER: Option,
- > HasQuerySize
+impl, const DEPTH: u32, const FORMAT: u32, const ARRAYED: u32>
+ HasQuerySize
for Image<
SampledType,
- { Dimensionality::Cube },
+ { Dimensionality::Cube as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
- { Sampled::No },
+ { Multisampled::False as u32 },
+ { Sampled::No as u32 },
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
> HasQuerySize
for Image<
SampledType,
- { Dimensionality::Rect },
+ { Dimensionality::Rect as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const MULTISAMPLED: Multisampled,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const MULTISAMPLED: u32,
+ const SAMPLED: u32,
> HasQuerySize
for Image<
SampledType,
- { Dimensionality::Buffer },
+ { Dimensionality::Buffer as u32 },
DEPTH,
ARRAYED,
MULTISAMPLED,
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
@@ -1480,81 +1347,73 @@ impl<
pub trait HasQuerySizeLod {}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySizeLod
for Image<
SampledType,
- { Dimensionality::OneD },
+ { Dimensionality::OneD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySizeLod
for Image<
SampledType,
- { Dimensionality::TwoD },
+ { Dimensionality::TwoD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySizeLod
for Image<
SampledType,
- { Dimensionality::ThreeD },
+ { Dimensionality::ThreeD as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
impl<
SampledType: SampleType,
- const DEPTH: ImageDepth,
- const FORMAT: ImageFormat,
- const ARRAYED: Arrayed,
- const SAMPLED: Sampled,
- const ACCESS_QUALIFIER: Option,
+ const DEPTH: u32,
+ const FORMAT: u32,
+ const ARRAYED: u32,
+ const SAMPLED: u32,
> HasQuerySizeLod
for Image<
SampledType,
- { Dimensionality::Cube },
+ { Dimensionality::Cube as u32 },
DEPTH,
ARRAYED,
- { Multisampled::False },
+ { Multisampled::False as u32 },
SAMPLED,
FORMAT,
- ACCESS_QUALIFIER,
>
{
}
diff --git a/crates/spirv-std/src/image/params.rs b/crates/spirv-std/src/image/params.rs
index 53db294413..9042d6ef21 100644
--- a/crates/spirv-std/src/image/params.rs
+++ b/crates/spirv-std/src/image/params.rs
@@ -1,79 +1,109 @@
use super::{Arrayed, Dimensionality, ImageFormat};
-use crate::{scalar::Scalar, vector::Vector, integer::Integer};
+use crate::{integer::Integer, scalar::Scalar, vector::Vector};
/// Marker trait for arguments that accept single scalar values or vectors
/// of scalars.
-pub trait SampleType: Scalar {}
+pub trait SampleType: Scalar {}
-impl SampleType<{ ImageFormat::Unknown }> for i8 {}
-impl SampleType<{ ImageFormat::Unknown }> for i16 {}
-impl SampleType<{ ImageFormat::Unknown }> for i32 {}
-impl SampleType<{ ImageFormat::Unknown }> for i64 {}
-impl SampleType<{ ImageFormat::Unknown }> for u8 {}
-impl SampleType<{ ImageFormat::Unknown }> for u16 {}
-impl SampleType<{ ImageFormat::Unknown }> for u32 {}
-impl SampleType<{ ImageFormat::Unknown }> for u64 {}
-impl SampleType<{ ImageFormat::Unknown }> for f32 {}
-impl SampleType<{ ImageFormat::Unknown }> for f64 {}
-impl SampleType<{ ImageFormat::Rgba32f }> for f32 {}
-impl SampleType<{ ImageFormat::Rgba16f }> for f32 {}
-impl SampleType<{ ImageFormat::R32f }> for f32 {}
-impl SampleType<{ ImageFormat::Rgba8 }> for f32 {}
-impl SampleType<{ ImageFormat::Rgba8Snorm }> for f32 {}
-impl SampleType<{ ImageFormat::Rg32f }> for f32 {}
-impl SampleType<{ ImageFormat::Rg16f }> for f32 {}
-impl SampleType<{ ImageFormat::R11fG11fB10f }> for f32 {}
-impl SampleType<{ ImageFormat::R16f }> for f32 {}
-impl SampleType<{ ImageFormat::Rgba16 }> for f32 {}
-impl SampleType<{ ImageFormat::Rgb10A2 }> for f32 {}
-impl SampleType<{ ImageFormat::Rg16 }> for f32 {}
-impl SampleType<{ ImageFormat::Rg8 }> for f32 {}
-impl SampleType<{ ImageFormat::R16 }> for f32 {}
-impl SampleType<{ ImageFormat::R8 }> for f32 {}
-impl SampleType<{ ImageFormat::Rgba16Snorm }> for f32 {}
-impl SampleType<{ ImageFormat::Rg16Snorm }> for f32 {}
-impl SampleType<{ ImageFormat::Rg8Snorm }> for f32 {}
-impl SampleType<{ ImageFormat::R16Snorm }> for f32 {}
-impl SampleType<{ ImageFormat::R8Snorm }> for f32 {}
-impl SampleType<{ ImageFormat::Rgba32i }> for i32 {}
-impl SampleType<{ ImageFormat::Rgba16i }> for i32 {}
-impl SampleType<{ ImageFormat::Rgba8i }> for i32 {}
-impl SampleType<{ ImageFormat::R32i }> for i32 {}
-impl SampleType<{ ImageFormat::Rg32i }> for i32 {}
-impl SampleType<{ ImageFormat::Rg16i }> for i32 {}
-impl SampleType<{ ImageFormat::Rg8i }> for i32 {}
-impl SampleType<{ ImageFormat::R16i }> for i32 {}
-impl SampleType<{ ImageFormat::R8i }> for i32 {}
-impl SampleType<{ ImageFormat::Rgba32ui }> for u32 {}
-impl SampleType<{ ImageFormat::Rgba16ui }> for u32 {}
-impl SampleType<{ ImageFormat::Rgba8ui }> for u32 {}
-impl SampleType<{ ImageFormat::R32ui }> for u32 {}
-impl SampleType<{ ImageFormat::Rgb10A2ui }> for u32 {}
-impl SampleType<{ ImageFormat::Rg32ui }> for u32 {}
-impl SampleType<{ ImageFormat::Rg16ui }> for u32 {}
-impl SampleType<{ ImageFormat::Rg8ui }> for u32 {}
-impl SampleType<{ ImageFormat::R16ui }> for u32 {}
-impl SampleType<{ ImageFormat::R8ui }> for u32 {}
-impl SampleType<{ ImageFormat::R64ui }> for u64 {}
-impl SampleType<{ ImageFormat::R64i }> for i64 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for i8 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for i16 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for i64 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for u8 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for u16 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for u64 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Unknown as u32 }> for f64 {}
+impl SampleType<{ ImageFormat::Rgba32f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgba16f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R32f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgba8 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgba8Snorm as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rg32f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rg16f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R11fG11fB10f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R16f as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgba16 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgb10A2 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rg16 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rg8 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R16 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R8 as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgba16Snorm as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rg16Snorm as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rg8Snorm as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R16Snorm as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::R8Snorm as u32 }> for f32 {}
+impl SampleType<{ ImageFormat::Rgba32i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Rgba16i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Rgba8i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::R32i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Rg32i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Rg16i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Rg8i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::R16i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::R8i as u32 }> for i32 {}
+impl SampleType<{ ImageFormat::Rgba32ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Rgba16ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Rgba8ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::R32ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Rgb10A2ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Rg32ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Rg16ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::Rg8ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::R16ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::R8ui as u32 }> for u32 {}
+impl SampleType<{ ImageFormat::R64ui as u32 }> for u64 {}
+impl SampleType<{ ImageFormat::R64i as u32 }> for i64 {}
/// Marker trait for arguments that accept a coordinate for an [`crate::Image`].
-pub trait ImageCoordinate {}
+pub trait ImageCoordinate {}
-impl ImageCoordinate for S {}
-impl ImageCoordinate for S {}
+impl ImageCoordinate
+ for S
+{
+}
+impl ImageCoordinate
+ for S
+{
+}
-impl, S: Scalar> ImageCoordinate for V {}
-impl, S: Scalar> ImageCoordinate for V {}
-impl, S: Scalar> ImageCoordinate for V {}
-impl, S: Scalar> ImageCoordinate for V {}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
-impl, S: Scalar> ImageCoordinate for V {}
-impl, S: Scalar> ImageCoordinate for V {}
-impl, S: Scalar> ImageCoordinate for V {}
-impl, S: Scalar> ImageCoordinate for V {}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
+impl, S: Scalar>
+ ImageCoordinate for V
+{
+}
/// Marker trait for arguments that are valid for a [`crate::image::Dimensionality::SubpassData`] image query.
-pub trait ImageCoordinateSubpassData {}
-impl, I: Integer> ImageCoordinateSubpassData for V {}
-impl, I: Integer> ImageCoordinateSubpassData for V {}
+pub trait ImageCoordinateSubpassData {}
+impl, I: Integer> ImageCoordinateSubpassData for V {}
+impl, I: Integer> ImageCoordinateSubpassData for V {}
diff --git a/crates/spirv-std/src/lib.rs b/crates/spirv-std/src/lib.rs
index 413f43c9ce..fb65ba3656 100644
--- a/crates/spirv-std/src/lib.rs
+++ b/crates/spirv-std/src/lib.rs
@@ -11,7 +11,6 @@
),
register_attr(spirv)
)]
-#![feature(adt_const_params)]
// BEGIN - Embark standard lints v0.4
// do not change or add/remove here, but one can add exceptions after this section
// for more info see:
diff --git a/tests/ui/image/gather_err.stderr b/tests/ui/image/gather_err.stderr
index 14d1ca1f53..0150d8cdb3 100644
--- a/tests/ui/image/gather_err.stderr
+++ b/tests/ui/image/gather_err.stderr
@@ -1,24 +1,24 @@
-error[E0277]: the trait bound `Image::None>: HasGather` is not satisfied
+error[E0277]: the trait bound `Image: HasGather` is not satisfied
--> $DIR/gather_err.rs:15:34
|
15 | let r1: glam::Vec4 = image1d.gather(*sampler, 0.0, 0);
- | ^^^^^^ the trait `HasGather` is not implemented for `Image::None>`
+ | ^^^^^^ the trait `HasGather` is not implemented for `Image`
|
= help: the following implementations were found:
- as HasGather>
- as HasGather>
- as HasGather>
+ as HasGather>
+ as HasGather>
+ as HasGather>
-error[E0277]: the trait bound `Image::None>: HasGather` is not satisfied
+error[E0277]: the trait bound `Image: HasGather` is not satisfied
--> $DIR/gather_err.rs:16:34
|
16 | let r2: glam::Vec4 = image3d.gather(*sampler, v3, 0);
- | ^^^^^^ the trait `HasGather` is not implemented for `Image::None>`
+ | ^^^^^^ the trait `HasGather` is not implemented for `Image`
|
= help: the following implementations were found:
- as HasGather>
- as HasGather>
- as HasGather>
+ as HasGather>
+ as HasGather>
+ as HasGather>
error: aborting due to 2 previous errors
diff --git a/tests/ui/image/query/query_levels_err.stderr b/tests/ui/image/query/query_levels_err.stderr
index 56df54881c..fc6d7ee32f 100644
--- a/tests/ui/image/query/query_levels_err.stderr
+++ b/tests/ui/image/query/query_levels_err.stderr
@@ -1,14 +1,14 @@
-error[E0277]: the trait bound `Image::None>: HasQueryLevels` is not satisfied
+error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied
--> $DIR/query_levels_err.rs:12:21
|
12 | *output = image.query_levels();
- | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image::None>`
+ | ^^^^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image`
|
= help: the following implementations were found:
- as HasQueryLevels>
- as HasQueryLevels>
- as HasQueryLevels>
- as HasQueryLevels>
+ as HasQueryLevels>
+ as HasQueryLevels>
+ as HasQueryLevels>
+ as HasQueryLevels>
error: aborting due to previous error
diff --git a/tests/ui/image/query/query_lod_err.stderr b/tests/ui/image/query/query_lod_err.stderr
index f8f0bd3520..0e6025720a 100644
--- a/tests/ui/image/query/query_lod_err.stderr
+++ b/tests/ui/image/query/query_lod_err.stderr
@@ -1,14 +1,14 @@
-error[E0277]: the trait bound `Image::None>: HasQueryLevels` is not satisfied
+error[E0277]: the trait bound `Image: HasQueryLevels` is not satisfied
--> $DIR/query_lod_err.rs:13:21
|
13 | *output = image.query_lod(*sampler, glam::Vec2::new(0.0, 1.0));
- | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image::None>`
+ | ^^^^^^^^^ the trait `HasQueryLevels` is not implemented for `Image`
|
= help: the following implementations were found:
- as HasQueryLevels>
- as HasQueryLevels>
- as HasQueryLevels>
- as HasQueryLevels>
+ as HasQueryLevels>
+ as HasQueryLevels>
+ as HasQueryLevels>
+ as HasQueryLevels>
error: aborting due to previous error
diff --git a/tests/ui/image/query/query_size_err.stderr b/tests/ui/image/query/query_size_err.stderr
index ed2ffcf22a..8e2a2c2fc4 100644
--- a/tests/ui/image/query/query_size_err.stderr
+++ b/tests/ui/image/query/query_size_err.stderr
@@ -1,14 +1,14 @@
-error[E0277]: the trait bound `Image::None>: HasQuerySize` is not satisfied
+error[E0277]: the trait bound `Image: HasQuerySize` is not satisfied
--> $DIR/query_size_err.rs:12:21
|
12 | *output = image.query_size();
- | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image::None>`
+ | ^^^^^^^^^^ the trait `HasQuerySize` is not implemented for `Image`
|
= help: the following implementations were found:
- as HasQuerySize>
- as HasQuerySize>
- as HasQuerySize>
- as HasQuerySize>
+ as HasQuerySize>
+ as HasQuerySize>
+ as HasQuerySize>
+ as HasQuerySize>
and 10 others
error: aborting due to previous error
diff --git a/tests/ui/image/query/query_size_lod_err.stderr b/tests/ui/image/query/query_size_lod_err.stderr
index 64a8883e71..cb037a425a 100644
--- a/tests/ui/image/query/query_size_lod_err.stderr
+++ b/tests/ui/image/query/query_size_lod_err.stderr
@@ -1,14 +1,14 @@
-error[E0277]: the trait bound `Image::None>: HasQuerySizeLod` is not satisfied
+error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied
--> $DIR/query_size_lod_err.rs:12:21
|
12 | *output = image.query_size_lod(0);
- | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image::None>`
+ | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image`
|
= help: the following implementations were found:
-