From 3b1e8da1b10f3eb0c1b187578bce57baeeaa2b89 Mon Sep 17 00:00:00 2001 From: Erich Gubler Date: Fri, 17 May 2024 14:07:40 -0400 Subject: [PATCH] =?UTF-8?q?style:=20use=20`concat!(=E2=80=A6)`'d=20string?= =?UTF-8?q?=20for=20`DIFFERENT=5FBGL=5FORDER=5FBW=5FSHADER=5FAND=5FAPI`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/tests/device.rs | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/tests/device.rs b/tests/tests/device.rs index fcf64bd3c..e2ed9f5b6 100644 --- a/tests/tests/device.rs +++ b/tests/tests/device.rs @@ -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; -@group(0) @binding(2) var myTexture1: texture_2d; -@group(0) @binding(1) var mySampler: sampler; - -@fragment -fn fs_main(@builtin(position) pos: vec4) -> @location(0) vec4f { - return textureSample(myTexture1, mySampler, pos.xy) + textureSample(myTexture2, mySampler, pos.xy); -} - -@vertex -fn vs_main() -> @builtin(position) vec4 { - return vec4(0.0, 0.0, 0.0, 1.0); -} -"; + let trivial_shaders_with_some_reversed_bindings = concat!( + "@group(0) @binding(3) var myTexture2: texture_2d;\n", + "@group(0) @binding(2) var myTexture1: texture_2d;\n", + "@group(0) @binding(1) var mySampler: sampler;\n", + "\n", + "@fragment\n", + "fn fs_main(@builtin(position) pos: vec4) -> @location(0) vec4f {\n", + " return textureSample(myTexture1, mySampler, pos.xy) \n", + " + textureSample(myTexture2, mySampler, pos.xy);\n", + "}\n", + "\n", + "@vertex\n", + "fn vs_main() -> @builtin(position) vec4 {\n", + " return vec4(0.0, 0.0, 0.0, 1.0);\n", + "}\n", + ); let trivial_shaders_with_some_reversed_bindings = ctx.device @@ -852,7 +853,7 @@ fn vs_main() -> @builtin(position) vec4 { depth_stencil: None, multisample: wgt::MultisampleState::default(), multiview: None, - cache: None + cache: None, }); // fail(&ctx.device, || {