diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bd55654183..c4c48ac2aa 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -135,7 +135,14 @@ jobs: fail-fast: false matrix: os: [ ubuntu-24.04, windows-2022, macOS-latest ] + target_env: [ "vulkan1.1,vulkan1.2,vulkan1.3,vulkan1.4,spv1.3,spv1.4" ] + experimental: [ false ] + include: + - os: ubuntu-24.04 + target_env: naga-wgsl + experimental: true runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} steps: - uses: actions/checkout@v4 - name: Install Vulkan SDK @@ -154,7 +161,7 @@ jobs: - name: cargo fetch --locked run: cargo fetch --locked --target $TARGET - name: compiletest - run: cargo run -p compiletests --release --no-default-features --features "use-installed-tools" -- --target-env vulkan1.1,vulkan1.2,vulkan1.3,vulkan1.4,spv1.3,spv1.4 + run: cargo run -p compiletests --release --no-default-features --features "use-installed-tools" -- --target-env ${{ matrix.target_env }} difftest: name: Difftest diff --git a/Cargo.lock b/Cargo.lock index 6d0220a41e..b9bb382da3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1027,6 +1027,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "foreign-types" version = "0.5.0" @@ -1353,7 +1359,16 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash 0.2.0", ] [[package]] @@ -1931,6 +1946,31 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "naga" +version = "27.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8" +dependencies = [ + "arrayvec", + "bit-set", + "bitflags 2.9.4", + "cfg-if", + "cfg_aliases", + "codespan-reporting", + "half", + "hashbrown 0.16.1", + "indexmap 2.11.0", + "libm", + "log", + "num-traits", + "once_cell", + "petgraph", + "rustc-hash", + "spirv", + "thiserror 2.0.16", +] + [[package]] name = "ndk" version = "0.9.0" @@ -2711,6 +2751,7 @@ dependencies = [ "lazy_static", "libc", "log", + "naga 27.0.3", "object 0.37.3", "pretty_assertions", "regex", @@ -2723,6 +2764,7 @@ dependencies = [ "spirt", "spirv-std-types", "spirv-tools", + "strum", "thorin-dwp", "tracing", "tracing-subscriber", @@ -4016,7 +4058,7 @@ dependencies = [ "hashbrown 0.15.5", "js-sys", "log", - "naga", + "naga 26.0.0", "parking_lot", "portable-atomic", "profiling", @@ -4047,7 +4089,7 @@ dependencies = [ "hashbrown 0.15.5", "indexmap 2.11.0", "log", - "naga", + "naga 26.0.0", "once_cell", "parking_lot", "portable-atomic", @@ -4118,7 +4160,7 @@ dependencies = [ "libloading", "log", "metal", - "naga", + "naga 26.0.0", "ndk-sys", "objc", "ordered-float 5.0.0", diff --git a/crates/rustc_codegen_spirv/Cargo.toml b/crates/rustc_codegen_spirv/Cargo.toml index 2357ae1f7f..c0f98b7170 100644 --- a/crates/rustc_codegen_spirv/Cargo.toml +++ b/crates/rustc_codegen_spirv/Cargo.toml @@ -20,15 +20,16 @@ crate-type = ["dylib"] default = ["use-compiled-tools"] # If enabled, uses spirv-tools binaries installed in PATH, instead of # compiling and linking the spirv-tools C++ code -use-installed-tools = ["spirv-tools/use-installed-tools"] +use-installed-tools = ["spirv-tools/use-installed-tools", "naga"] # If enabled will compile and link the C++ code for the spirv tools, the compiled # version is preferred if both this and `use-installed-tools` are enabled -use-compiled-tools = ["spirv-tools/use-compiled-tools"] +use-compiled-tools = ["spirv-tools/use-compiled-tools", "naga"] # If enabled, this will not check whether the current rustc version is set to the # appropriate channel. rustc_cogeden_spirv requires a specific nightly version, # and will likely produce compile errors when built against a different toolchain. # Enable this feature to be able to experiment with other versions. skip-toolchain-check = [] +naga = ["dep:naga"] [dependencies] # HACK(eddyb) these only exist to unify features across dependency trees, @@ -61,6 +62,8 @@ itertools = "0.14.0" tracing.workspace = true tracing-subscriber.workspace = true tracing-tree = "0.4.0" +naga = { version = "27.0.3", features = ["spv-in", "wgsl-out"], optional = true } +strum = { version = "0.27.2", features = ["derive"] } [dev-dependencies] pretty_assertions = "1.0" diff --git a/crates/rustc_codegen_spirv/src/lib.rs b/crates/rustc_codegen_spirv/src/lib.rs index be6b291e25..7274635c64 100644 --- a/crates/rustc_codegen_spirv/src/lib.rs +++ b/crates/rustc_codegen_spirv/src/lib.rs @@ -133,6 +133,7 @@ mod custom_decorations; mod custom_insts; mod link; mod linker; +mod naga_transpile; mod spirv_type; mod spirv_type_constraints; mod symbols; diff --git a/crates/rustc_codegen_spirv/src/link.rs b/crates/rustc_codegen_spirv/src/link.rs index 6f80acaf5f..18b36c5c03 100644 --- a/crates/rustc_codegen_spirv/src/link.rs +++ b/crates/rustc_codegen_spirv/src/link.rs @@ -2,6 +2,7 @@ use crate::maybe_pqp_cg_ssa as rustc_codegen_ssa; use crate::codegen_cx::{CodegenArgs, SpirvMetadata}; +use crate::naga_transpile::should_transpile; use crate::target::{SpirvTarget, SpirvTargetVariant}; use crate::{SpirvCodegenBackend, SpirvModuleBuffer, linker}; use ar::{Archive, GnuBuilder, Header}; @@ -323,6 +324,10 @@ fn post_link_single_module( drop(save_modules_timer); } + + if let Ok(Some(transpile)) = should_transpile(sess) { + transpile(sess, cg_args, &spv_binary, out_filename).ok(); + } } fn do_spirv_opt( diff --git a/crates/rustc_codegen_spirv/src/naga_transpile.rs b/crates/rustc_codegen_spirv/src/naga_transpile.rs new file mode 100644 index 0000000000..0f2235cb45 --- /dev/null +++ b/crates/rustc_codegen_spirv/src/naga_transpile.rs @@ -0,0 +1,89 @@ +use crate::codegen_cx::CodegenArgs; +use crate::target::{NagaTarget, SpirvTarget}; +use rustc_session::Session; +use rustc_span::ErrorGuaranteed; +use std::path::Path; + +pub type NagaTranspile = fn( + sess: &Session, + cg_args: &CodegenArgs, + spv_binary: &[u32], + out_filename: &Path, +) -> Result<(), ErrorGuaranteed>; + +pub fn should_transpile(sess: &Session) -> Result, ErrorGuaranteed> { + let target = SpirvTarget::parse_target(sess.opts.target_triple.tuple()) + .expect("parsing should fail earlier"); + let result: Result, ()> = match target { + #[cfg(feature = "naga")] + SpirvTarget::Naga(NagaTarget::NAGA_WGSL) => Ok(Some(transpile::wgsl_transpile)), + #[cfg(not(feature = "naga"))] + SpirvTarget::Naga(NagaTarget::NAGA_WGSL) => Err(()), + _ => Ok(None), + }; + result.map_err(|_e| { + sess.dcx().err(format!( + "Target `{}` requires feature \"naga\" on rustc_codegen_spirv", + target.target() + )) + }) +} + +#[cfg(feature = "naga")] +mod transpile { + use crate::codegen_cx::CodegenArgs; + use naga::error::ShaderError; + use naga::valid::Capabilities; + use rustc_session::Session; + use rustc_span::ErrorGuaranteed; + use std::path::Path; + + pub fn wgsl_transpile( + sess: &Session, + _cg_args: &CodegenArgs, + spv_binary: &[u32], + out_filename: &Path, + ) -> Result<(), ErrorGuaranteed> { + // these should be params via spirv-builder + let opts = naga::front::spv::Options::default(); + let capabilities = Capabilities::default(); + let writer_flags = naga::back::wgsl::WriterFlags::empty(); + + let module = naga::front::spv::parse_u8_slice(bytemuck::cast_slice(spv_binary), &opts) + .map_err(|err| { + sess.dcx().err(format!( + "Naga failed to parse spv: \n{}", + ShaderError { + source: String::new(), + label: None, + inner: Box::new(err), + } + )) + })?; + let mut validator = + naga::valid::Validator::new(naga::valid::ValidationFlags::default(), capabilities); + let info = validator.validate(&module).map_err(|err| { + sess.dcx().err(format!( + "Naga validation failed: \n{}", + ShaderError { + source: String::new(), + label: None, + inner: Box::new(err), + } + )) + })?; + + let wgsl_dst = out_filename.with_extension("wgsl"); + let wgsl = naga::back::wgsl::write_string(&module, &info, writer_flags).map_err(|err| { + sess.dcx() + .err(format!("Naga failed to write wgsl : \n{err}")) + })?; + + std::fs::write(&wgsl_dst, wgsl).map_err(|err| { + sess.dcx() + .err(format!("failed to write wgsl to file: {err}")) + })?; + + Ok(()) + } +} diff --git a/crates/rustc_codegen_spirv/src/target.rs b/crates/rustc_codegen_spirv/src/target.rs index cd93695332..f29b761eff 100644 --- a/crates/rustc_codegen_spirv/src/target.rs +++ b/crates/rustc_codegen_spirv/src/target.rs @@ -5,11 +5,16 @@ use std::cmp::Ordering; use std::fmt::{Debug, Display, Formatter}; use std::ops::{Deref, DerefMut}; use std::str::FromStr; +use strum::{Display, EnumString, IntoStaticStr}; #[derive(Clone, Eq, PartialEq)] pub enum TargetError { + /// If during parsing a target variant returns `UnknownTarget`, further variants will attempt to parse the string. + /// Returning another error means that you have recognized the target but something else is invalid, and we should + /// abort the parsing with your error. UnknownTarget(String), InvalidTargetVersion(SpirvTarget), + InvalidNagaVariant(String), } impl Display for TargetError { @@ -21,6 +26,9 @@ impl Display for TargetError { TargetError::InvalidTargetVersion(target) => { write!(f, "Invalid version in target `{}`", target.env()) } + TargetError::InvalidNagaVariant(target) => { + write!(f, "Unknown naga out variant `{target}`") + } } } } @@ -439,6 +447,63 @@ impl Display for OpenGLTarget { } } +/// A naga target +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub struct NagaTarget { + pub out: NagaOut, +} + +#[derive(Copy, Clone, Debug, Eq, PartialEq, IntoStaticStr, Display, EnumString)] +#[allow(clippy::upper_case_acronyms)] +pub enum NagaOut { + #[strum(to_string = "wgsl")] + WGSL, +} + +impl NagaTarget { + pub const NAGA_WGSL: Self = NagaTarget::new(NagaOut::WGSL); + pub const ALL_NAGA_TARGETS: &'static [Self] = &[Self::NAGA_WGSL]; + /// emit spirv like naga targets were this target + pub const EMIT_SPIRV_LIKE: SpirvTarget = SpirvTarget::VULKAN_1_3; + + pub const fn new(out: NagaOut) -> Self { + Self { out } + } +} + +impl SpirvTargetVariant for NagaTarget { + fn validate(&self) -> Result<(), TargetError> { + Ok(()) + } + + fn to_spirv_tools(&self) -> spirv_tools::TargetEnv { + Self::EMIT_SPIRV_LIKE.to_spirv_tools() + } + + fn spirv_version(&self) -> SpirvVersion { + Self::EMIT_SPIRV_LIKE.spirv_version() + } +} + +impl FromStr for NagaTarget { + type Err = TargetError; + + fn from_str(s: &str) -> Result { + let s = s + .strip_prefix("naga-") + .ok_or_else(|| TargetError::UnknownTarget(s.to_owned()))?; + Ok(Self::new(FromStr::from_str(s).map_err(|_e| { + TargetError::InvalidNagaVariant(s.to_owned()) + })?)) + } +} + +impl Display for NagaTarget { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "naga-{}", self.out) + } +} + /// A rust-gpu target #[derive(Copy, Clone, Debug, Eq, PartialEq)] #[non_exhaustive] @@ -446,6 +511,7 @@ pub enum SpirvTarget { Universal(UniversalTarget), Vulkan(VulkanTarget), OpenGL(OpenGLTarget), + Naga(NagaTarget), } impl SpirvTarget { @@ -467,12 +533,15 @@ impl SpirvTarget { pub const OPENGL_4_2: Self = Self::OpenGL(OpenGLTarget::OPENGL_4_2); pub const OPENGL_4_3: Self = Self::OpenGL(OpenGLTarget::OPENGL_4_3); pub const OPENGL_4_5: Self = Self::OpenGL(OpenGLTarget::OPENGL_4_5); + pub const NAGA_WGSL: Self = Self::Naga(NagaTarget::NAGA_WGSL); + #[allow(clippy::match_same_arms)] pub const fn memory_model(&self) -> MemoryModel { match self { SpirvTarget::Universal(_) => MemoryModel::Simple, SpirvTarget::Vulkan(_) => MemoryModel::Vulkan, SpirvTarget::OpenGL(_) => MemoryModel::GLSL450, + SpirvTarget::Naga(_) => MemoryModel::Vulkan, } } } @@ -483,6 +552,7 @@ impl SpirvTargetVariant for SpirvTarget { SpirvTarget::Universal(t) => t.validate(), SpirvTarget::Vulkan(t) => t.validate(), SpirvTarget::OpenGL(t) => t.validate(), + SpirvTarget::Naga(t) => t.validate(), } } @@ -491,6 +561,7 @@ impl SpirvTargetVariant for SpirvTarget { SpirvTarget::Universal(t) => t.to_spirv_tools(), SpirvTarget::Vulkan(t) => t.to_spirv_tools(), SpirvTarget::OpenGL(t) => t.to_spirv_tools(), + SpirvTarget::Naga(t) => t.to_spirv_tools(), } } @@ -499,6 +570,7 @@ impl SpirvTargetVariant for SpirvTarget { SpirvTarget::Universal(t) => t.spirv_version(), SpirvTarget::Vulkan(t) => t.spirv_version(), SpirvTarget::OpenGL(t) => t.spirv_version(), + SpirvTarget::Naga(t) => t.spirv_version(), } } } @@ -513,6 +585,9 @@ impl SpirvTarget { if matches!(result, Err(TargetError::UnknownTarget(..))) { result = OpenGLTarget::from_str(s).map(Self::OpenGL); } + if matches!(result, Err(TargetError::UnknownTarget(..))) { + result = NagaTarget::from_str(s).map(Self::Naga); + } result } @@ -533,6 +608,7 @@ impl SpirvTarget { SpirvTarget::Universal(t) => t.to_string(), SpirvTarget::Vulkan(t) => t.to_string(), SpirvTarget::OpenGL(t) => t.to_string(), + SpirvTarget::Naga(t) => t.to_string(), } } @@ -555,6 +631,7 @@ impl SpirvTarget { .iter() .map(|t| Self::OpenGL(*t)), ) + .chain(NagaTarget::ALL_NAGA_TARGETS.iter().map(|t| Self::Naga(*t))) } } diff --git a/tests/compiletests/Cargo.toml b/tests/compiletests/Cargo.toml index 8b88c9211b..644473a647 100644 --- a/tests/compiletests/Cargo.toml +++ b/tests/compiletests/Cargo.toml @@ -15,7 +15,7 @@ use-compiled-tools = ["rustc_codegen_spirv/use-compiled-tools"] [dependencies] compiletest = { version = "0.11.2", package = "compiletest_rs" } -rustc_codegen_spirv = { workspace = true } +rustc_codegen_spirv = { workspace = true, features = ["naga"] } rustc_codegen_spirv-types = { workspace = true } clap = { version = "4", features = ["derive"] } itertools = "0.14.0" diff --git a/tests/compiletests/ui/arch/all_memory_barrier.rs b/tests/compiletests/ui/arch/all_memory_barrier.rs index b3f6d2f374..adfe7ab836 100644 --- a/tests/compiletests/ui/arch/all_memory_barrier.rs +++ b/tests/compiletests/ui/arch/all_memory_barrier.rs @@ -1,6 +1,7 @@ // build-pass // compile-flags: -C target-feature=+VulkanMemoryModelDeviceScopeKHR,+ext:SPV_KHR_vulkan_memory_model // compile-flags: -C llvm-args=--disassemble-fn=all_memory_barrier::all_memory_barrier +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/convert_u_to_acceleration_structure_khr.rs b/tests/compiletests/ui/arch/convert_u_to_acceleration_structure_khr.rs index 1a38c77980..9df46fc5e0 100644 --- a/tests/compiletests/ui/arch/convert_u_to_acceleration_structure_khr.rs +++ b/tests/compiletests/ui/arch/convert_u_to_acceleration_structure_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+Int64,+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/debug_printf.rs b/tests/compiletests/ui/arch/debug_printf.rs index e396b2f538..3b5022e430 100644 --- a/tests/compiletests/ui/arch/debug_printf.rs +++ b/tests/compiletests/ui/arch/debug_printf.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+ext:SPV_KHR_non_semantic_info +// ignore-naga use spirv_std::spirv; use spirv_std::{ diff --git a/tests/compiletests/ui/arch/demote_to_helper_invocation.rs b/tests/compiletests/ui/arch/demote_to_helper_invocation.rs index 862b1f4a6b..18405b103e 100644 --- a/tests/compiletests/ui/arch/demote_to_helper_invocation.rs +++ b/tests/compiletests/ui/arch/demote_to_helper_invocation.rs @@ -1,6 +1,7 @@ // build-pass // // compile-flags: -C target-feature=+DemoteToHelperInvocationEXT,+ext:SPV_EXT_demote_to_helper_invocation +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/emit_stream_vertex.rs b/tests/compiletests/ui/arch/emit_stream_vertex.rs index 3f605a0d53..0987aa400e 100644 --- a/tests/compiletests/ui/arch/emit_stream_vertex.rs +++ b/tests/compiletests/ui/arch/emit_stream_vertex.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C target-feature=+Int64,+GeometryStreams +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/emit_vertex.rs b/tests/compiletests/ui/arch/emit_vertex.rs index c8fa3fe781..3005d98f50 100644 --- a/tests/compiletests/ui/arch/emit_vertex.rs +++ b/tests/compiletests/ui/arch/emit_vertex.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+Geometry +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/end_primitive.rs b/tests/compiletests/ui/arch/end_primitive.rs index 0749ecd1e2..eba55624d5 100644 --- a/tests/compiletests/ui/arch/end_primitive.rs +++ b/tests/compiletests/ui/arch/end_primitive.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+Geometry +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/end_stream_primitive.rs b/tests/compiletests/ui/arch/end_stream_primitive.rs index abe041e1a7..ee28e9e68a 100644 --- a/tests/compiletests/ui/arch/end_stream_primitive.rs +++ b/tests/compiletests/ui/arch/end_stream_primitive.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C target-feature=+Int64,+GeometryStreams +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/execute_callable.rs b/tests/compiletests/ui/arch/execute_callable.rs index 41375a5153..79810e9bc8 100644 --- a/tests/compiletests/ui/arch/execute_callable.rs +++ b/tests/compiletests/ui/arch/execute_callable.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/ignore_intersection_khr.rs b/tests/compiletests/ui/arch/ignore_intersection_khr.rs index c7c68f7fb1..c80960de48 100644 --- a/tests/compiletests/ui/arch/ignore_intersection_khr.rs +++ b/tests/compiletests/ui/arch/ignore_intersection_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/memory_barrier.rs b/tests/compiletests/ui/arch/memory_barrier.rs index 3c6033b910..39310f1f04 100644 --- a/tests/compiletests/ui/arch/memory_barrier.rs +++ b/tests/compiletests/ui/arch/memory_barrier.rs @@ -1,4 +1,5 @@ // build-pass +// ignore-naga #![feature(adt_const_params)] #![allow(incomplete_features)] diff --git a/tests/compiletests/ui/arch/ray_query_confirm_intersection_khr.rs b/tests/compiletests/ui/arch/ray_query_confirm_intersection_khr.rs index d75c69878c..c2e2ced4d5 100644 --- a/tests/compiletests/ui/arch/ray_query_confirm_intersection_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_confirm_intersection_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_barycentrics_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_barycentrics_khr.rs index 4e859c6fea..74edf65040 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_barycentrics_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_barycentrics_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_candidate_aabb_opaque_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_candidate_aabb_opaque_khr.rs index 87376f005c..19c625f466 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_candidate_aabb_opaque_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_candidate_aabb_opaque_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_front_face_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_front_face_khr.rs index ba6006988e..bda1a59dca 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_front_face_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_front_face_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_geometry_index_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_geometry_index_khr.rs index 69323141d3..e453362bc7 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_geometry_index_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_geometry_index_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_instance_custom_index_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_instance_custom_index_khr.rs index 2dfc5bb17e..7ac735a1a3 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_instance_custom_index_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_instance_custom_index_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_instance_id_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_instance_id_khr.rs index 20b413deec..e3c0c37ef7 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_instance_id_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_instance_id_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_direction_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_direction_khr.rs index 177490b1b2..abdca7fe7a 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_direction_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_direction_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_origin_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_origin_khr.rs index a0ea175b89..aaeabddd40 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_origin_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_object_ray_origin_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_object_to_world_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_object_to_world_khr.rs index 20b8fc5b2f..b7a0996625 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_object_to_world_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_object_to_world_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::matrix::Matrix4x3; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_primitive_index_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_primitive_index_khr.rs index a4f9ab84cc..bc8d8b7925 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_primitive_index_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_primitive_index_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_shader_binding_table_record_offset_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_shader_binding_table_record_offset_khr.rs index 159c4aa16d..3e58521e56 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_shader_binding_table_record_offset_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_shader_binding_table_record_offset_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_t_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_t_khr.rs index 39cd3dde59..054542fdd5 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_t_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_t_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_intersection_type_khr.rs b/tests/compiletests/ui/arch/ray_query_get_intersection_type_khr.rs index 39b848003e..93be2c779c 100644 --- a/tests/compiletests/ui/arch/ray_query_get_intersection_type_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_intersection_type_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_ray_flags_khr.rs b/tests/compiletests/ui/arch/ray_query_get_ray_flags_khr.rs index 816e808b93..737bfb300c 100644 --- a/tests/compiletests/ui/arch/ray_query_get_ray_flags_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_ray_flags_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_ray_t_min_khr.rs b/tests/compiletests/ui/arch/ray_query_get_ray_t_min_khr.rs index b5c0d82c3f..c23234890f 100644 --- a/tests/compiletests/ui/arch/ray_query_get_ray_t_min_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_ray_t_min_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_world_ray_direction_khr.rs b/tests/compiletests/ui/arch/ray_query_get_world_ray_direction_khr.rs index 1f579e38b5..7e3d567fee 100644 --- a/tests/compiletests/ui/arch/ray_query_get_world_ray_direction_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_world_ray_direction_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_get_world_ray_origin_khr.rs b/tests/compiletests/ui/arch/ray_query_get_world_ray_origin_khr.rs index f56a47e67b..efd80dbf7b 100644 --- a/tests/compiletests/ui/arch/ray_query_get_world_ray_origin_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_get_world_ray_origin_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_initialize_khr.rs b/tests/compiletests/ui/arch/ray_query_initialize_khr.rs index ac2e5f0fab..75893656d1 100644 --- a/tests/compiletests/ui/arch/ray_query_initialize_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_initialize_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+RayQueryKHR,+ext:SPV_KHR_ray_tracing,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/ray_query_terminate_khr.rs b/tests/compiletests/ui/arch/ray_query_terminate_khr.rs index 02c5b4fde6..a1b53aa677 100644 --- a/tests/compiletests/ui/arch/ray_query_terminate_khr.rs +++ b/tests/compiletests/ui/arch/ray_query_terminate_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayQueryKHR,+ext:SPV_KHR_ray_query +// ignore-naga use glam::Vec3; use spirv_std::ray_tracing::{AccelerationStructure, RayFlags, RayQuery}; diff --git a/tests/compiletests/ui/arch/read_clock_khr.rs b/tests/compiletests/ui/arch/read_clock_khr.rs index 5222d57fa8..485a0cb031 100644 --- a/tests/compiletests/ui/arch/read_clock_khr.rs +++ b/tests/compiletests/ui/arch/read_clock_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+Int64,+ShaderClockKHR,+ext:SPV_KHR_shader_clock +// ignore-naga use glam::UVec2; use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/report_intersection_khr.rs b/tests/compiletests/ui/arch/report_intersection_khr.rs index a7d3cca8c8..cc0ab9be11 100644 --- a/tests/compiletests/ui/arch/report_intersection_khr.rs +++ b/tests/compiletests/ui/arch/report_intersection_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/terminate_ray_khr.rs b/tests/compiletests/ui/arch/terminate_ray_khr.rs index 5d986dfa1c..e9be85b18a 100644 --- a/tests/compiletests/ui/arch/terminate_ray_khr.rs +++ b/tests/compiletests/ui/arch/terminate_ray_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/trace_ray_khr.rs b/tests/compiletests/ui/arch/trace_ray_khr.rs index f210a65c98..496ada41eb 100644 --- a/tests/compiletests/ui/arch/trace_ray_khr.rs +++ b/tests/compiletests/ui/arch/trace_ray_khr.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/arch/workgroup_memory_barrier.rs b/tests/compiletests/ui/arch/workgroup_memory_barrier.rs index 1a4b6de668..ae2f216798 100644 --- a/tests/compiletests/ui/arch/workgroup_memory_barrier.rs +++ b/tests/compiletests/ui/arch/workgroup_memory_barrier.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C llvm-args=--disassemble-fn=workgroup_memory_barrier::workgroup_memory_barrier +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/dis/asm.rs b/tests/compiletests/ui/dis/asm.rs index 1e2a5a6f01..941f2a3522 100644 --- a/tests/compiletests/ui/dis/asm.rs +++ b/tests/compiletests/ui/dis/asm.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C llvm-args=--disassemble-fn=asm::asm +// ignore-naga use core::arch::asm; use spirv_std::spirv; diff --git a/tests/compiletests/ui/dis/asm.stderr b/tests/compiletests/ui/dis/asm.stderr index 0bf5d9ebac..41101daaf4 100644 --- a/tests/compiletests/ui/dis/asm.stderr +++ b/tests/compiletests/ui/dis/asm.stderr @@ -1,6 +1,6 @@ %1 = OpFunction %2 None %3 %4 = OpLabel -OpLine %5 13 13 +OpLine %5 14 13 OpMemoryBarrier %6 %7 OpNoLine OpReturn diff --git a/tests/compiletests/ui/dis/asm_op_decorate.rs b/tests/compiletests/ui/dis/asm_op_decorate.rs index d279beaee5..9836f461ac 100644 --- a/tests/compiletests/ui/dis/asm_op_decorate.rs +++ b/tests/compiletests/ui/dis/asm_op_decorate.rs @@ -20,6 +20,7 @@ // ignore-spv1.4 // ignore-spv1.5 // ignore-spv1.6 +// ignore-naga use core::arch::asm; use spirv_std::spirv; diff --git a/tests/compiletests/ui/dis/complex_image_sample_inst.rs b/tests/compiletests/ui/dis/complex_image_sample_inst.rs index 73b4dd2254..867cc3093c 100644 --- a/tests/compiletests/ui/dis/complex_image_sample_inst.rs +++ b/tests/compiletests/ui/dis/complex_image_sample_inst.rs @@ -1,6 +1,7 @@ // build-pass // compile-flags: -Ctarget-feature=+RuntimeDescriptorArray,+ext:SPV_EXT_descriptor_indexing // compile-flags: -C llvm-args=--disassemble-fn=complex_image_sample_inst::sample_proj_lod +// ignore-naga use core::arch::asm; use spirv_std::spirv; diff --git a/tests/compiletests/ui/dis/complex_image_sample_inst.stderr b/tests/compiletests/ui/dis/complex_image_sample_inst.stderr index b99b63a736..bc73b0b216 100644 --- a/tests/compiletests/ui/dis/complex_image_sample_inst.stderr +++ b/tests/compiletests/ui/dis/complex_image_sample_inst.stderr @@ -9,11 +9,11 @@ %13 = OpCompositeExtract %10 %7 0 %14 = OpCompositeExtract %10 %7 1 %15 = OpCompositeConstruct %6 %13 %14 -OpLine %16 29 13 -%17 = OpAccessChain %18 %19 %20 OpLine %16 30 13 +%17 = OpAccessChain %18 %19 %20 +OpLine %16 31 13 %21 = OpLoad %22 %17 -OpLine %16 34 13 +OpLine %16 35 13 %23 = OpImageSampleProjExplicitLod %2 %21 %4 Grad %12 %15 OpNoLine OpReturnValue %23 diff --git a/tests/compiletests/ui/dis/non-writable-storage_buffer.rs b/tests/compiletests/ui/dis/non-writable-storage_buffer.rs index 32e2d05a9b..f13aa75981 100644 --- a/tests/compiletests/ui/dis/non-writable-storage_buffer.rs +++ b/tests/compiletests/ui/dis/non-writable-storage_buffer.rs @@ -21,6 +21,7 @@ // ignore-spv1.4 // ignore-spv1.5 // ignore-spv1.6 +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/dis/panic_builtin_bounds_check.rs b/tests/compiletests/ui/dis/panic_builtin_bounds_check.rs index 832a15174c..e13f5a4a3e 100644 --- a/tests/compiletests/ui/dis/panic_builtin_bounds_check.rs +++ b/tests/compiletests/ui/dis/panic_builtin_bounds_check.rs @@ -17,6 +17,8 @@ // normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple" // FIXME(eddyb) handle this one in the test runner. // normalize-stderr-test "\S*/lib/rustlib/" -> "$$SYSROOT/lib/rustlib/" +// +// ignore-naga // HACK(eddyb) `compiletest` handles `ui\dis\`, but not `ui\\dis\\`, on Windows. // normalize-stderr-test "ui/dis/" -> "$$DIR/" diff --git a/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr b/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr index a3bee642b1..ab3168a52b 100644 --- a/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr +++ b/tests/compiletests/ui/dis/panic_builtin_bounds_check.stderr @@ -24,11 +24,11 @@ OpDecorate %6 ArrayStride 4 %19 = OpTypePointer Function %9 %2 = OpFunction %7 None %8 %20 = OpLabel -OpLine %5 32 4 +OpLine %5 34 4 %21 = OpVariable %12 Function -OpLine %5 32 23 +OpLine %5 34 23 %22 = OpCompositeConstruct %6 %13 %14 %15 %16 -OpLine %5 27 4 +OpLine %5 29 4 %23 = OpCompositeExtract %9 %22 0 %24 = OpCompositeExtract %9 %22 1 %25 = OpCompositeExtract %9 %22 2 @@ -47,7 +47,7 @@ OpLine %4 280 4 OpNoLine OpReturn %29 = OpLabel -OpLine %5 27 4 +OpLine %5 29 4 %33 = OpIAdd %9 %13 %18 %34 = OpInBoundsAccessChain %19 %21 %33 %35 = OpLoad %9 %34 diff --git a/tests/compiletests/ui/dis/panic_sequential_many.rs b/tests/compiletests/ui/dis/panic_sequential_many.rs index c64641e0ef..a7c1098988 100644 --- a/tests/compiletests/ui/dis/panic_sequential_many.rs +++ b/tests/compiletests/ui/dis/panic_sequential_many.rs @@ -18,6 +18,8 @@ // normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple" // FIXME(eddyb) handle this one in the test runner. // normalize-stderr-test "\S*/lib/rustlib/" -> "$$SYSROOT/lib/rustlib/" +// +// ignore-naga // HACK(eddyb) `compiletest` handles `ui\dis\`, but not `ui\\dis\\`, on Windows. // normalize-stderr-test "ui/dis/" -> "$$DIR/" diff --git a/tests/compiletests/ui/dis/panic_sequential_many.stderr b/tests/compiletests/ui/dis/panic_sequential_many.stderr index ad3952f81b..aa036e5032 100644 --- a/tests/compiletests/ui/dis/panic_sequential_many.stderr +++ b/tests/compiletests/ui/dis/panic_sequential_many.stderr @@ -27,11 +27,11 @@ OpDecorate %5 Location 0 %5 = OpVariable %11 Output %2 = OpFunction %12 None %13 %16 = OpLabel -OpLine %8 28 12 +OpLine %8 30 12 %17 = OpLoad %9 %3 -OpLine %8 28 35 +OpLine %8 30 35 %18 = OpLoad %9 %4 -OpLine %8 31 9 +OpLine %8 33 9 %19 = OpIEqual %14 %18 %15 OpNoLine OpSelectionMerge %20 None @@ -44,7 +44,7 @@ OpReturn %22 = OpLabel OpBranch %20 %20 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %24 = OpUDiv %9 %17 %18 %25 = OpIEqual %14 %18 %15 OpNoLine @@ -58,7 +58,7 @@ OpReturn %28 = OpLabel OpBranch %26 %26 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %30 = OpUDiv %9 %24 %18 %31 = OpIEqual %14 %18 %15 OpNoLine @@ -72,7 +72,7 @@ OpReturn %34 = OpLabel OpBranch %32 %32 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %36 = OpUDiv %9 %30 %18 %37 = OpIEqual %14 %18 %15 OpNoLine @@ -86,7 +86,7 @@ OpReturn %40 = OpLabel OpBranch %38 %38 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %42 = OpUDiv %9 %36 %18 %43 = OpIEqual %14 %18 %15 OpNoLine @@ -100,7 +100,7 @@ OpReturn %46 = OpLabel OpBranch %44 %44 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %48 = OpUDiv %9 %42 %18 %49 = OpIEqual %14 %18 %15 OpNoLine @@ -114,7 +114,7 @@ OpReturn %52 = OpLabel OpBranch %50 %50 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %54 = OpUDiv %9 %48 %18 %55 = OpIEqual %14 %18 %15 OpNoLine @@ -128,7 +128,7 @@ OpReturn %58 = OpLabel OpBranch %56 %56 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %60 = OpUDiv %9 %54 %18 %61 = OpIEqual %14 %18 %15 OpNoLine @@ -142,7 +142,7 @@ OpReturn %64 = OpLabel OpBranch %62 %62 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %66 = OpUDiv %9 %60 %18 %67 = OpIEqual %14 %18 %15 OpNoLine @@ -156,7 +156,7 @@ OpReturn %70 = OpLabel OpBranch %68 %68 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %72 = OpUDiv %9 %66 %18 %73 = OpIEqual %14 %18 %15 OpNoLine @@ -170,7 +170,7 @@ OpReturn %76 = OpLabel OpBranch %74 %74 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %78 = OpUDiv %9 %72 %18 %79 = OpIEqual %14 %18 %15 OpNoLine @@ -184,7 +184,7 @@ OpReturn %82 = OpLabel OpBranch %80 %80 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %84 = OpUDiv %9 %78 %18 %85 = OpIEqual %14 %18 %15 OpNoLine @@ -198,7 +198,7 @@ OpReturn %88 = OpLabel OpBranch %86 %86 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %90 = OpUDiv %9 %84 %18 %91 = OpIEqual %14 %18 %15 OpNoLine @@ -212,7 +212,7 @@ OpReturn %94 = OpLabel OpBranch %92 %92 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %96 = OpUDiv %9 %90 %18 %97 = OpIEqual %14 %18 %15 OpNoLine @@ -226,7 +226,7 @@ OpReturn %100 = OpLabel OpBranch %98 %98 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %102 = OpUDiv %9 %96 %18 %103 = OpIEqual %14 %18 %15 OpNoLine @@ -240,7 +240,7 @@ OpReturn %106 = OpLabel OpBranch %104 %104 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %108 = OpUDiv %9 %102 %18 %109 = OpIEqual %14 %18 %15 OpNoLine @@ -254,7 +254,7 @@ OpReturn %112 = OpLabel OpBranch %110 %110 = OpLabel -OpLine %8 31 9 +OpLine %8 33 9 %114 = OpUDiv %9 %108 %18 %115 = OpIEqual %14 %18 %15 OpNoLine @@ -268,7 +268,7 @@ OpReturn %118 = OpLabel OpBranch %116 %116 = OpLabel -OpLine %8 31 4 +OpLine %8 33 4 %120 = OpUDiv %9 %114 %18 OpStore %5 %120 OpNoLine diff --git a/tests/compiletests/ui/image/query/query_lod.rs b/tests/compiletests/ui/image/query/query_lod.rs index 4d764d0514..f5b68e8d07 100644 --- a/tests/compiletests/ui/image/query/query_lod.rs +++ b/tests/compiletests/ui/image/query/query_lod.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C target-feature=+ImageQuery +// ignore-naga use spirv_std::spirv; use spirv_std::{Image, Sampler, arch}; diff --git a/tests/compiletests/ui/image/query/rect_image_query_size.rs b/tests/compiletests/ui/image/query/rect_image_query_size.rs index 3182412157..38e8f5ac06 100644 --- a/tests/compiletests/ui/image/query/rect_image_query_size.rs +++ b/tests/compiletests/ui/image/query/rect_image_query_size.rs @@ -6,6 +6,7 @@ // ignore-vulkan1.2 // ignore-vulkan1.3 // ignore-vulkan1.4 +// ignore-naga use spirv_std::spirv; use spirv_std::{Image, arch}; diff --git a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.rs b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.rs index acfe0a61a3..5d9a9072d0 100644 --- a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.rs +++ b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.rs @@ -7,6 +7,7 @@ // ignore-vulkan1.2 // ignore-vulkan1.3 // ignore-vulkan1.4 +// ignore-naga use spirv_std::{Image, arch, image::SampledImage, spirv}; diff --git a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr index 8bb805378c..c12b67746c 100644 --- a/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr +++ b/tests/compiletests/ui/image/query/sampled_image_rect_query_size_lod_err.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Image: HasQuerySizeLod` is not satisfied - --> $DIR/sampled_image_rect_query_size_lod_err.rs:21:28 + --> $DIR/sampled_image_rect_query_size_lod_err.rs:22:28 | LL | *output = rect_sampled.query_size_lod(0); | ^^^^^^^^^^^^^^ the trait `HasQuerySizeLod` is not implemented for `Image` diff --git a/tests/compiletests/ui/lang/asm/infer-access-chain-array.rs b/tests/compiletests/ui/lang/asm/infer-access-chain-array.rs index cd3649989a..981afc414c 100644 --- a/tests/compiletests/ui/lang/asm/infer-access-chain-array.rs +++ b/tests/compiletests/ui/lang/asm/infer-access-chain-array.rs @@ -2,6 +2,7 @@ // when used to index arrays. // build-pass +// ignore-naga use core::arch::asm; use glam::Vec4; diff --git a/tests/compiletests/ui/spirv-attr/bool-inputs.rs b/tests/compiletests/ui/spirv-attr/bool-inputs.rs index c0d74df93b..9aaba163d6 100644 --- a/tests/compiletests/ui/spirv-attr/bool-inputs.rs +++ b/tests/compiletests/ui/spirv-attr/bool-inputs.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+FragmentFullyCoveredEXT,+ext:SPV_EXT_fragment_fully_covered +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/spirv-attr/invariant.rs b/tests/compiletests/ui/spirv-attr/invariant.rs index 37e7a698ec..027e951eaa 100644 --- a/tests/compiletests/ui/spirv-attr/invariant.rs +++ b/tests/compiletests/ui/spirv-attr/invariant.rs @@ -1,7 +1,10 @@ // Tests that the invariant attribute works // build-pass +use spirv_std::glam::Vec4; use spirv_std::spirv; #[spirv(vertex)] -pub fn main(#[spirv(invariant)] output: &mut f32) {} +pub fn main(#[spirv(invariant)] output: &mut f32, #[spirv(position)] pos: &mut Vec4) { + *pos = Vec4::ZERO; +} diff --git a/tests/compiletests/ui/spirv-attr/matrix-type.rs b/tests/compiletests/ui/spirv-attr/matrix-type.rs index ef8ca60349..a1c87cfca8 100644 --- a/tests/compiletests/ui/spirv-attr/matrix-type.rs +++ b/tests/compiletests/ui/spirv-attr/matrix-type.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -Ctarget-feature=+RayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv; diff --git a/tests/compiletests/ui/storage_class/runtime_descriptor_array.rs b/tests/compiletests/ui/storage_class/runtime_descriptor_array.rs index 0596b56725..3e4e432a40 100644 --- a/tests/compiletests/ui/storage_class/runtime_descriptor_array.rs +++ b/tests/compiletests/ui/storage_class/runtime_descriptor_array.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C target-feature=+RuntimeDescriptorArray,+ext:SPV_EXT_descriptor_indexing +// ignore-naga use spirv_std::spirv; use spirv_std::{Image, RuntimeArray, Sampler}; diff --git a/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.rs b/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.rs index 5ccefec3de..23cf386f8c 100644 --- a/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.rs +++ b/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.rs @@ -1,4 +1,5 @@ // build-fail +// ignore-naga use spirv_std::{Image, RuntimeArray, spirv}; diff --git a/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr b/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr index d46fcdc9a8..94b9f92fc5 100644 --- a/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr +++ b/tests/compiletests/ui/storage_class/runtime_descriptor_array_error.stderr @@ -1,11 +1,11 @@ error: descriptor indexing must use &RuntimeArray, not &[T] - --> $DIR/runtime_descriptor_array_error.rs:7:52 + --> $DIR/runtime_descriptor_array_error.rs:8:52 | LL | #[spirv(descriptor_set = 0, binding = 0)] one: &[Image!(2D, type=f32, sampled)], | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: use &[T] instead of &RuntimeArray - --> $DIR/runtime_descriptor_array_error.rs:8:61 + --> $DIR/runtime_descriptor_array_error.rs:9:61 | LL | #[spirv(uniform, descriptor_set = 0, binding = 0)] two: &RuntimeArray, | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array.rs b/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array.rs index 1383707dec..71a493c38f 100644 --- a/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array.rs +++ b/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C target-feature=+RuntimeDescriptorArray,+ext:SPV_EXT_descriptor_indexing +// ignore-naga use glam::Vec4; use spirv_std::spirv; diff --git a/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array_slice.rs b/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array_slice.rs index 9e62e99706..6eea70f3b8 100644 --- a/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array_slice.rs +++ b/tests/compiletests/ui/storage_class/typed_buffer_descriptor_array_slice.rs @@ -1,5 +1,6 @@ // build-pass // compile-flags: -C target-feature=+RuntimeDescriptorArray,+ext:SPV_EXT_descriptor_indexing +// ignore-naga use glam::Vec4; use spirv_std::spirv; diff --git a/tests/compiletests/ui/target_features_err.rs b/tests/compiletests/ui/target_features_err.rs index f6def31c4f..b06674d9cd 100644 --- a/tests/compiletests/ui/target_features_err.rs +++ b/tests/compiletests/ui/target_features_err.rs @@ -1,5 +1,6 @@ // build-fail // compile-flags: -Ctarget-feature=+rayTracingKHR,+ext:SPV_KHR_ray_tracing +// ignore-naga use spirv_std::spirv;