Update WGSL in tests with renamed builtins

These builtins have been renamed:
* frag_coord -> position
* sample_mask_in -> sample_mask
* sample_mask_out -> sample_mask

Change-Id: Ic40dc9f4e509587b7ac82e43abbf9eec68225d9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48300
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
James Price 2021-04-19 15:29:49 +00:00 committed by Commit Bot service account
parent 7f5a472258
commit eae70b75ae
13 changed files with 18 additions and 18 deletions

View File

@ -105,7 +105,7 @@ void init() {
[[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>)
[[stage(fragment)]] fn main([[builtin(position)]] FragCoord : vec4<f32>)
-> [[location(0)]] vec4<f32> {
return textureSample(myTexture, mySampler, FragCoord.xy / vec2<f32>(640.0, 480.0));
})");

View File

@ -256,7 +256,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
[[group(0), binding(2)]] var tex : texture_2d<f32>;
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
return textureSample(tex, samp, FragCoord.xy);
})");

View File

@ -44,7 +44,7 @@ class CullingTest : public DawnTest {
// will make the pixel's R and G channels exactly equal to the pixel's x and y coordinates.
pipelineDescriptor.cFragment.module = utils::CreateShaderModule(device, R"(
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
return vec4<f32>(
(FragCoord.xy - vec2<f32>(0.5, 0.5)) / vec2<f32>(255.0, 255.0),
0.0, 1.0);

View File

@ -256,7 +256,7 @@ class DepthStencilCopyTests : public DawnTest {
};
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> FragmentOut {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> FragmentOut {
var output : FragmentOut;
output.result = 1u;
output.fragDepth = textureLoad(texture0, vec2<i32>(FragCoord.xy), 0)[0];

View File

@ -784,7 +784,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DTextureWithSampleMaskAndShaderOut
struct FragmentOut {
[[location(0)]] color : vec4<f32>;
[[builtin(sample_mask_out)]] sampleMask : u32;
[[builtin(sample_mask)]] sampleMask : u32;
};
[[stage(fragment)]] fn main() -> FragmentOut {
@ -847,7 +847,7 @@ TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithShaderOut
struct FragmentOut {
[[location(0)]] color0 : vec4<f32>;
[[location(1)]] color1 : vec4<f32>;
[[builtin(sample_mask_out)]] sampleMask : u32;
[[builtin(sample_mask)]] sampleMask : u32;
};
[[stage(fragment)]] fn main() -> FragmentOut {

View File

@ -68,7 +68,7 @@ class SamplerFilterAnisotropicTest : public DawnTest {
struct FragmentIn {
[[location(0)]] uv: vec2<f32>;
[[builtin(frag_coord)]] fragCoord : vec4<f32>;
[[builtin(position)]] fragCoord : vec4<f32>;
};
[[stage(fragment)]]

View File

@ -72,7 +72,7 @@ class SamplerTest : public DawnTest {
[[group(0), binding(1)]] var texture0 : texture_2d<f32>;
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
return textureSample(texture0, sampler0, FragCoord.xy / vec2<f32>(2.0, 2.0));
})");

View File

@ -111,7 +111,7 @@ fn main([[builtin(vertex_index)]] VertexIndex : u32) -> [[builtin(position)]] ve
std::string fragmentShader = R"(
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] fragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
fn main([[builtin(position)]] fragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
return vec4<f32>(fragCoord.xy, 0.0, 1.0);
})";
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fragmentShader.c_str());
@ -191,7 +191,7 @@ fn main(input : VertexIn) -> VertexOut {
std::string fragmentShader = R"(
struct FragmentIn {
[[location(0)]] color : vec4<f32>;
[[builtin(frag_coord)]] fragCoord : vec4<f32>;
[[builtin(position)]] fragCoord : vec4<f32>;
};
[[stage(fragment)]]
@ -238,7 +238,7 @@ fn main(input : VertexIn) -> VertexOut {
std::string fragmentShader = R"(
struct FragmentIn {
[[location(0)]] color : vec4<f32>;
[[builtin(frag_coord)]] fragCoord : vec4<f32>;
[[builtin(position)]] fragCoord : vec4<f32>;
};
[[stage(fragment)]]

View File

@ -162,7 +162,7 @@ class TextureFormatTest : public DawnTest {
fsSource << " [[location(0)]] color : vec4<" << type << ">;\n";
fsSource << R"(};
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> FragmentOut {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> FragmentOut {
var output : FragmentOut;
output.color = textureLoad(myTexture, vec2<i32>(FragCoord.xy), 0);
return output;

View File

@ -105,7 +105,7 @@ class TextureSubresourceTest : public DawnTest {
[[group(0), binding(1)]] var tex : texture_2d<f32>;
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> [[location(0)]] vec4<f32> {
return textureSample(tex, samp, FragCoord.xy / vec2<f32>(4.0, 4.0));
})");

View File

@ -106,7 +106,7 @@ class TextureZeroInitTest : public DawnTest {
[[location(0)]] color : vec4<f32>;
};
[[stage(fragment)]]
fn main([[builtin(frag_coord)]] FragCoord : vec4<f32>) -> FragmentOut {
fn main([[builtin(position)]] FragCoord : vec4<f32>) -> FragmentOut {
var output : FragmentOut;
output.color = textureLoad(texture0, vec2<i32>(FragCoord.xy), 0);
return output;

View File

@ -139,7 +139,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main(
[[builtin(frag_coord)]] FragCoord : vec4<f32>
[[builtin(position)]] FragCoord : vec4<f32>
) -> [[location(0)]] vec4<f32> {
return textureLoad(image0, vec2<i32>(FragCoord.xy));
})");
@ -170,8 +170,8 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
{
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main([[builtin(frag_coord)]] frag_coord : vec4<f32>) {
textureStore(image0, vec2<i32>(frag_coord.xy), vec4<f32>(1.0, 0.0, 0.0, 1.0));
[[stage(fragment)]] fn main([[builtin(position)]] position : vec4<f32>) {
textureStore(image0, vec2<i32>(position.xy), vec4<f32>(1.0, 0.0, 0.0, 1.0));
})");
utils::ComboRenderPipelineDescriptor2 descriptor;

View File

@ -804,7 +804,7 @@ TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) {
[[group(0), binding(3)]] var<uniform> buffer0 : U;
[[stage(fragment)]] fn main(
[[builtin(frag_coord)]] FragCoord : vec4<f32>
[[builtin(position)]] FragCoord : vec4<f32>
) -> [[location(0)]] vec4<f32> {
return textureSample(texture0, sampler0, FragCoord.xy) + buffer0.color;
})");