Skip to content

Commit

Permalink
style: use concat!(…)'d string for `DIFFERENT_BGL_ORDER_BW_SHADER_A…
Browse files Browse the repository at this point in the history
…ND_API`
  • Loading branch information
ErichDonGubler committed May 17, 2024
1 parent 211c313 commit 99a2a6e
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions tests/tests/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,21 +770,22 @@ static DIFFERENT_BGL_ORDER_BW_SHADER_AND_API: GpuTestConfiguration = GpuTestConf
// resource type) in the wrong list of a different resource type. Let's reproduce that
// here.

let trivial_shaders_with_some_reversed_bindings = "\
@group(0) @binding(3) var myTexture2: texture_2d<f32>;
@group(0) @binding(2) var myTexture1: texture_2d<f32>;
@group(0) @binding(1) var mySampler: sampler;
@fragment
fn fs_main(@builtin(position) pos: vec4<f32>) -> @location(0) vec4f {
return textureSample(myTexture1, mySampler, pos.xy) + textureSample(myTexture2, mySampler, pos.xy);
}
@vertex
fn vs_main() -> @builtin(position) vec4<f32> {
return vec4<f32>(0.0, 0.0, 0.0, 1.0);
}
";
let trivial_shaders_with_some_reversed_bindings = concat!(
"@group(0) @binding(3) var myTexture2: texture_2d<f32>;\n",
"@group(0) @binding(2) var myTexture1: texture_2d<f32>;\n",
"@group(0) @binding(1) var mySampler: sampler;",
"",
"@fragment",
"fn fs_main(@builtin(position) pos: vec4<f32>) -> @location(0) vec4f {",
" return textureSample(myTexture1, mySampler, pos.xy) ",
"+ textureSample(myTexture2, mySampler, pos.xy);",
"}",
"",
"@vertex",
"fn vs_main() -> @builtin(position) vec4<f32> {",
" return vec4<f32>(0.0, 0.0, 0.0, 1.0);",
"}",
);

let trivial_shaders_with_some_reversed_bindings =
ctx.device
Expand Down Expand Up @@ -852,7 +853,7 @@ fn vs_main() -> @builtin(position) vec4<f32> {
depth_stencil: None,
multisample: wgt::MultisampleState::default(),
multiview: None,
cache: None
cache: None,
});

// fail(&ctx.device, || {
Expand Down

0 comments on commit 99a2a6e

Please sign in to comment.