mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-10-29 21:42:20 +00:00
Add rustfmt.toml
with version = "Two"
to enable formatting array patterns.
This commit is contained in:
parent
cfaabbab08
commit
4a987f3eb0
@ -42,7 +42,9 @@ fn check_toolchain_version() -> Result<(), Box<dyn Error>> {
|
|||||||
return Err(Box::<dyn Error>::from(format!(
|
return Err(Box::<dyn Error>::from(format!(
|
||||||
"error: building from local source while `REQUIRED_RUST_TOOLCHAIN` (defined in `{}`) doesn't match `{}`",
|
"error: building from local source while `REQUIRED_RUST_TOOLCHAIN` (defined in `{}`) doesn't match `{}`",
|
||||||
file!(),
|
file!(),
|
||||||
std::path::Path::new("../../rust-toolchain.toml").canonicalize()?.display()
|
std::path::Path::new("../../rust-toolchain.toml")
|
||||||
|
.canonicalize()?
|
||||||
|
.display()
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ pub(crate) fn provide(providers: &mut Providers) {
|
|||||||
if hide_niche {
|
if hide_niche {
|
||||||
layout = tcx.mk_layout(LayoutS {
|
layout = tcx.mk_layout(LayoutS {
|
||||||
largest_niche: None,
|
largest_niche: None,
|
||||||
..clone_layout(layout.0 .0)
|
..clone_layout(layout.0.0)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2397,10 +2397,13 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
|||||||
// HACK(eddyb) this is basically a `try` block.
|
// HACK(eddyb) this is basically a `try` block.
|
||||||
let remove_format_args_if_possible = || -> Option<()> {
|
let remove_format_args_if_possible = || -> Option<()> {
|
||||||
let format_args_id = match args {
|
let format_args_id = match args {
|
||||||
&[SpirvValue {
|
&[
|
||||||
kind: SpirvValueKind::Def(format_args_id),
|
SpirvValue {
|
||||||
..
|
kind: SpirvValueKind::Def(format_args_id),
|
||||||
}, _] => format_args_id,
|
..
|
||||||
|
},
|
||||||
|
_,
|
||||||
|
] => format_args_id,
|
||||||
|
|
||||||
_ => return None,
|
_ => return None,
|
||||||
};
|
};
|
||||||
@ -2503,15 +2506,13 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
|||||||
|
|
||||||
let (rt_args_slice_ptr_id, rt_args_count) = match try_rev_take(3)?[..] {
|
let (rt_args_slice_ptr_id, rt_args_count) = match try_rev_take(3)?[..] {
|
||||||
[
|
[
|
||||||
// HACK(eddyb) comment works around `rustfmt` array bugs.
|
|
||||||
Inst::Call(call_ret_id, callee_id, ref call_args),
|
Inst::Call(call_ret_id, callee_id, ref call_args),
|
||||||
Inst::Store(st_dst_id, st_val_id),
|
Inst::Store(st_dst_id, st_val_id),
|
||||||
Inst::Load(ld_val_id, ld_src_id),
|
Inst::Load(ld_val_id, ld_src_id),
|
||||||
]
|
] if self.fmt_args_new_fn_ids.borrow().contains(&callee_id)
|
||||||
if self.fmt_args_new_fn_ids.borrow().contains(&callee_id)
|
&& call_ret_id == st_val_id
|
||||||
&& call_ret_id == st_val_id
|
&& st_dst_id == ld_src_id
|
||||||
&& st_dst_id == ld_src_id
|
&& ld_val_id == format_args_id =>
|
||||||
&& ld_val_id == format_args_id =>
|
|
||||||
{
|
{
|
||||||
require_local_var(st_dst_id)?;
|
require_local_var(st_dst_id)?;
|
||||||
match call_args[..] {
|
match call_args[..] {
|
||||||
@ -2565,7 +2566,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
|||||||
{
|
{
|
||||||
let rt_arg_var_id = match init_of_rt_arg_var_insts[..] {
|
let rt_arg_var_id = match init_of_rt_arg_var_insts[..] {
|
||||||
[
|
[
|
||||||
// HACK(eddyb) comment works around `rustfmt` array bugs.
|
|
||||||
Inst::Bitcast(b, _),
|
Inst::Bitcast(b, _),
|
||||||
Inst::Bitcast(a, _),
|
Inst::Bitcast(a, _),
|
||||||
Inst::AccessChain(a_ptr, a_base_ptr, SpirvConst::U32(0)),
|
Inst::AccessChain(a_ptr, a_base_ptr, SpirvConst::U32(0)),
|
||||||
@ -2587,7 +2587,6 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
|||||||
copy_from_rt_arg_var_to_rt_args_array_insts.split_at(4);
|
copy_from_rt_arg_var_to_rt_args_array_insts.split_at(4);
|
||||||
let (a, b) = match copy_loads[..] {
|
let (a, b) = match copy_loads[..] {
|
||||||
[
|
[
|
||||||
// HACK(eddyb) comment works around `rustfmt` array bugs.
|
|
||||||
Inst::AccessChain(a_ptr, a_base_ptr, SpirvConst::U32(0)),
|
Inst::AccessChain(a_ptr, a_base_ptr, SpirvConst::U32(0)),
|
||||||
Inst::Load(a_ld_val, a_ld_src),
|
Inst::Load(a_ld_val, a_ld_src),
|
||||||
Inst::AccessChain(b_ptr, b_base_ptr, SpirvConst::U32(1)),
|
Inst::AccessChain(b_ptr, b_base_ptr, SpirvConst::U32(1)),
|
||||||
@ -2601,8 +2600,11 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
|||||||
};
|
};
|
||||||
match copy_stores[..] {
|
match copy_stores[..] {
|
||||||
[
|
[
|
||||||
// HACK(eddyb) comment works around `rustfmt` array bugs.
|
Inst::InBoundsAccessChain(
|
||||||
Inst::InBoundsAccessChain(array_slot_ptr, array_base_ptr, SpirvConst::U32(array_idx)),
|
array_slot_ptr,
|
||||||
|
array_base_ptr,
|
||||||
|
SpirvConst::U32(array_idx),
|
||||||
|
),
|
||||||
Inst::AccessChain(a_ptr, a_base_ptr, SpirvConst::U32(0)),
|
Inst::AccessChain(a_ptr, a_base_ptr, SpirvConst::U32(0)),
|
||||||
Inst::Store(a_st_dst, a_st_val),
|
Inst::Store(a_st_dst, a_st_val),
|
||||||
Inst::AccessChain(b_ptr, b_base_ptr, SpirvConst::U32(1)),
|
Inst::AccessChain(b_ptr, b_base_ptr, SpirvConst::U32(1)),
|
||||||
@ -2611,9 +2613,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
|
|||||||
&& array_idx as usize == rt_arg_idx
|
&& array_idx as usize == rt_arg_idx
|
||||||
&& [a_base_ptr, b_base_ptr] == [array_slot_ptr; 2]
|
&& [a_base_ptr, b_base_ptr] == [array_slot_ptr; 2]
|
||||||
&& (a, b) == (a_st_val, b_st_val)
|
&& (a, b) == (a_st_val, b_st_val)
|
||||||
&& (a_ptr, b_ptr) == (a_st_dst, b_st_dst) =>
|
&& (a_ptr, b_ptr) == (a_st_dst, b_st_dst) => {}
|
||||||
{
|
|
||||||
}
|
|
||||||
_ => return None,
|
_ => return None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
return SpirvValue {
|
return SpirvValue {
|
||||||
kind: SpirvValueKind::IllegalTypeUsed(result_type),
|
kind: SpirvValueKind::IllegalTypeUsed(result_type),
|
||||||
ty: result_type,
|
ty: result_type,
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
// PassMode::Pair is identical to PassMode::Direct - it's returned as a struct
|
// PassMode::Pair is identical to PassMode::Direct - it's returned as a struct
|
||||||
PassMode::Direct(_) | PassMode::Pair(_, _) => (),
|
PassMode::Direct(_) | PassMode::Pair(_, _) => (),
|
||||||
|
@ -719,10 +719,12 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
|
|||||||
|
|
||||||
// FIXME(eddyb) try multiple signatures until one fits.
|
// FIXME(eddyb) try multiple signatures until one fits.
|
||||||
let mut sig = match instruction_signatures(instruction.class.opcode)? {
|
let mut sig = match instruction_signatures(instruction.class.opcode)? {
|
||||||
[sig @ InstSig {
|
[
|
||||||
output_type: Some(_),
|
sig @ InstSig {
|
||||||
..
|
output_type: Some(_),
|
||||||
}] => *sig,
|
..
|
||||||
|
},
|
||||||
|
] => *sig,
|
||||||
_ => return None,
|
_ => return None,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -487,10 +487,10 @@ impl<'tcx> CodegenCx<'tcx> {
|
|||||||
*offset += size;
|
*offset += size;
|
||||||
} else {
|
} else {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
offset.bytes_usize(),
|
offset.bytes_usize(),
|
||||||
alloc.inner().len(),
|
alloc.inner().len(),
|
||||||
"create_const_alloc must consume all bytes of an Allocation after an unsized struct"
|
"create_const_alloc must consume all bytes of an Allocation after an unsized struct"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
self.constant_composite(ty, values.into_iter())
|
self.constant_composite(ty, values.into_iter())
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ impl CodegenArgs {
|
|||||||
Some(v) => {
|
Some(v) => {
|
||||||
return Err(rustc_session::getopts::Fail::UnrecognizedOption(
|
return Err(rustc_session::getopts::Fail::UnrecognizedOption(
|
||||||
v.to_string(),
|
v.to_string(),
|
||||||
))
|
));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -472,11 +472,7 @@ impl<'a> SpanRegenerator<'a> {
|
|||||||
})
|
})
|
||||||
.unwrap_or(false);
|
.unwrap_or(false);
|
||||||
|
|
||||||
if sf_src_matches {
|
if sf_src_matches { Some(sf) } else { None }
|
||||||
Some(sf)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
file.as_deref()
|
file.as_deref()
|
||||||
|
@ -125,10 +125,11 @@ fn compute_idom(preds: &[Vec<usize>], reachable_blocks: &[bool]) -> Vec<Option<u
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert!(idom
|
assert!(
|
||||||
.iter()
|
idom.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
.all(|(i, x)| x.is_some() == reachable_blocks[i]));
|
.all(|(i, x)| x.is_some() == reachable_blocks[i])
|
||||||
|
);
|
||||||
idom
|
idom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1276,7 +1276,7 @@ impl<'a, S: Specialization> InferCx<'a, S> {
|
|||||||
return Ok(Match {
|
return Ok(Match {
|
||||||
ambiguous: true,
|
ambiguous: true,
|
||||||
..Match::default()
|
..Match::default()
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
InferOperand::Var(_) => return Err(Unapplicable),
|
InferOperand::Var(_) => return Err(Unapplicable),
|
||||||
InferOperand::Instance(instance) => instance,
|
InferOperand::Instance(instance) => instance,
|
||||||
|
@ -233,11 +233,11 @@ const _: () = {
|
|||||||
use spirt::{func_at::*, visit::*, *};
|
use spirt::{func_at::*, visit::*, *};
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
'a,
|
'a,
|
||||||
S,
|
S,
|
||||||
VCR: FnMut(&mut S, FuncAt<'a, ControlRegion>),
|
VCR: FnMut(&mut S, FuncAt<'a, ControlRegion>),
|
||||||
VCN: FnMut(&mut S, FuncAt<'a, ControlNode>),
|
VCN: FnMut(&mut S, FuncAt<'a, ControlNode>),
|
||||||
> Visitor<'a> for VisitAllControlRegionsAndNodes<S, VCR, VCN>
|
> Visitor<'a> for VisitAllControlRegionsAndNodes<S, VCR, VCN>
|
||||||
{
|
{
|
||||||
// FIXME(eddyb) this is excessive, maybe different kinds of
|
// FIXME(eddyb) this is excessive, maybe different kinds of
|
||||||
// visitors should exist for module-level and func-level?
|
// visitors should exist for module-level and func-level?
|
||||||
|
@ -299,7 +299,9 @@ fn type_mismatch() {
|
|||||||
let result = assemble_and_link(&[&a, &b]);
|
let result = assemble_and_link(&[&a, &b]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
result.err().as_deref(),
|
result.err().as_deref(),
|
||||||
Some("error: Types mismatch for \"foo\"\n |\n = note: import type: (TypeFloat)\n = note: export type: (TypeInt)")
|
Some(
|
||||||
|
"error: Types mismatch for \"foo\"\n |\n = note: import type: (TypeFloat)\n = note: export type: (TypeInt)"
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,7 +649,7 @@ fn parse_entry_attrs(
|
|||||||
format!(
|
format!(
|
||||||
"#[spirv({name}(..))] unknown attribute argument {attr_name}"
|
"#[spirv({name}(..))] unknown attribute argument {attr_name}"
|
||||||
),
|
),
|
||||||
))
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -463,9 +463,11 @@ mod params {
|
|||||||
"r8ui" => ImageFormat::R8ui,
|
"r8ui" => ImageFormat::R8ui,
|
||||||
"r64ui" => ImageFormat::R64ui,
|
"r64ui" => ImageFormat::R64ui,
|
||||||
"r64i" => ImageFormat::R64i,
|
"r64i" => ImageFormat::R64i,
|
||||||
_ => return Err(
|
_ => {
|
||||||
"Unknown specified image format. Use `type=<type>` instead if this is intentional.",
|
return Err(
|
||||||
),
|
"Unknown specified image format. Use `type=<type>` instead if this is intentional.",
|
||||||
|
);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,7 +492,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
|
|||||||
return parsing_error(
|
return parsing_error(
|
||||||
"Unterminated format specifier: missing type after precision",
|
"Unterminated format specifier: missing type after precision",
|
||||||
span,
|
span,
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -506,17 +506,19 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
|
|||||||
return parsing_error(
|
return parsing_error(
|
||||||
"Unterminated format specifier: missing type after decimal point",
|
"Unterminated format specifier: missing type after decimal point",
|
||||||
span,
|
span,
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
while ch.is_ascii_digit() {
|
while ch.is_ascii_digit() {
|
||||||
ch = match chars.next() {
|
ch = match chars.next() {
|
||||||
Some(ch) => ch,
|
Some(ch) => ch,
|
||||||
None => return parsing_error(
|
None => {
|
||||||
"Unterminated format specifier: missing type after fraction precision",
|
return parsing_error(
|
||||||
span,
|
"Unterminated format specifier: missing type after fraction precision",
|
||||||
),
|
span,
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -527,7 +529,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
|
|||||||
Some('3') => 3,
|
Some('3') => 3,
|
||||||
Some('4') => 4,
|
Some('4') => 4,
|
||||||
Some(ch) => {
|
Some(ch) => {
|
||||||
return parsing_error(&format!("Invalid width for vector: {ch}"), span)
|
return parsing_error(&format!("Invalid width for vector: {ch}"), span);
|
||||||
}
|
}
|
||||||
None => return parsing_error("Missing vector dimensions specifier", span),
|
None => return parsing_error("Missing vector dimensions specifier", span),
|
||||||
};
|
};
|
||||||
@ -543,7 +545,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
|
|||||||
return parsing_error(
|
return parsing_error(
|
||||||
&format!("Unrecognised vector type specifier: '{ch}'"),
|
&format!("Unrecognised vector type specifier: '{ch}'"),
|
||||||
span,
|
span,
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -555,7 +557,7 @@ fn debug_printf_inner(input: DebugPrintfInput) -> TokenStream {
|
|||||||
return parsing_error(
|
return parsing_error(
|
||||||
&format!("Unrecognised format specifier: '{ch}'"),
|
&format!("Unrecognised format specifier: '{ch}'"),
|
||||||
span,
|
span,
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,11 +25,7 @@ pub enum Arrayed {
|
|||||||
|
|
||||||
impl From<bool> for Arrayed {
|
impl From<bool> for Arrayed {
|
||||||
fn from(val: bool) -> Self {
|
fn from(val: bool) -> Self {
|
||||||
if val {
|
if val { Self::True } else { Self::False }
|
||||||
Self::True
|
|
||||||
} else {
|
|
||||||
Self::False
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,11 +98,7 @@ pub enum Multisampled {
|
|||||||
|
|
||||||
impl From<bool> for Multisampled {
|
impl From<bool> for Multisampled {
|
||||||
fn from(val: bool) -> Self {
|
fn from(val: bool) -> Self {
|
||||||
if val {
|
if val { Self::True } else { Self::False }
|
||||||
Self::True
|
|
||||||
} else {
|
|
||||||
Self::False
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,14 +120,14 @@ pub struct Image<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -166,14 +166,14 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -458,13 +458,13 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -680,14 +680,14 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -749,14 +749,14 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -818,13 +818,13 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::SubpassData as u32 },
|
{ Dimensionality::SubpassData as u32 },
|
||||||
@ -866,15 +866,15 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> Image<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
> Image<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
||||||
{
|
{
|
||||||
/// Query the number of mipmap levels.
|
/// Query the number of mipmap levels.
|
||||||
#[crate::macros::gpu_only]
|
#[crate::macros::gpu_only]
|
||||||
@ -955,14 +955,14 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -1000,13 +1000,13 @@ impl<
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1047,14 +1047,14 @@ pub struct SampledImage<I> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
SampledImage<
|
SampledImage<
|
||||||
Image<
|
Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
@ -1205,15 +1205,15 @@ pub trait ImageWithMethods<
|
|||||||
|
|
||||||
#[crate::macros::gen_sample_param_permutations]
|
#[crate::macros::gen_sample_param_permutations]
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DIM: u32,
|
const DIM: u32,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
>
|
>
|
||||||
ImageWithMethods<
|
ImageWithMethods<
|
||||||
SampledType,
|
SampledType,
|
||||||
DIM,
|
DIM,
|
||||||
@ -1420,13 +1420,13 @@ impl<
|
|||||||
/// `OpTypeImage` must be 0."
|
/// `OpTypeImage` must be 0."
|
||||||
pub trait HasGather {}
|
pub trait HasGather {}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasGather
|
> HasGather
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1440,13 +1440,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasGather
|
> HasGather
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Rect as u32 },
|
{ Dimensionality::Rect as u32 },
|
||||||
@ -1460,13 +1460,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasGather
|
> HasGather
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Cube as u32 },
|
{ Dimensionality::Cube as u32 },
|
||||||
@ -1486,14 +1486,14 @@ impl<
|
|||||||
/// "Its Dim operand must be one of 1D, 2D, 3D, or Cube."
|
/// "Its Dim operand must be one of 1D, 2D, 3D, or Cube."
|
||||||
pub trait HasQueryLevels {}
|
pub trait HasQueryLevels {}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQueryLevels
|
> HasQueryLevels
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::OneD as u32 },
|
{ Dimensionality::OneD as u32 },
|
||||||
@ -1507,14 +1507,14 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQueryLevels
|
> HasQueryLevels
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1528,14 +1528,14 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQueryLevels
|
> HasQueryLevels
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::ThreeD as u32 },
|
{ Dimensionality::ThreeD as u32 },
|
||||||
@ -1549,14 +1549,14 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQueryLevels
|
> HasQueryLevels
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Cube as u32 },
|
{ Dimensionality::Cube as u32 },
|
||||||
@ -1577,13 +1577,13 @@ impl<
|
|||||||
/// 3D, or Cube, it must also have either an MS of 1 or a Sampled of 0 or 2."
|
/// 3D, or Cube, it must also have either an MS of 1 or a Sampled of 0 or 2."
|
||||||
pub trait HasQuerySize {}
|
pub trait HasQuerySize {}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::OneD as u32 },
|
{ Dimensionality::OneD as u32 },
|
||||||
@ -1597,12 +1597,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::OneD as u32 },
|
{ Dimensionality::OneD as u32 },
|
||||||
@ -1616,12 +1616,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::OneD as u32 },
|
{ Dimensionality::OneD as u32 },
|
||||||
@ -1635,13 +1635,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1655,12 +1655,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1674,12 +1674,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1693,13 +1693,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::ThreeD as u32 },
|
{ Dimensionality::ThreeD as u32 },
|
||||||
@ -1713,12 +1713,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::ThreeD as u32 },
|
{ Dimensionality::ThreeD as u32 },
|
||||||
@ -1732,12 +1732,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::ThreeD as u32 },
|
{ Dimensionality::ThreeD as u32 },
|
||||||
@ -1751,13 +1751,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Cube as u32 },
|
{ Dimensionality::Cube as u32 },
|
||||||
@ -1771,12 +1771,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Cube as u32 },
|
{ Dimensionality::Cube as u32 },
|
||||||
@ -1790,12 +1790,12 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Cube as u32 },
|
{ Dimensionality::Cube as u32 },
|
||||||
@ -1809,14 +1809,14 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Rect as u32 },
|
{ Dimensionality::Rect as u32 },
|
||||||
@ -1830,14 +1830,14 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const MULTISAMPLED: u32,
|
const MULTISAMPLED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySize
|
> HasQuerySize
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Buffer as u32 },
|
{ Dimensionality::Buffer as u32 },
|
||||||
@ -1857,13 +1857,13 @@ impl<
|
|||||||
/// "Its Dim operand must be one of 1D, 2D, 3D, or Cube, and its MS must be 0."
|
/// "Its Dim operand must be one of 1D, 2D, 3D, or Cube, and its MS must be 0."
|
||||||
pub trait HasQuerySizeLod {}
|
pub trait HasQuerySizeLod {}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySizeLod
|
> HasQuerySizeLod
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::OneD as u32 },
|
{ Dimensionality::OneD as u32 },
|
||||||
@ -1877,13 +1877,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySizeLod
|
> HasQuerySizeLod
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::TwoD as u32 },
|
{ Dimensionality::TwoD as u32 },
|
||||||
@ -1897,13 +1897,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySizeLod
|
> HasQuerySizeLod
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::ThreeD as u32 },
|
{ Dimensionality::ThreeD as u32 },
|
||||||
@ -1917,13 +1917,13 @@ impl<
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
impl<
|
impl<
|
||||||
SampledType: SampleType<FORMAT, COMPONENTS>,
|
SampledType: SampleType<FORMAT, COMPONENTS>,
|
||||||
const DEPTH: u32,
|
const DEPTH: u32,
|
||||||
const FORMAT: u32,
|
const FORMAT: u32,
|
||||||
const ARRAYED: u32,
|
const ARRAYED: u32,
|
||||||
const SAMPLED: u32,
|
const SAMPLED: u32,
|
||||||
const COMPONENTS: u32,
|
const COMPONENTS: u32,
|
||||||
> HasQuerySizeLod
|
> HasQuerySizeLod
|
||||||
for Image<
|
for Image<
|
||||||
SampledType,
|
SampledType,
|
||||||
{ Dimensionality::Cube as u32 },
|
{ Dimensionality::Cube as u32 },
|
||||||
|
@ -57,11 +57,7 @@ pub fn acos_approx(v: f32) -> f32 {
|
|||||||
let mut res = -0.155972 * x + 1.56467; // p(x)
|
let mut res = -0.155972 * x + 1.56467; // p(x)
|
||||||
res *= (1.0f32 - x).sqrt();
|
res *= (1.0f32 - x).sqrt();
|
||||||
|
|
||||||
if v >= 0.0 {
|
if v >= 0.0 { res } else { PI - res }
|
||||||
res
|
|
||||||
} else {
|
|
||||||
PI - res
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn smoothstep(edge0: f32, edge1: f32, x: f32) -> f32 {
|
pub fn smoothstep(edge0: f32, edge1: f32, x: f32) -> f32 {
|
||||||
|
3
rustfmt.toml
Normal file
3
rustfmt.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# HACK(eddyb) needed to format array/slice patterns at all, because it was a
|
||||||
|
# breaking change (see https://github.com/rust-lang/rustfmt/pull/4994).
|
||||||
|
version = "Two"
|
@ -9,9 +9,9 @@ error[E0277]: the trait bound `Image<f32, 0, 2, 0, 0, 1, 0, 4>: HasGather` is no
|
|||||||
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
||||||
Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
||||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
||||||
--> $SPIRV_STD_SRC/image.rs:200:15
|
--> $SPIRV_STD_SRC/image.rs:197:15
|
||||||
|
|
|
|
||||||
200 | Self: HasGather,
|
197 | Self: HasGather,
|
||||||
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
||||||
|
|
||||||
error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0, 4>: HasGather` is not satisfied
|
error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0, 4>: HasGather` is not satisfied
|
||||||
@ -25,9 +25,9 @@ error[E0277]: the trait bound `Image<f32, 2, 2, 0, 0, 1, 0, 4>: HasGather` is no
|
|||||||
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
||||||
Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 4, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
||||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
||||||
--> $SPIRV_STD_SRC/image.rs:200:15
|
--> $SPIRV_STD_SRC/image.rs:197:15
|
||||||
|
|
|
|
||||||
200 | Self: HasGather,
|
197 | Self: HasGather,
|
||||||
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
| ^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#1}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::gather`
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image<f32, 4, 2, 0, 0, 1, 0, 4>: HasQueryLevels`
|
|||||||
Image<SampledType, 2, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 2, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
||||||
Image<SampledType, 3, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 3, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
||||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_levels`
|
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_levels`
|
||||||
--> $SPIRV_STD_SRC/image.rs:884:15
|
--> $SPIRV_STD_SRC/image.rs:881:15
|
||||||
|
|
|
|
||||||
884 | Self: HasQueryLevels,
|
881 | Self: HasQueryLevels,
|
||||||
| ^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_levels`
|
| ^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_levels`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image<f32, 4, 2, 0, 0, 1, 0, 4>: HasQueryLevels`
|
|||||||
Image<SampledType, 2, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 2, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
||||||
Image<SampledType, 3, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 3, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>
|
||||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_lod`
|
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_lod`
|
||||||
--> $SPIRV_STD_SRC/image.rs:910:15
|
--> $SPIRV_STD_SRC/image.rs:907:15
|
||||||
|
|
|
|
||||||
910 | Self: HasQueryLevels,
|
907 | Self: HasQueryLevels,
|
||||||
| ^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_lod`
|
| ^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_lod`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -15,9 +15,9 @@ error[E0277]: the trait bound `Image<f32, 1, 2, 0, 0, 1, 0, 4>: HasQuerySize` is
|
|||||||
Image<SampledType, 2, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
|
Image<SampledType, 2, DEPTH, ARRAYED, 0, 2, FORMAT, COMPONENTS>
|
||||||
and 6 others
|
and 6 others
|
||||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_size`
|
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_size`
|
||||||
--> $SPIRV_STD_SRC/image.rs:941:15
|
--> $SPIRV_STD_SRC/image.rs:938:15
|
||||||
|
|
|
|
||||||
941 | Self: HasQuerySize,
|
938 | Self: HasQuerySize,
|
||||||
| ^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_size`
|
| ^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, MULTISAMPLED, SAMPLED, FORMAT, COMPONENTS>::query_size`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -10,9 +10,9 @@ error[E0277]: the trait bound `Image<f32, 4, 2, 0, 0, 1, 0, 4>: HasQuerySizeLod`
|
|||||||
Image<SampledType, 2, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 2, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
||||||
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
Image<SampledType, 3, DEPTH, ARRAYED, 0, SAMPLED, FORMAT, COMPONENTS>
|
||||||
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
|
note: required by a bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
|
||||||
--> $SPIRV_STD_SRC/image.rs:985:15
|
--> $SPIRV_STD_SRC/image.rs:982:15
|
||||||
|
|
|
|
||||||
985 | Self: HasQuerySizeLod,
|
982 | Self: HasQuerySizeLod,
|
||||||
| ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
|
| ^^^^^^^^^^^^^^^ required by this bound in `Image::<SampledType, DIM, DEPTH, ARRAYED, spirv_std::::image::{impl#7}::{constant#0}, SAMPLED, FORMAT, COMPONENTS>::query_size_lod`
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -39,7 +39,7 @@ fn h(xyz: (&u32, &u32, &u32)) -> (u32, u32, u32) {
|
|||||||
// should just never exist by-value, and `qptr` may very well get rid of them).
|
// should just never exist by-value, and `qptr` may very well get rid of them).
|
||||||
#[inline(never)]
|
#[inline(never)]
|
||||||
fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) {
|
fn h_newtyped(xyz: ((&u32, &u32, &u32),)) -> (u32, u32, u32) {
|
||||||
(*xyz.0 .0, *xyz.0 .1, *xyz.0 .2)
|
(*xyz.0.0, *xyz.0.1, *xyz.0.2)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[spirv(fragment)]
|
#[spirv(fragment)]
|
||||||
|
Loading…
Reference in New Issue
Block a user