Skip to content

Commit 18f9e02

Browse files
committed
replace tabs with spaces
1 parent 6fb8750 commit 18f9e02

File tree

5 files changed

+109
-109
lines changed

5 files changed

+109
-109
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ macro_rules! simple_shift_op {
176176
let result = (|| Some(match (const_lhs, const_rhs) {
177177
$(
178178
(ConstValue::Unsigned($int_lhs), ConstValue::Unsigned($int_rhs)) => $fold_int,
179-
(ConstValue::Unsigned($int_lhs), ConstValue::Signed($int_rhs)) => $fold_int,
180-
(ConstValue::Signed($int_lhs), ConstValue::Unsigned($int_rhs)) => $fold_int as u128,
181-
(ConstValue::Signed($int_lhs), ConstValue::Signed($int_rhs)) => $fold_int as u128,
182-
)?
183-
$(
184-
(ConstValue::Unsigned($uint_lhs), ConstValue::Unsigned($uint_rhs)) => $fold_uint,
179+
(ConstValue::Unsigned($int_lhs), ConstValue::Signed($int_rhs)) => $fold_int,
180+
(ConstValue::Signed($int_lhs), ConstValue::Unsigned($int_rhs)) => $fold_int as u128,
181+
(ConstValue::Signed($int_lhs), ConstValue::Signed($int_rhs)) => $fold_int as u128,
182+
)?
183+
$(
184+
(ConstValue::Unsigned($uint_lhs), ConstValue::Unsigned($uint_rhs)) => $fold_uint,
185185
(ConstValue::Unsigned($uint_lhs), ConstValue::Signed($uint_rhs)) => $fold_uint,
186186
)?
187187
$(

crates/rustc_codegen_spirv/src/builder/format_args_decompiler.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,8 @@ impl<'tcx> DecodedFormatArgs<'tcx> {
332332

333333
let prepare_args_insts = try_rev_take(2).ok_or_else(|| {
334334
FormatArgsNotRecognized(
335-
"fmt::Arguments::new_v1_formatted call: ran out of instructions".into(),
336-
)
335+
"fmt::Arguments::new_v1_formatted call: ran out of instructions".into(),
336+
)
337337
})?;
338338
let (rt_args_slice_ptr_id, _fmt_placeholders_slice_ptr_id) =
339339
match prepare_args_insts[..] {
@@ -567,22 +567,22 @@ impl<'tcx> DecodedFormatArgs<'tcx> {
567567
})?;
568568

569569
*maybe_ref_arg_id = match ref_arg_store_insts[..] {
570-
[
571-
Inst::InBoundsAccessChain(field_ptr, base_ptr, field_idx),
572-
Inst::Store(st_dst_ptr, st_val),
573-
] if base_ptr == ref_args_tmp_slot_ptr
574-
&& field_idx as usize == rt_arg_idx
575-
&& st_dst_ptr == field_ptr =>
576-
{
577-
Some(st_val)
578-
}
579-
_ => None,
580-
}
581-
.ok_or_else(|| {
582-
FormatArgsNotRecognized(format!(
583-
"fmt::rt::Argument::new argument store sequence ({ref_arg_store_insts:?})"
584-
))
585-
})?;
570+
[
571+
Inst::InBoundsAccessChain(field_ptr, base_ptr, field_idx),
572+
Inst::Store(st_dst_ptr, st_val),
573+
] if base_ptr == ref_args_tmp_slot_ptr
574+
&& field_idx as usize == rt_arg_idx
575+
&& st_dst_ptr == field_ptr =>
576+
{
577+
Some(st_val)
578+
}
579+
_ => None,
580+
}
581+
.ok_or_else(|| {
582+
FormatArgsNotRecognized(format!(
583+
"fmt::rt::Argument::new argument store sequence ({ref_arg_store_insts:?})"
584+
))
585+
})?;
586586
}
587587
}
588588
}

crates/spirv-std/src/scalar.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ macro_rules! impl_scalar {
6363
impl Sealed for $ty {}
6464
impl ScalarComposite for $ty {
6565
#[inline]
66-
fn transform<F: ScalarOrVectorTransform>(self, f: &mut F) -> Self {
67-
f.transform_scalar(self)
68-
}
69-
}
70-
unsafe impl ScalarOrVector for $ty {
66+
fn transform<F: ScalarOrVectorTransform>(self, f: &mut F) -> Self {
67+
f.transform_scalar(self)
68+
}
69+
}
70+
unsafe impl ScalarOrVector for $ty {
7171
type Scalar = Self;
7272
const N: NonZeroUsize = NonZeroUsize::new(1).unwrap();
7373
}

examples/runners/ash/src/graphics.rs

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -91,77 +91,77 @@ impl MyRenderPipelineManager {
9191
)?;
9292

9393
let mut pipelines =
94-
self
95-
.device
96-
.create_graphics_pipelines(vk::PipelineCache::null(), &[vk::GraphicsPipelineCreateInfo::default()
97-
.stages(
98-
&[
99-
vk::PipelineShaderStageCreateInfo {
100-
module: shader_module,
101-
p_name: c"main_vs".as_ptr(),
102-
stage: vk::ShaderStageFlags::VERTEX,
103-
..Default::default()
104-
},
105-
vk::PipelineShaderStageCreateInfo {
106-
module: shader_module,
107-
p_name: c"main_fs".as_ptr(),
108-
stage: vk::ShaderStageFlags::FRAGMENT,
109-
// NOTE(eddyb) this acts like an integration test for specialization constants.
110-
p_specialization_info: &vk::SpecializationInfo::default()
111-
.map_entries(&[vk::SpecializationMapEntry::default()
112-
.constant_id(0x5007)
113-
.offset(0)
114-
.size(4)])
115-
.data(&u32::to_le_bytes(
116-
self.sky_fs_spec_id_0x5007_sun_intensity_extra_spec_const_factor,
117-
)),
118-
..Default::default()
119-
},
120-
],
121-
)
122-
.vertex_input_state(&vk::PipelineVertexInputStateCreateInfo::default())
123-
.input_assembly_state(&vk::PipelineInputAssemblyStateCreateInfo {
124-
topology: vk::PrimitiveTopology::TRIANGLE_LIST,
125-
..Default::default()
126-
})
127-
.rasterization_state(&vk::PipelineRasterizationStateCreateInfo {
128-
front_face: vk::FrontFace::COUNTER_CLOCKWISE,
129-
line_width: 1.0,
130-
..Default::default()
131-
})
132-
.multisample_state(&vk::PipelineMultisampleStateCreateInfo {
133-
rasterization_samples: vk::SampleCountFlags::TYPE_1,
134-
..Default::default()
135-
})
136-
.depth_stencil_state(&vk::PipelineDepthStencilStateCreateInfo::default())
137-
.color_blend_state(
138-
&vk::PipelineColorBlendStateCreateInfo::default()
139-
.attachments(
140-
&[vk::PipelineColorBlendAttachmentState {
141-
blend_enable: 0,
142-
src_color_blend_factor: vk::BlendFactor::SRC_COLOR,
143-
dst_color_blend_factor: vk::BlendFactor::ONE_MINUS_DST_COLOR,
144-
color_blend_op: vk::BlendOp::ADD,
145-
src_alpha_blend_factor: vk::BlendFactor::ZERO,
146-
dst_alpha_blend_factor: vk::BlendFactor::ZERO,
147-
alpha_blend_op: vk::BlendOp::ADD,
148-
color_write_mask: vk::ColorComponentFlags::RGBA,
149-
}],
150-
),
151-
)
152-
.dynamic_state(
153-
&vk::PipelineDynamicStateCreateInfo::default()
154-
.dynamic_states(&[vk::DynamicState::VIEWPORT, vk::DynamicState::SCISSOR]),
155-
)
156-
.viewport_state(
157-
&vk::PipelineViewportStateCreateInfo::default()
158-
.scissor_count(1)
159-
.viewport_count(1),
160-
)
161-
.layout(pipeline_layout)
162-
.push_next(&mut vk::PipelineRenderingCreateInfo::default().color_attachment_formats(&[self.color_out_format]))
163-
], None).map_err(|(_, e)| e)
164-
.context("Unable to create graphics pipeline")?;
94+
self
95+
.device
96+
.create_graphics_pipelines(vk::PipelineCache::null(), &[vk::GraphicsPipelineCreateInfo::default()
97+
.stages(
98+
&[
99+
vk::PipelineShaderStageCreateInfo {
100+
module: shader_module,
101+
p_name: c"main_vs".as_ptr(),
102+
stage: vk::ShaderStageFlags::VERTEX,
103+
..Default::default()
104+
},
105+
vk::PipelineShaderStageCreateInfo {
106+
module: shader_module,
107+
p_name: c"main_fs".as_ptr(),
108+
stage: vk::ShaderStageFlags::FRAGMENT,
109+
// NOTE(eddyb) this acts like an integration test for specialization constants.
110+
p_specialization_info: &vk::SpecializationInfo::default()
111+
.map_entries(&[vk::SpecializationMapEntry::default()
112+
.constant_id(0x5007)
113+
.offset(0)
114+
.size(4)])
115+
.data(&u32::to_le_bytes(
116+
self.sky_fs_spec_id_0x5007_sun_intensity_extra_spec_const_factor,
117+
)),
118+
..Default::default()
119+
},
120+
],
121+
)
122+
.vertex_input_state(&vk::PipelineVertexInputStateCreateInfo::default())
123+
.input_assembly_state(&vk::PipelineInputAssemblyStateCreateInfo {
124+
topology: vk::PrimitiveTopology::TRIANGLE_LIST,
125+
..Default::default()
126+
})
127+
.rasterization_state(&vk::PipelineRasterizationStateCreateInfo {
128+
front_face: vk::FrontFace::COUNTER_CLOCKWISE,
129+
line_width: 1.0,
130+
..Default::default()
131+
})
132+
.multisample_state(&vk::PipelineMultisampleStateCreateInfo {
133+
rasterization_samples: vk::SampleCountFlags::TYPE_1,
134+
..Default::default()
135+
})
136+
.depth_stencil_state(&vk::PipelineDepthStencilStateCreateInfo::default())
137+
.color_blend_state(
138+
&vk::PipelineColorBlendStateCreateInfo::default()
139+
.attachments(
140+
&[vk::PipelineColorBlendAttachmentState {
141+
blend_enable: 0,
142+
src_color_blend_factor: vk::BlendFactor::SRC_COLOR,
143+
dst_color_blend_factor: vk::BlendFactor::ONE_MINUS_DST_COLOR,
144+
color_blend_op: vk::BlendOp::ADD,
145+
src_alpha_blend_factor: vk::BlendFactor::ZERO,
146+
dst_alpha_blend_factor: vk::BlendFactor::ZERO,
147+
alpha_blend_op: vk::BlendOp::ADD,
148+
color_write_mask: vk::ColorComponentFlags::RGBA,
149+
}],
150+
),
151+
)
152+
.dynamic_state(
153+
&vk::PipelineDynamicStateCreateInfo::default()
154+
.dynamic_states(&[vk::DynamicState::VIEWPORT, vk::DynamicState::SCISSOR]),
155+
)
156+
.viewport_state(
157+
&vk::PipelineViewportStateCreateInfo::default()
158+
.scissor_count(1)
159+
.viewport_count(1),
160+
)
161+
.layout(pipeline_layout)
162+
.push_next(&mut vk::PipelineRenderingCreateInfo::default().color_attachment_formats(&[self.color_out_format]))
163+
], None).map_err(|(_, e)| e)
164+
.context("Unable to create graphics pipeline")?;
165165

166166
// A single `pipeline_info` results in a single pipeline.
167167
assert_eq!(pipelines.len(), 1);

tests/difftests/tests/lang/abi/vector_layout/cpu/src/layout.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ pub trait WriteLayout {
2020

2121
macro_rules! write_layout {
2222
($out:ident, $offset:ident, $name:ident($($member:ident),*)) => {
23-
{
24-
// offset 0: size
25-
$out[$offset.inc()] = size_of::<$name>() as u32;
26-
// offset 4: alignment
27-
$out[$offset.inc()] = align_of::<$name>() as u32;
28-
// offset 8 onwards: members
29-
$($out[$offset.inc()] = offset_of!($name, $member) as u32;)*
30-
}
31-
};
23+
{
24+
// offset 0: size
25+
$out[$offset.inc()] = size_of::<$name>() as u32;
26+
// offset 4: alignment
27+
$out[$offset.inc()] = align_of::<$name>() as u32;
28+
// offset 8 onwards: members
29+
$($out[$offset.inc()] = offset_of!($name, $member) as u32;)*
30+
}
31+
};
3232
}
3333

3434
/// gid is checked within this range. Note this is a range, so it **must be +1 from the max entry you use**.

0 commit comments

Comments
 (0)