diff --git a/crates/spirv-std/src/float.rs b/crates/spirv-std/src/float.rs index 2829644388..8ce9845b9b 100644 --- a/crates/spirv-std/src/float.rs +++ b/crates/spirv-std/src/float.rs @@ -1,6 +1,6 @@ //! Traits and helper functions related to floats. -use crate::vector::Vector; +use crate::vector::{Vector, VectorTypeRef}; #[cfg(target_arch = "spirv")] use core::arch::asm; @@ -71,7 +71,10 @@ struct F32x2 { x: f32, y: f32, } -unsafe impl Vector for F32x2 {} +unsafe impl Vector for F32x2 { type VectorTypeLib = F32x2TypeLib; } + +struct F32x2TypeLib; +impl VectorTypeRef for F32x2TypeLib { type Vector = F32x2; } /// Converts an f32 (float) into an f16 (half). The result is a u32, not a u16, due to GPU support /// for u16 not being universal - the upper 16 bits will always be zero. diff --git a/crates/spirv-std/src/image.rs b/crates/spirv-std/src/image.rs index c00601824d..c14813c20f 100644 --- a/crates/spirv-std/src/image.rs +++ b/crates/spirv-std/src/image.rs @@ -14,7 +14,12 @@ pub use spirv_std_types::image_params::{ AccessQualifier, Arrayed, Dimensionality, ImageDepth, ImageFormat, Multisampled, Sampled, }; -use crate::{float::Float, integer::Integer, vector::Vector, Sampler}; +use crate::{ + float::Float, + integer::Integer, + vector::{Vector, VectorTypeRef}, + Sampler, VectorFromVector, +}; /// Re-export of primitive types to ensure the `Image` proc macro always points /// to the right type. @@ -119,12 +124,14 @@ impl< /// Fetch a single texel with a sampler set at compile time #[crate::macros::gpu_only] #[doc(alias = "OpImageFetch")] - pub fn fetch(&self, coordinate: impl ImageCoordinate) -> V + pub fn fetch(&self, coordinate: C) -> VectorFromVector!(C, SampledType, 4) + //<::VectorTypeLib as VectorTypeRef>::Vector where - V: Vector, I: Integer, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { - let mut result = V::default(); + let mut result = Default::default(); unsafe { asm! { "%image = OpLoad _ {this}", @@ -154,18 +161,19 @@ impl< #[crate::macros::gpu_only] #[doc(alias = "OpImageGather")] #[inline] - pub fn gather( + pub fn gather( &self, sampler: Sampler, - coordinate: impl ImageCoordinate, + coordinate: C, component: u32, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where Self: HasGather, F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { - let mut result = V::default(); + let mut result = Default::default(); unsafe { asm! { "%typeSampledImage = OpTypeSampledImage typeof*{this}", @@ -187,10 +195,15 @@ impl< /// Sample texels at `coord` from the image using `sampler`. #[crate::macros::gpu_only] - pub fn sample(&self, sampler: Sampler, coord: impl ImageCoordinate) -> V + pub fn sample( + &self, + sampler: Sampler, + coord: C, + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { unsafe { let mut result = Default::default(); @@ -214,15 +227,16 @@ impl< /// Sample texels at `coord` from the image using `sampler`, after adding the input bias to the /// implicit level of detail. #[crate::macros::gpu_only] - pub fn sample_bias( + pub fn sample_bias( &self, sampler: Sampler, - coord: impl ImageCoordinate, + coord: C, bias: f32, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { unsafe { let mut result = Default::default(); @@ -248,15 +262,16 @@ impl< #[crate::macros::gpu_only] #[doc(alias = "OpImageSampleExplicitLod")] /// Sample the image at a coordinate by a lod - pub fn sample_by_lod( + pub fn sample_by_lod( &self, sampler: Sampler, - coordinate: impl ImageCoordinate, + coordinate: C, lod: f32, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { let mut result = Default::default(); unsafe { @@ -281,16 +296,17 @@ impl< #[crate::macros::gpu_only] #[doc(alias = "OpImageSampleExplicitLod")] /// Sample the image based on a gradient formed by (dx, dy). Specifically, ([du/dx, dv/dx], [du/dy, dv/dy]) - pub fn sample_by_gradient( + pub fn sample_by_gradient( &self, sampler: Sampler, - coordinate: impl ImageCoordinate, + coordinate: C, gradient_dx: impl ImageCoordinate, gradient_dy: impl ImageCoordinate, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { let mut result = Default::default(); unsafe { @@ -441,14 +457,15 @@ impl< /// Sample the image with a project coordinate #[crate::macros::gpu_only] #[doc(alias = "OpImageSampleProjImplicitLod")] - pub fn sample_with_project_coordinate( + pub fn sample_with_project_coordinate( &self, sampler: Sampler, - project_coordinate: impl ImageCoordinate, - ) -> V + project_coordinate: C, + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { unsafe { let mut result = Default::default(); @@ -471,15 +488,16 @@ impl< #[crate::macros::gpu_only] #[doc(alias = "OpImageSampleProjExplicitLod")] /// Sample the image with a project coordinate by a lod - pub fn sample_with_project_coordinate_by_lod( + pub fn sample_with_project_coordinate_by_lod( &self, sampler: Sampler, - project_coordinate: impl ImageCoordinate, + project_coordinate: C, lod: f32, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { let mut result = Default::default(); unsafe { @@ -504,16 +522,17 @@ impl< #[crate::macros::gpu_only] #[doc(alias = "OpImageSampleProjExplicitLod")] /// Sample the image with a project coordinate based on a gradient formed by (dx, dy). Specifically, ([du/dx, dv/dx], [du/dy, dv/dy]) - pub fn sample_with_project_coordinate_by_gradient( + pub fn sample_with_project_coordinate_by_gradient( &self, sampler: Sampler, - project_coordinate: impl ImageCoordinate, + project_coordinate: C, gradient_dx: impl ImageCoordinate, gradient_dy: impl ImageCoordinate, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { let mut result = Default::default(); unsafe { @@ -656,12 +675,13 @@ impl< /// Read a texel from an image without a sampler. #[crate::macros::gpu_only] #[doc(alias = "OpImageRead")] - pub fn read(&self, coordinate: impl ImageCoordinate) -> V + pub fn read(&self, coordinate: C) -> VectorFromVector!(C, SampledType, 4) where I: Integer, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { - let mut result = V::default(); + let mut result = Default::default(); unsafe { asm! { @@ -712,12 +732,13 @@ impl< /// Read a texel from an image without a sampler. #[crate::macros::gpu_only] #[doc(alias = "OpImageRead")] - pub fn read(&self, coordinate: impl ImageCoordinate) -> V + pub fn read(&self, coordinate: C) -> VectorFromVector!(C, SampledType, 4) where I: Integer, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { - let mut result = V::default(); + let mut result = Default::default(); unsafe { asm! { @@ -777,15 +798,16 @@ impl< /// Note: Vulkan only allows the read if the first two components of the coordinate are zero. #[crate::macros::gpu_only] #[doc(alias = "OpImageRead")] - pub fn read_subpass( + pub fn read_subpass( &self, - coordinate: impl ImageCoordinateSubpassData, - ) -> V + coordinate: C, + ) -> VectorFromVector!(C, SampledType, 4) where I: Integer, - V: Vector, + C: ImageCoordinateSubpassData + Vector, + C::VectorTypeLib: VectorTypeRef, { - let mut result = V::default(); + let mut result = Default::default(); unsafe { asm! { @@ -838,13 +860,15 @@ impl< /// detail relative to the base level. #[crate::macros::gpu_only] #[doc(alias = "OpImageQueryLod")] - pub fn query_lod>( + pub fn query_lod( &self, sampler: Sampler, - coord: impl ImageCoordinate, - ) -> V + coord: C, + ) -> VectorFromVector!(C, SampledType, 2) where Self: HasQueryLevels, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { // Note: Arrayed::False isn't a typo in the ImageCoordinate, the spec states: // Coordinate must be a scalar or vector of floating-point type or integer type. It @@ -988,10 +1012,14 @@ impl< /// Sampling with a type (`S`) that doesn't match the image's image format /// will result in undefined behaviour. #[crate::macros::gpu_only] - pub unsafe fn sample(&self, coord: impl ImageCoordinate) -> V + pub unsafe fn sample( + &self, + coord: C, + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { let mut result = Default::default(); asm!( @@ -1012,14 +1040,15 @@ impl< /// Sampling with a type (`S`) that doesn't match the image's image format /// will result in undefined behaviour. #[crate::macros::gpu_only] - pub unsafe fn sample_by_lod( + pub unsafe fn sample_by_lod( &self, - coord: impl ImageCoordinate, + coord: C, lod: f32, - ) -> V + ) -> VectorFromVector!(C, SampledType, 4) where F: Float, - V: Vector, + C: ImageCoordinate + Vector, + C::VectorTypeLib: VectorTypeRef, { let mut result = Default::default(); asm!( diff --git a/crates/spirv-std/src/vector.rs b/crates/spirv-std/src/vector.rs index c19352dd3b..009b135182 100644 --- a/crates/spirv-std/src/vector.rs +++ b/crates/spirv-std/src/vector.rs @@ -5,34 +5,142 @@ /// # Safety /// Implementing this trait on non-simd-vector types breaks assumptions of other unsafe code, and /// should not be done. -pub unsafe trait Vector: Default {} +pub unsafe trait Vector: Default { + /// Refers to a helper type that implements all kinds of references to concrete vectors + /// within the same library + type VectorTypeLib: VectorTypeRef; +} + +/// Trait that refers to a concrete vector type with specific generic parameters, to aid generic +/// functions in finding concrete vector types of different generic parameters implemented by +/// the same library. +/// +/// A type that implements such a trait, is expected to implement many concrete variants of this +/// trait. Such a type is said to be a 'vector type library'. +/// +/// For example, if a generic function has as input `T impl Vector` and it +/// wants to return a `Vector` of the same library of implementations, it can find it the +/// concrete vector type by doing: +/// `>::Vector` +/// Alternatively, using the `VectorFromVector!` macro: +/// `VectorFromVector!(T, f32, 3)` +pub trait VectorTypeRef { + /// Concrete type that implements the vector type with these generic parameters + type Vector: Vector; +} + +/// Helper macro that allows you to find a vector type with certain generic parameters +/// from the same 'vector type library' as another vector type. +#[macro_export] +macro_rules! VectorFromVector { + ($vec: ty, $comp: ty, $dim: expr) => { + <<$vec>::VectorTypeLib as VectorTypeRef<$comp, $dim>>::Vector + }; +} + +/// Glam vector type library. It implements all relevant VectorTypeRefs +pub struct GlamVectorTypeLib; #[cfg(feature = "glam")] -unsafe impl Vector for glam::Vec2 {} +unsafe impl Vector for glam::Vec2 { + type VectorTypeLib = GlamVectorTypeLib; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::Vec3 {} +unsafe impl Vector for glam::Vec3 { + type VectorTypeLib = GlamVectorTypeLib; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::Vec3A {} +unsafe impl Vector for glam::Vec3A { + type VectorTypeLib = GlamVectorTypeLib; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::Vec4 {} +unsafe impl Vector for glam::Vec4 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::Vec2; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::Vec3; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::Vec4; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::DVec2 {} +unsafe impl Vector for glam::DVec2 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +unsafe impl Vector for glam::DVec3 { + type VectorTypeLib = GlamVectorTypeLib; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::DVec3 {} +unsafe impl Vector for glam::DVec4 { + type VectorTypeLib = GlamVectorTypeLib; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::DVec4 {} +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::DVec2; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::DVec3; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::DVec4; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::UVec2 {} +unsafe impl Vector for glam::UVec2 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +unsafe impl Vector for glam::UVec3 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +unsafe impl Vector for glam::UVec4 { + type VectorTypeLib = GlamVectorTypeLib; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::UVec3 {} +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::UVec2; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::UVec4 {} +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::UVec3; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::UVec4; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::IVec2 {} +unsafe impl Vector for glam::IVec2 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +unsafe impl Vector for glam::IVec3 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +unsafe impl Vector for glam::IVec4 { + type VectorTypeLib = GlamVectorTypeLib; +} +#[cfg(feature = "glam")] +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::IVec2; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::IVec3 {} +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::IVec3; +} #[cfg(feature = "glam")] -unsafe impl Vector for glam::IVec4 {} +impl VectorTypeRef for GlamVectorTypeLib { + type Vector = glam::IVec4; +} diff --git a/tests/ui/arch/all.rs b/tests/ui/arch/all.rs index fd0d5e51db..69eeefcd2e 100644 --- a/tests/ui/arch/all.rs +++ b/tests/ui/arch/all.rs @@ -2,8 +2,9 @@ #![feature(repr_simd)] +use spirv_std::scalar::Scalar; use spirv_std::spirv; -use spirv_std::{scalar::Scalar, vector::Vector}; +use spirv_std::vector::{Vector, VectorTypeRef}; /// HACK(shesp). Rust doesn't allow us to declare regular (tuple-)structs containing `bool` members /// as `#[repl(simd)]`. But we need this for `spirv_std::arch::any()` and `spirv_std::arch::all()` @@ -12,7 +13,13 @@ use spirv_std::{scalar::Scalar, vector::Vector}; /// it (for now at least) #[repr(simd)] struct Vec2(T, T); -unsafe impl Vector for Vec2 {} +struct MyVecLib; +unsafe impl Vector for Vec2 { + type VectorTypeLib = MyVecLib; +} +impl VectorTypeRef for MyVecLib { + type Vector = Vec2; +} impl Default for Vec2 { fn default() -> Vec2 { diff --git a/tests/ui/arch/any.rs b/tests/ui/arch/any.rs index 29cdc14626..5458ee22be 100644 --- a/tests/ui/arch/any.rs +++ b/tests/ui/arch/any.rs @@ -2,8 +2,9 @@ #![feature(repr_simd)] +use spirv_std::scalar::Scalar; use spirv_std::spirv; -use spirv_std::{scalar::Scalar, vector::Vector}; +use spirv_std::vector::{Vector, VectorTypeRef}; /// HACK(shesp). Rust doesn't allow us to declare regular (tuple-)structs containing `bool` members /// as `#[repl(simd)]`. But we need this for `spirv_std::arch::any()` and `spirv_std::arch::all()` @@ -12,7 +13,13 @@ use spirv_std::{scalar::Scalar, vector::Vector}; /// it (for now at least) #[repr(simd)] struct Vec2(T, T); -unsafe impl Vector for Vec2 {} +struct MyVecLib; +unsafe impl Vector for Vec2 { + type VectorTypeLib = MyVecLib; +} +impl VectorTypeRef for MyVecLib { + type Vector = Vec2; +} impl Default for Vec2 { fn default() -> Vec2 { diff --git a/tests/ui/image/gather_err.stderr b/tests/ui/image/gather_err.stderr index bede583318..80014b11e1 100644 --- a/tests/ui/image/gather_err.stderr +++ b/tests/ui/image/gather_err.stderr @@ -9,26 +9,90 @@ error[E0277]: the trait bound `Image: HasGather` is not s Image Image note: required by a bound in `Image::::gather` - --> $SPIRV_STD_SRC/image.rs:164:15 + --> $SPIRV_STD_SRC/image.rs:171:15 | -164 | Self: HasGather, +171 | Self: HasGather, | ^^^^^^^^^ required by this bound in `Image::::gather` -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` - | - = help: the following other types implement trait `HasGather`: - Image - Image - Image -note: required by a bound in `Image::::gather` - --> $SPIRV_STD_SRC/image.rs:164:15 - | -164 | Self: HasGather, - | ^^^^^^^^^ required by this bound in `Image::::gather` +error: internal compiler error: /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/compiler/rustc_middle/src/ty/relate.rs:638:13: var types encountered in super_relate_consts: Const { ty: usize, kind: Param(N/#8) } Const { ty: usize, kind: Infer(Var(_#5c)) } + +thread 'rustc' panicked at 'Box', /rustc/0468a00ae3fd6ef1a6a0f9eaf637d7aa9e604acc/compiler/rustc_errors/src/lib.rs:1576:9 +stack backtrace: + 0: 0x7ffda9b69de2 - ::fmt::hea3121a92230cef2 + 1: 0x7ffda9ba5d0b - core::fmt::write::h0bc3f53e8dca163a + 2: 0x7ffda9b5c8fa - ::fmt::h7890ee78f4472cf6 + 3: 0x7ffda9b69b2b - std::sys::common::alloc::realloc_fallback::h2905b67a6dea1c71 + 4: 0x7ffda9b6d459 - std::panicking::default_hook::h111ce7f1b363c3ab + 5: 0x7ffda9b6d0db - std::panicking::default_hook::h111ce7f1b363c3ab + 6: 0x7ffd998e49f6 - _rustc_codegen_backend + 7: 0x7ffda9b6ddc0 - std::panicking::rust_panic_with_hook::hfc6ef76eb93085aa + 8: 0x7ffd4722ff83 - ::lift_to_tcx + 9: 0x7ffd4722f939 - ::lift_to_tcx + 10: 0x7ffd47271fc9 - ::lift_to_tcx + 11: 0x7ffd4722e849 - ::lift_to_tcx + 12: 0x7ffd4722d590 - ::lift_to_tcx + 13: 0x7ffd4722d0a2 - ::lift_to_tcx + 14: 0x7ffd472f7da8 - ::try_to_raw_bytes + 15: 0x7ffd472f80b8 - rustc_middle[2d97b4190bb00205]::util::bug::bug_fmt + 16: 0x7ffd472f8035 - rustc_middle[2d97b4190bb00205]::util::bug::bug_fmt + 17: 0x7ffd4798cb9e - ::consts + 18: 0x7ffd47a5b3eb - ::maybe_suggest_unsized_generics + 19: 0x7ffd479d21fc - ::fmt + 20: 0x7ffd47a011c2 - as rustc_trait_selection[49c09980fcea1f95]::traits::query::type_op::normalize::Normalizable>::type_op_method + 21: 0x7ffd47a27e87 - ::fmt + 22: 0x7ffd479fbb4c - as rustc_trait_selection[49c09980fcea1f95]::traits::query::type_op::normalize::Normalizable>::type_op_method + 23: 0x7ffd4799a6c8 - ::fmt + 24: 0x7ffd479f4c9f - ::fmt + 25: 0x7ffd47a0935c - ::fmt + 26: 0x7ffd4798ce23 - ::consts + 27: 0x7ffd479f678b - ::fmt + 28: 0x7ffd47a4167b - ::function_argument_obligation + 29: 0x7ffd47a3cba8 - ::suggest_fully_qualified_path + 30: 0x7ffd47a4fbe0 - ::note_obligation_cause + 31: 0x7ffd47a45e2f - ::report_selection_error + 32: 0x7ffd47a53377 - ::report_fulfillment_error + 33: 0x7ffd47a440b6 - ::report_fulfillment_errors + 34: 0x7ffd4529abf3 - ::probe_instantiate_query_response + 35: 0x7ffd4527ed19 - ::probe_instantiate_query_response + 36: 0x7ffd45256e43 - ::demand_coerce + 37: 0x7ffd452adfc6 - ::check_struct_path + 38: 0x7ffd452af5d1 - ::check_struct_path + 39: 0x7ffd45256871 - ::demand_coerce + 40: 0x7ffd452691ff - ::demand_coerce + 41: 0x7ffd453694d8 - ::visit_expr + 42: 0x7ffd4531e929 - ::build + 43: 0x7ffd4533b64e - ::visit_pat + 44: 0x7ffd45a62234 - ::new_min + 45: 0x7ffd4536f812 - ::visit_expr + 46: 0x7ffd4408c171 - ::visit_param + 47: 0x7ffd4440cdc9 - as rustc_privacy[6422734b6ac716cf]::VisibilityLike>::new_min + 48: 0x7ffd4448a99b - as rustc_privacy[6422734b6ac716cf]::VisibilityLike>::new_min + 49: 0x7ffd43ff1e0a - ::check_asm + 50: 0x7ffd4400cc4f - rustc_hir_analysis[abf2fb892a9f178e]::check_crate + 51: 0x7ffd441023fd - rustc_interface[e09bab31b5025fb2]::passes::analysis + 52: 0x7ffd443f50c9 - as rustc_privacy[6422734b6ac716cf]::VisibilityLike>::new_min + 53: 0x7ffd444926ef - as rustc_privacy[6422734b6ac716cf]::VisibilityLike>::new_min + 54: 0x7ffd43f03573 - ::new + 55: 0x7ffd43f14317 - rustc_driver[5e4fd5aa1121bb7c]::args::arg_expand_all + 56: 0x7ffd43f04983 - ::new + 57: 0x7ffd43efa24d - ::new + 58: 0x7ffda9b7fe9c - std::sys::windows::thread::Thread::new::h4025a5964e95cbad + 59: 0x7ffdcd9f26bd - BaseThreadInitThunk + 60: 0x7ffdce7cdfb8 - RtlUserThreadStart +note: the compiler unexpectedly panicked. this is a bug. + +note: we would appreciate a bug report: https://github.com/EmbarkStudios/rust-gpu/issues/new + +note: rustc 1.68.0-nightly (0468a00ae 2022-12-17) running on x86_64-pc-windows-msvc + +note: compiler flags: -C prefer-dynamic -Z codegen-backend=D:/embark/rust-gpu/target/release/deps/rustc_codegen_spirv.dll -Z binary-dep-depinfo -C overflow-checks=off -C debug-assertions=off -C debuginfo=2 -C embed-bitcode=no -C target-feature=+Int8,+Int16,+Int64,+Float64,+ShaderClockKHR,+ext:SPV_KHR_shader_clock -C symbol-mangling-version=v0 -Z crate-attr=feature(register_tool) -Z crate-attr=register_tool(rust_gpu) --crate-type dylib -Z unstable-options -Z crate-attr=no_std -Z crate-attr=feature(asm_const,asm_experimental_arch) -C llvm-args=--spirt -C target-feature=+Sampled1D + +query stack during panic: +#0 [typeck] type-checking `main` +#1 [typeck_item_bodies] type-checking all item bodies +#2 [analysis] running analysis passes on this crate +end of query stack +note: `rust-gpu` version 0.4.0 error: aborting due to 2 previous errors diff --git a/tests/ui/image/implicit_not_in_fragment.stderr b/tests/ui/image/implicit_not_in_fragment.stderr index 7ce1c39d38..f1656f9533 100644 --- a/tests/ui/image/implicit_not_in_fragment.stderr +++ b/tests/ui/image/implicit_not_in_fragment.stderr @@ -1,7 +1,7 @@ error: ImageSampleImplicitLod cannot be used outside a fragment shader | = note: Stack: - >::sample:: + >::sample:: implicit_not_in_fragment::deeper_stack implicit_not_in_fragment::deep_stack implicit_not_in_fragment::main @@ -10,7 +10,7 @@ error: ImageSampleImplicitLod cannot be used outside a fragment shader error: ImageSampleImplicitLod cannot be used outside a fragment shader | = note: Stack: - >::sample:: + >::sample:: implicit_not_in_fragment::main main diff --git a/tests/ui/image/query/query_levels_err.stderr b/tests/ui/image/query/query_levels_err.stderr index 74bbe1645c..12e4e86459 100644 --- a/tests/ui/image/query/query_levels_err.stderr +++ b/tests/ui/image/query/query_levels_err.stderr @@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is Image Image note: required by a bound in `Image::::query_levels` - --> $SPIRV_STD_SRC/image.rs:821:15 + --> $SPIRV_STD_SRC/image.rs:843:15 | -821 | Self: HasQueryLevels, +843 | Self: HasQueryLevels, | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_levels` 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 f969efa95a..3a37e2c4e6 100644 --- a/tests/ui/image/query/query_lod_err.stderr +++ b/tests/ui/image/query/query_lod_err.stderr @@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image: HasQueryLevels` is Image Image note: required by a bound in `Image::::query_lod` - --> $SPIRV_STD_SRC/image.rs:847:15 + --> $SPIRV_STD_SRC/image.rs:869:15 | -847 | Self: HasQueryLevels, +869 | Self: HasQueryLevels, | ^^^^^^^^^^^^^^ required by this bound in `Image::::query_lod` 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 b113619b49..cbde61372c 100644 --- a/tests/ui/image/query/query_size_err.stderr +++ b/tests/ui/image/query/query_size_err.stderr @@ -15,9 +15,9 @@ error[E0277]: the trait bound `Image: HasQuerySize` is no Image and 6 others note: required by a bound in `Image::::query_size` - --> $SPIRV_STD_SRC/image.rs:878:15 + --> $SPIRV_STD_SRC/image.rs:902:15 | -878 | Self: HasQuerySize, +902 | Self: HasQuerySize, | ^^^^^^^^^^^^ required by this bound in `Image::::query_size` 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 1435cdcedf..afc85ee1ad 100644 --- a/tests/ui/image/query/query_size_lod_err.stderr +++ b/tests/ui/image/query/query_size_lod_err.stderr @@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is Image Image note: required by a bound in `Image::::query_size_lod` - --> $SPIRV_STD_SRC/image.rs:911:15 + --> $SPIRV_STD_SRC/image.rs:935:15 | -911 | Self: HasQuerySizeLod, +935 | Self: HasQuerySizeLod, | ^^^^^^^^^^^^^^^ required by this bound in `Image::::query_size_lod` error: aborting due to previous error