mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
parent
fe5c7716ed
commit
f780364317
@ -386,7 +386,7 @@ impl<'tcx> ConvSpirvType<'tcx> for TyAndLayout<'tcx> {
|
||||
if let Variants::Single { index } = self.variants {
|
||||
for i in self.fields.index_by_increasing_offset() {
|
||||
let field = &adt.variants[index].fields[i];
|
||||
field_names.push(field.ident.name.to_ident_string());
|
||||
field_names.push(field.name.to_ident_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -664,7 +664,7 @@ fn trans_struct<'tcx>(cx: &CodegenCx<'tcx>, span: Span, ty: TyAndLayout<'tcx>) -
|
||||
if let Variants::Single { index } = ty.variants {
|
||||
if let TyKind::Adt(adt, _) = ty.ty.kind() {
|
||||
let field = &adt.variants[index].fields[i];
|
||||
field_names.push(field.ident.name.to_ident_string());
|
||||
field_names.push(field.name.to_ident_string());
|
||||
} else {
|
||||
field_names.push(format!("{}", i));
|
||||
}
|
||||
@ -729,7 +729,7 @@ impl fmt::Display for TyLayoutNameKey<'_> {
|
||||
write!(f, "{}", self.ty)?;
|
||||
if let (TyKind::Adt(def, _), Some(index)) = (self.ty.kind(), self.variant) {
|
||||
if def.is_enum() && !def.variants.is_empty() {
|
||||
write!(f, "::{}", def.variants[index].ident)?;
|
||||
write!(f, "::{}", def.variants[index].name)?;
|
||||
}
|
||||
}
|
||||
if let (TyKind::Generator(_, _, _), Some(index)) = (self.ty.kind(), self.variant) {
|
||||
|
@ -2240,7 +2240,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
||||
self.intcast(val, dest_ty, false)
|
||||
}
|
||||
|
||||
fn do_not_inline(&mut self, _llret: Self::Value) {
|
||||
fn apply_attrs_to_cleanup_callsite(&mut self, _llret: Self::Value) {
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,7 @@ impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
|
||||
options: InlineAsmOptions,
|
||||
_line_spans: &[Span],
|
||||
_instance: Instance<'_>,
|
||||
_dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>,
|
||||
) {
|
||||
const SUPPORTED_OPTIONS: InlineAsmOptions = InlineAsmOptions::NORETURN;
|
||||
let unsupported_options = options & !SUPPORTED_OPTIONS;
|
||||
|
@ -91,7 +91,7 @@ impl<'tcx> CodegenCx<'tcx> {
|
||||
|
||||
// HACK(eddyb) this is a bit roundabout, but the easiest way to get a
|
||||
// fully absolute path that contains at least as much information as
|
||||
// `instance.to_string()` (at least with `-Z symbol-mangling-version=v0`).
|
||||
// `instance.to_string()` (at least with `-C symbol-mangling-version=v0`).
|
||||
// While we could use the mangled symbol instead, like we do for linkage,
|
||||
// `OpName` is more of a debugging aid, so not having to separately
|
||||
// demangle the SPIR-V can help. However, if some tools assume `OpName`
|
||||
|
@ -97,7 +97,7 @@ impl<'tcx> CodegenCx<'tcx> {
|
||||
// target_features is a HashSet, not a Vec, so we need to sort to have deterministic
|
||||
// compilation - otherwise, the order of capabilities in binaries depends on the iteration
|
||||
// order of the hashset. Sort by the string, since that's easy.
|
||||
feature_names.sort();
|
||||
feature_names.sort_unstable();
|
||||
|
||||
let features = feature_names
|
||||
.into_iter()
|
||||
|
@ -316,6 +316,7 @@ impl CodegenBackend for SpirvCodegenBackend {
|
||||
&self,
|
||||
ongoing_codegen: Box<dyn Any>,
|
||||
sess: &Session,
|
||||
_outputs: &OutputFilenames,
|
||||
) -> Result<(CodegenResults, FxHashMap<WorkProductId, WorkProduct>), ErrorReported> {
|
||||
let (codegen_results, work_products) = ongoing_codegen
|
||||
.downcast::<OngoingCodegen<Self>>()
|
||||
@ -338,7 +339,7 @@ impl CodegenBackend for SpirvCodegenBackend {
|
||||
sess,
|
||||
&codegen_results,
|
||||
outputs,
|
||||
&codegen_results.crate_info.local_crate_name.as_str(),
|
||||
codegen_results.crate_info.local_crate_name.as_str(),
|
||||
);
|
||||
drop(timer);
|
||||
|
||||
@ -454,15 +455,6 @@ impl ExtraBackendMethods for SpirvCodegenBackend {
|
||||
Self::Module::new()
|
||||
}
|
||||
|
||||
fn write_compressed_metadata<'tcx>(
|
||||
&self,
|
||||
_: TyCtxt<'tcx>,
|
||||
_: &EncodedMetadata,
|
||||
_: &mut Self::Module,
|
||||
) {
|
||||
// Ignore for now.
|
||||
}
|
||||
|
||||
fn codegen_allocator<'tcx>(
|
||||
&self,
|
||||
_: TyCtxt<'tcx>,
|
||||
|
@ -196,17 +196,20 @@ impl SpirvBuilder {
|
||||
}
|
||||
|
||||
/// Whether to print build.rs cargo metadata (e.g. cargo:rustc-env=var=val). Defaults to [`MetadataPrintout::Full`].
|
||||
#[must_use]
|
||||
pub fn print_metadata(mut self, v: MetadataPrintout) -> Self {
|
||||
self.print_metadata = v;
|
||||
self
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn deny_warnings(mut self, v: bool) -> Self {
|
||||
self.deny_warnings = v;
|
||||
self
|
||||
}
|
||||
|
||||
/// Build in release. Defaults to true.
|
||||
#[must_use]
|
||||
pub fn release(mut self, v: bool) -> Self {
|
||||
self.release = v;
|
||||
self
|
||||
@ -215,6 +218,7 @@ impl SpirvBuilder {
|
||||
/// Splits the resulting SPIR-V file into one module per entry point. This is useful in cases
|
||||
/// where ecosystem tooling has bugs around multiple entry points per module - having all entry
|
||||
/// points bundled into a single file is the preferred system.
|
||||
#[must_use]
|
||||
pub fn multimodule(mut self, v: bool) -> Self {
|
||||
self.multimodule = v;
|
||||
self
|
||||
@ -222,6 +226,7 @@ impl SpirvBuilder {
|
||||
|
||||
/// Sets the level of metadata (primarily `OpName` and `OpLine`) included in the SPIR-V binary.
|
||||
/// Including metadata significantly increases binary size.
|
||||
#[must_use]
|
||||
pub fn spirv_metadata(mut self, v: SpirvMetadata) -> Self {
|
||||
self.spirv_metadata = v;
|
||||
self
|
||||
@ -229,6 +234,7 @@ impl SpirvBuilder {
|
||||
|
||||
/// Adds a capability to the SPIR-V module. Checking if a capability is enabled in code can be
|
||||
/// done via `#[cfg(target_feature = "TheCapability")]`.
|
||||
#[must_use]
|
||||
pub fn capability(mut self, capability: Capability) -> Self {
|
||||
self.capabilities.push(capability);
|
||||
self
|
||||
@ -236,12 +242,14 @@ impl SpirvBuilder {
|
||||
|
||||
/// Adds an extension to the SPIR-V module. Checking if an extension is enabled in code can be
|
||||
/// done via `#[cfg(target_feature = "ext:the_extension")]`.
|
||||
#[must_use]
|
||||
pub fn extension(mut self, extension: impl Into<String>) -> Self {
|
||||
self.extensions.push(extension.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Allow store from one struct type to a different type with compatible layout and members.
|
||||
#[must_use]
|
||||
pub fn relax_struct_store(mut self, v: bool) -> Self {
|
||||
self.relax_struct_store = v;
|
||||
self
|
||||
@ -249,6 +257,7 @@ impl SpirvBuilder {
|
||||
|
||||
/// Allow allocating an object of a pointer type and returning a pointer value from a function
|
||||
/// in logical addressing mode
|
||||
#[must_use]
|
||||
pub fn relax_logical_pointer(mut self, v: bool) -> Self {
|
||||
self.relax_logical_pointer = v;
|
||||
self
|
||||
@ -256,6 +265,7 @@ impl SpirvBuilder {
|
||||
|
||||
/// Enable `VK_KHR_relaxed_block_layout` when checking standard uniform, storage buffer, and
|
||||
/// push constant layouts. This is the default when targeting Vulkan 1.1 or later.
|
||||
#[must_use]
|
||||
pub fn relax_block_layout(mut self, v: bool) -> Self {
|
||||
self.relax_block_layout = v;
|
||||
self
|
||||
@ -263,6 +273,7 @@ impl SpirvBuilder {
|
||||
|
||||
/// Enable `VK_KHR_uniform_buffer_standard_layout` when checking standard uniform buffer
|
||||
/// layouts.
|
||||
#[must_use]
|
||||
pub fn uniform_buffer_standard_layout(mut self, v: bool) -> Self {
|
||||
self.uniform_buffer_standard_layout = v;
|
||||
self
|
||||
@ -271,6 +282,7 @@ impl SpirvBuilder {
|
||||
/// Enable `VK_EXT_scalar_block_layout` when checking standard uniform, storage buffer, and
|
||||
/// push constant layouts. Scalar layout rules are more permissive than relaxed block layout so
|
||||
/// in effect this will override the --relax-block-layout option.
|
||||
#[must_use]
|
||||
pub fn scalar_block_layout(mut self, v: bool) -> Self {
|
||||
self.scalar_block_layout = v;
|
||||
self
|
||||
@ -278,12 +290,14 @@ impl SpirvBuilder {
|
||||
|
||||
/// Skip checking standard uniform/storage buffer layout. Overrides any --relax-block-layout or
|
||||
/// --scalar-block-layout option.
|
||||
#[must_use]
|
||||
pub fn skip_block_layout(mut self, v: bool) -> Self {
|
||||
self.skip_block_layout = v;
|
||||
self
|
||||
}
|
||||
|
||||
/// Preserve unused descriptor bindings. Useful for reflection.
|
||||
#[must_use]
|
||||
pub fn preserve_bindings(mut self, v: bool) -> Self {
|
||||
self.preserve_bindings = v;
|
||||
self
|
||||
@ -405,7 +419,7 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
|
||||
|
||||
let mut rustflags = vec![
|
||||
format!("-Zcodegen-backend={}", rustc_codegen_spirv.display()),
|
||||
"-Zsymbol-mangling-version=v0".to_string(),
|
||||
"-Csymbol-mangling-version=v0".to_string(),
|
||||
];
|
||||
|
||||
let mut llvm_args = vec![];
|
||||
|
@ -600,7 +600,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
|
||||
let op_string = format!("%string = OpString {:?}", format_string);
|
||||
|
||||
let output = quote::quote! {
|
||||
asm!(
|
||||
::core::arch::asm!(
|
||||
"%void = OpTypeVoid",
|
||||
#op_string,
|
||||
"%debug_printf = OpExtInstImport \"NonSemantic.DebugPrintf\"",
|
||||
|
@ -8,6 +8,8 @@ use crate::{
|
||||
scalar::Scalar,
|
||||
vector::Vector,
|
||||
};
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
mod barrier;
|
||||
mod demote_to_helper_invocation_ext;
|
||||
|
@ -1,3 +1,6 @@
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
/// Wait for other invocations of this module to reach the current point
|
||||
/// of execution.
|
||||
///
|
||||
|
@ -1,3 +1,6 @@
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
/// Demote fragment shader invocation to a helper invocation. Equivalvent to
|
||||
/// `discard()` in HLSL. Any stores to memory after this instruction are
|
||||
/// suppressed and the fragment does not write outputs to the framebuffer.
|
||||
|
@ -5,7 +5,7 @@ macro_rules! deriv_fn {
|
||||
($p:ident, $inst:ident) => {
|
||||
unsafe {
|
||||
let mut o = Default::default();
|
||||
asm!(
|
||||
::core::arch::asm!(
|
||||
"%input = OpLoad _ {0}",
|
||||
concat!("%result = ", stringify!($inst), " _ %input"),
|
||||
"OpStore {1} %result",
|
||||
|
@ -1,3 +1,6 @@
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
/// Emits the current values of all output variables to the current output
|
||||
/// primitive. After execution, the values of all output variables
|
||||
/// are undefined. Requires capability `Geometry`.
|
||||
|
@ -1,3 +1,6 @@
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
/// Reports an intersection back to the traversal infrastructure.
|
||||
///
|
||||
/// If the intersection occurred within the current ray interval, the
|
||||
|
@ -1,6 +1,8 @@
|
||||
//! Traits and helper functions related to floats.
|
||||
|
||||
use crate::vector::Vector;
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
/// Abstract trait representing a SPIR-V floating point type.
|
||||
///
|
||||
|
@ -1,5 +1,8 @@
|
||||
//! Image types
|
||||
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
// Rustfmt formats long marker trait impls over multiple lines which makes them
|
||||
// harder to read.
|
||||
#[rustfmt::skip]
|
||||
|
@ -2,7 +2,6 @@
|
||||
#![cfg_attr(
|
||||
target_arch = "spirv",
|
||||
feature(
|
||||
asm,
|
||||
asm_const,
|
||||
asm_experimental_arch,
|
||||
core_intrinsics,
|
||||
|
@ -1,5 +1,7 @@
|
||||
//! Ray-tracing data types
|
||||
use crate::vector::Vector;
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
|
||||
/// An acceleration structure type which is an opaque reference to an
|
||||
/// acceleration structure handle as defined in the client API specification.
|
||||
@ -201,7 +203,7 @@ macro_rules! ray_query {
|
||||
(@inner $name:ident $(, $mut:tt)?) => {
|
||||
let $name: &$($mut)? RayQuery = unsafe {
|
||||
let $name : *mut RayQuery;
|
||||
asm! {
|
||||
::core::arch::asm! {
|
||||
"%ray_query = OpTypeRayQueryKHR",
|
||||
"%ray_query_ptr = OpTypePointer Generic %ray_query",
|
||||
"{name} = OpVariable %ray_query_ptr Function",
|
||||
|
@ -1,3 +1,5 @@
|
||||
#[cfg(target_arch = "spirv")]
|
||||
use core::arch::asm;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Dynamically-sized arrays in Rust carry around their length as the second half of a tuple.
|
||||
|
@ -115,7 +115,7 @@ to your built `rustc_codegen_spirv` dynamic library. We have to also provide
|
||||
target = "spirv-unknown-spv1.3"
|
||||
rustflags = [
|
||||
"-Zcodegen-backend=<path_to_librustc_codegen_spirv>",
|
||||
"-Zsymbol-mangling-version=v0"
|
||||
"-Csymbol-mangling-version=v0"
|
||||
]
|
||||
|
||||
[unstable]
|
||||
|
@ -5,5 +5,5 @@
|
||||
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
|
||||
|
||||
[toolchain]
|
||||
channel = "nightly-2021-12-02"
|
||||
channel = "nightly-2022-01-13"
|
||||
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
|
||||
|
@ -122,7 +122,7 @@ impl Runner {
|
||||
"--crate-type dylib",
|
||||
"-Zunstable-options",
|
||||
"-Zcrate-attr=no_std",
|
||||
"-Zcrate-attr=feature(register_attr,asm,asm_const,asm_experimental_arch)",
|
||||
"-Zcrate-attr=feature(register_attr,asm_const,asm_experimental_arch)",
|
||||
"-Zcrate-attr=register_attr(spirv)",
|
||||
]
|
||||
.join(" ")
|
||||
@ -311,7 +311,7 @@ fn rust_flags(codegen_backend_path: &Path) -> String {
|
||||
"-Cdebuginfo=2",
|
||||
"-Cembed-bitcode=no",
|
||||
&format!("-Ctarget-feature=+{}", target_features.join(",+")),
|
||||
"-Zsymbol-mangling-version=v0",
|
||||
"-Csymbol-mangling-version=v0",
|
||||
]
|
||||
.join(" ")
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 72 4
|
||||
OpLine %5 75 4
|
||||
OpMemoryBarrier %6 %7
|
||||
OpLine %8 9 1
|
||||
OpReturn
|
||||
|
@ -1,6 +1,6 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 38 4
|
||||
OpLine %5 41 4
|
||||
OpControlBarrier %6 %7 %8
|
||||
OpLine %9 9 1
|
||||
OpReturn
|
||||
|
@ -96,9 +96,9 @@ error[E0277]: the trait bound `{float}: Vector<f32, 2_usize>` is not satisfied
|
||||
<DVec2 as Vector<f64, 2_usize>>
|
||||
and 13 others
|
||||
note: required by a bound in `debug_printf_assert_is_vector`
|
||||
--> $SPIRV_STD_SRC/lib.rs:145:8
|
||||
--> $SPIRV_STD_SRC/lib.rs:144:8
|
||||
|
|
||||
145 | V: crate::vector::Vector<TY, SIZE>,
|
||||
144 | V: crate::vector::Vector<TY, SIZE>,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `debug_printf_assert_is_vector`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
|
@ -1,6 +1,6 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 72 4
|
||||
OpLine %5 75 4
|
||||
OpMemoryBarrier %6 %7
|
||||
OpLine %8 9 1
|
||||
OpReturn
|
||||
|
@ -1,6 +1,6 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 38 4
|
||||
OpLine %5 41 4
|
||||
OpControlBarrier %6 %7 %8
|
||||
OpLine %9 9 1
|
||||
OpReturn
|
||||
|
@ -1,6 +1,6 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 72 4
|
||||
OpLine %5 75 4
|
||||
OpMemoryBarrier %6 %7
|
||||
OpLine %8 8 1
|
||||
OpReturn
|
||||
|
@ -1,6 +1,6 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 38 4
|
||||
OpLine %5 41 4
|
||||
OpControlBarrier %6 %6 %7
|
||||
OpLine %8 8 1
|
||||
OpReturn
|
||||
|
@ -1,6 +1,7 @@
|
||||
// build-pass
|
||||
// compile-flags: -C llvm-args=--disassemble-fn=asm::asm
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
fn asm() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
%1 = OpFunction %2 None %3
|
||||
%4 = OpLabel
|
||||
OpLine %5 8 8
|
||||
OpLine %5 9 8
|
||||
OpMemoryBarrier %6 %7
|
||||
OpLine %5 15 1
|
||||
OpLine %5 16 1
|
||||
OpReturn
|
||||
OpFunctionEnd
|
||||
|
@ -1,6 +1,7 @@
|
||||
// build-pass
|
||||
// compile-flags: -C llvm-args=--disassemble-fn=asm_add_two_ints::add_two_ints
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
fn add_two_ints(x: u32, y: u32) -> u32 {
|
||||
|
@ -2,8 +2,8 @@
|
||||
%4 = OpFunctionParameter %2
|
||||
%5 = OpFunctionParameter %2
|
||||
%6 = OpLabel
|
||||
OpLine %7 9 8
|
||||
OpLine %7 10 8
|
||||
%8 = OpIAdd %2 %4 %5
|
||||
OpLine %7 17 1
|
||||
OpLine %7 18 1
|
||||
OpReturnValue %8
|
||||
OpFunctionEnd
|
||||
|
@ -10,6 +10,7 @@
|
||||
// are not supported in `compiletest-rs`.
|
||||
// ignore-vulkan1.2
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
fn add_decorate() {
|
||||
|
@ -2,6 +2,7 @@
|
||||
// compile-flags: -Ctarget-feature=+RuntimeDescriptorArray,+ext:SPV_EXT_descriptor_indexing
|
||||
// compile-flags: -C llvm-args=--disassemble-fn=complex_image_sample_inst::sample_proj_lod
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
fn sample_proj_lod(
|
||||
|
@ -5,10 +5,10 @@
|
||||
%8 = OpFunctionParameter %9
|
||||
%10 = OpFunctionParameter %9
|
||||
%11 = OpLabel
|
||||
OpLine %12 17 8
|
||||
OpLine %12 18 8
|
||||
%13 = OpAccessChain %14 %15 %16
|
||||
%17 = OpLoad %18 %13
|
||||
%19 = OpImageSampleProjExplicitLod %2 %17 %4 Grad|ConstOffset %5 %7 %20
|
||||
OpLine %12 57 1
|
||||
OpLine %12 58 1
|
||||
OpReturnValue %19
|
||||
OpFunctionEnd
|
||||
|
@ -1,7 +1,7 @@
|
||||
error: Cannot memcpy dynamically sized data
|
||||
--> $CORE_SRC/intrinsics.rs:2171:14
|
||||
--> $CORE_SRC/intrinsics.rs:2173:14
|
||||
|
|
||||
2171 | unsafe { copy(src, dst, count) }
|
||||
2173 | unsafe { copy(src, dst, count) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Test `OpImageGather`
|
||||
// build-pass
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std::{arch, Image, Sampler};
|
||||
|
||||
#[spirv(fragment)]
|
||||
|
@ -9,9 +9,9 @@ error[E0277]: the trait bound `Image<f32, 0_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
|
||||
<Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
|
||||
<Image<SampledType, 4_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
|
||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::gather`
|
||||
--> $SPIRV_STD_SRC/image.rs:161:15
|
||||
--> $SPIRV_STD_SRC/image.rs:164:15
|
||||
|
|
||||
161 | Self: HasGather,
|
||||
164 | Self: HasGather,
|
||||
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::gather`
|
||||
|
||||
error[E0277]: the trait bound `Image<f32, 2_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u32>: HasGather` is not satisfied
|
||||
@ -25,9 +25,9 @@ error[E0277]: the trait bound `Image<f32, 2_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
|
||||
<Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
|
||||
<Image<SampledType, 4_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasGather>
|
||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::gather`
|
||||
--> $SPIRV_STD_SRC/image.rs:161:15
|
||||
--> $SPIRV_STD_SRC/image.rs:164:15
|
||||
|
|
||||
161 | Self: HasGather,
|
||||
164 | Self: HasGather,
|
||||
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::gather`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
|
||||
<Image<SampledType, 2_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
|
||||
<Image<SampledType, 3_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
|
||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_levels`
|
||||
--> $SPIRV_STD_SRC/image.rs:818:15
|
||||
--> $SPIRV_STD_SRC/image.rs:821:15
|
||||
|
|
||||
818 | Self: HasQueryLevels,
|
||||
821 | Self: HasQueryLevels,
|
||||
| ^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_levels`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
|
||||
<Image<SampledType, 2_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
|
||||
<Image<SampledType, 3_u32, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT> as HasQueryLevels>
|
||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_lod`
|
||||
--> $SPIRV_STD_SRC/image.rs:844:15
|
||||
--> $SPIRV_STD_SRC/image.rs:847:15
|
||||
|
|
||||
844 | Self: HasQueryLevels,
|
||||
847 | Self: HasQueryLevels,
|
||||
| ^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_lod`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -11,9 +11,9 @@ error[E0277]: the trait bound `Image<f32, 1_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
|
||||
<Image<SampledType, 1_u32, DEPTH, ARRAYED, 0_u32, 0_u32, FORMAT> as HasQuerySize>
|
||||
and 10 others
|
||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_size`
|
||||
--> $SPIRV_STD_SRC/image.rs:875:15
|
||||
--> $SPIRV_STD_SRC/image.rs:878:15
|
||||
|
|
||||
875 | Self: HasQuerySize,
|
||||
878 | Self: HasQuerySize,
|
||||
| ^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT>::query_size`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image<f32, 4_u32, 2_u32, 0_u32, 0_u32, 1_u32, 0_u
|
||||
<Image<SampledType, 2_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasQuerySizeLod>
|
||||
<Image<SampledType, 3_u32, DEPTH, ARRAYED, 0_u32, SAMPLED, FORMAT> as HasQuerySizeLod>
|
||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::query_size_lod`
|
||||
--> $SPIRV_STD_SRC/image.rs:908:15
|
||||
--> $SPIRV_STD_SRC/image.rs:911:15
|
||||
|
|
||||
908 | Self: HasQuerySizeLod,
|
||||
911 | Self: HasQuerySizeLod,
|
||||
| ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, {_: u32}, SAMPLED, FORMAT>::query_size_lod`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -2,6 +2,7 @@
|
||||
// within the `asm!` macro.
|
||||
// build-fail
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
// Active basic block with `noreturn`.
|
||||
|
@ -1,23 +1,23 @@
|
||||
error: `noreturn` requires a terminator at the end
|
||||
--> $DIR/block_tracking_fail.rs:10:9
|
||||
--> $DIR/block_tracking_fail.rs:11:9
|
||||
|
|
||||
10 | asm!("", options(noreturn));
|
||||
11 | asm!("", options(noreturn));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: trailing terminator Unreachable requires `options(noreturn)`
|
||||
--> $DIR/block_tracking_fail.rs:17:9
|
||||
--> $DIR/block_tracking_fail.rs:18:9
|
||||
|
|
||||
17 | asm!("OpUnreachable");
|
||||
18 | asm!("OpUnreachable");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: expected OpLabel after terminator Kill
|
||||
--> $DIR/block_tracking_fail.rs:24:9
|
||||
--> $DIR/block_tracking_fail.rs:25:9
|
||||
|
|
||||
24 | / asm!(
|
||||
25 | | "OpKill",
|
||||
26 | | "%sum = OpFAdd _ {x} {x}",
|
||||
27 | | x = in(reg) x,
|
||||
28 | | );
|
||||
25 | / asm!(
|
||||
26 | | "OpKill",
|
||||
27 | | "%sum = OpFAdd _ {x} {x}",
|
||||
28 | | x = in(reg) x,
|
||||
29 | | );
|
||||
| |_________^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
@ -2,6 +2,7 @@
|
||||
// within the `asm!` macro.
|
||||
// build-pass
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
fn asm_label() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Tests using `asm!` with a const argument.
|
||||
// build-pass
|
||||
|
||||
use core::arch::asm;
|
||||
use spirv_std as _;
|
||||
|
||||
fn asm() {
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
// build-pass
|
||||
|
||||
use spirv_std as _;
|
||||
|
||||
use core::arch::asm;
|
||||
use glam::Vec4;
|
||||
use spirv_std as _;
|
||||
|
||||
#[spirv(fragment)]
|
||||
pub fn main(#[spirv(push_constant)] array_in: &[Vec4; 16], #[spirv(flat)] i: u32, out: &mut Vec4) {
|
||||
|
@ -3,9 +3,9 @@
|
||||
|
||||
// build-pass
|
||||
|
||||
use spirv_std as _;
|
||||
|
||||
use core::arch::asm;
|
||||
use glam::Vec4;
|
||||
use spirv_std as _;
|
||||
|
||||
#[spirv(fragment)]
|
||||
pub fn main(
|
||||
|
@ -4,30 +4,30 @@ OpLine %5 11 11
|
||||
%6 = OpCompositeInsert %7 %8 %9 0
|
||||
OpLine %5 11 11
|
||||
%10 = OpCompositeExtract %11 %6 1
|
||||
OpLine %12 767 14
|
||||
OpLine %12 754 14
|
||||
%13 = OpBitcast %14 %8
|
||||
OpLine %12 767 8
|
||||
OpLine %12 754 8
|
||||
OpSelectionMerge %15 None
|
||||
OpSwitch %13 %16 0 %17 1 %18
|
||||
%16 = OpLabel
|
||||
OpLine %12 767 14
|
||||
OpLine %12 754 14
|
||||
OpUnreachable
|
||||
%17 = OpLabel
|
||||
OpLine %12 769 20
|
||||
OpLine %12 756 20
|
||||
OpBranch %15
|
||||
%18 = OpLabel
|
||||
OpLine %12 771 4
|
||||
OpLine %12 755 23
|
||||
OpBranch %15
|
||||
%15 = OpLabel
|
||||
%19 = OpPhi %20 %21 %17 %22 %18
|
||||
%23 = OpPhi %11 %24 %17 %10 %18
|
||||
OpBranch %25
|
||||
%25 = OpLabel
|
||||
OpLine %12 771 4
|
||||
OpLine %12 758 4
|
||||
OpSelectionMerge %26 None
|
||||
OpBranchConditional %19 %27 %28
|
||||
%27 = OpLabel
|
||||
OpLine %12 771 4
|
||||
OpLine %12 758 4
|
||||
OpBranch %26
|
||||
%28 = OpLabel
|
||||
OpBranch %26
|
||||
|
Loading…
Reference in New Issue
Block a user