Remove deprecated WGSL "-> void"

Bug: dawn:755
Change-Id: I10f2fb3afd26560df10b21d149a65b625bdb2b4b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47600
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2021-04-13 09:48:24 +00:00
committed by Commit Bot service account
parent 71f3d58939
commit 21bd02becf
85 changed files with 381 additions and 386 deletions

View File

@@ -1084,7 +1084,7 @@ class SetBindGroupValidationTest : public ValidationTest {
wgpu::RenderPipeline CreateRenderPipeline() {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@@ -1097,7 +1097,7 @@ class SetBindGroupValidationTest : public ValidationTest {
[[group(0), binding(2)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
[[group(0), binding(3)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
@@ -1120,7 +1120,7 @@ class SetBindGroupValidationTest : public ValidationTest {
[[group(0), binding(2)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
[[group(0), binding(3)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
[[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void {
[[stage(compute), workgroup_size(4, 4, 1)]] fn main() {
})");
wgpu::PipelineLayout pipelineLayout =
@@ -1487,7 +1487,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
ValidationTest::SetUp();
mVsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
}
@@ -1555,7 +1555,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
}
}
ss << "[[stage(fragment)]] fn main() -> void {}";
ss << "[[stage(fragment)]] fn main() {}";
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, ss.str().c_str());
@@ -1689,7 +1689,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
const char* fsShader,
std::vector<wgpu::BindGroupLayout> bindGroupLayout) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fsShader);
@@ -1714,7 +1714,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
[[group(0), binding(0)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
[[group(1), binding(0)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})",
std::move(bindGroupLayouts));
}
@@ -1747,7 +1747,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
[[group(0), binding(0)]] var<storage> sBufferDynamic : [[access(read_write)]] S;
[[group(1), binding(0)]] var<storage> sReadonlyBufferDynamic : [[access(read)]] S;
[[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void {
[[stage(compute), workgroup_size(4, 4, 1)]] fn main() {
})",
std::move(bindGroupLayouts));
}
@@ -1788,11 +1788,11 @@ TEST_F(BindGroupLayoutCompatibilityTest, ROStorageInBGLWithRWStorageInShader) {
TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) {
constexpr char kTexture2DShaderFS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})";
constexpr char kTexture2DShaderCS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})";
// Render: Test that 2D texture with 2D view dimension works
@@ -1825,11 +1825,11 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) {
constexpr char kTexture2DArrayShaderFS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})";
constexpr char kTexture2DArrayShaderCS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})";
// Render: Test that 2D texture array with 2D array view dimension works
@@ -2053,7 +2053,7 @@ class ComparisonSamplerBindingTest : public ValidationTest {
wgpu::RenderPipeline CreateFragmentPipeline(wgpu::BindGroupLayout* bindGroupLayout,
const char* fragmentSource) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fragmentSource);
@@ -2078,7 +2078,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) {
CreateFragmentPipeline(&bindGroupLayout, R"(
[[group(0), binding(0)]] var mySampler: sampler;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
}
@@ -2089,7 +2089,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) {
CreateFragmentPipeline(&bindGroupLayout, R"(
[[group(0), binding(0)]] var mySampler: sampler_comparison;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
}
@@ -2100,7 +2100,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) {
ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"(
[[group(0), binding(0)]] var mySampler: sampler_comparison;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})"));
}
@@ -2111,7 +2111,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) {
ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"(
[[group(0), binding(0)]] var mySampler: sampler;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})"));
}
}

View File

@@ -23,7 +23,7 @@ class ComputeIndirectValidationTest : public ValidationTest {
ValidationTest::SetUp();
wgpu::ShaderModule computeModule = utils::CreateShaderModule(device, R"(
[[stage(compute), workgroup_size(1)]] fn main() -> void {
[[stage(compute), workgroup_size(1)]] fn main() {
})");
// Set up compute pipeline

View File

@@ -25,13 +25,13 @@ class DrawIndirectValidationTest : public ValidationTest {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 0.0, 0.0, 0.0);
})");

View File

@@ -21,7 +21,7 @@ class GetBindGroupLayoutTests : public ValidationTest {
protected:
wgpu::RenderPipeline RenderPipelineFromFragmentShader(const char* shader) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, shader);
@@ -50,7 +50,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
[[group(0), binding(0)]] var<uniform> uniform0 : S;
[[group(1), binding(0)]] var<uniform> uniform1 : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@@ -64,7 +64,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
};
[[group(3), binding(0)]] var<storage> storage3 : [[access(read_write)]] S3;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 descriptor;
@@ -102,7 +102,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
wgpu::BindGroupLayoutEntry binding = {};
@@ -145,7 +145,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})");
wgpu::ComputePipelineDescriptor descriptor;
@@ -196,7 +196,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
};
[[group(0), binding(0)]] var<storage> ssbo : [[access(read_write)]] S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -208,7 +208,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -221,7 +221,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
};
[[group(0), binding(0)]] var<storage> ssbo : [[access(read)]] S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -233,7 +233,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -243,7 +243,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -254,7 +254,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var mySampler: sampler;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -281,7 +281,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_1d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -291,7 +291,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -301,7 +301,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -311,7 +311,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_3d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -321,7 +321,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_cube<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -331,7 +331,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_cube_array<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -357,7 +357,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -367,7 +367,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -377,7 +377,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
[[group(0), binding(0)]] var myTexture : texture_2d<u32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -408,7 +408,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -421,7 +421,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
};
[[group(0), binding(1)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -434,7 +434,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
};
[[group(0), binding(1)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
EXPECT_NE(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@@ -449,7 +449,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
[[group(0), binding(0)]] var<uniform> uniform0 : S;
[[group(1), binding(0)]] var<uniform> uniform1 : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@@ -458,7 +458,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
};
[[group(1), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 descriptor;
@@ -482,7 +482,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule vsModule64 = utils::CreateShaderModule(device, R"(
@@ -491,7 +491,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule4 = utils::CreateShaderModule(device, R"(
@@ -500,7 +500,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
wgpu::ShaderModule fsModule64 = utils::CreateShaderModule(device, R"(
@@ -509,7 +509,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
// Create BGLs with minBufferBindingSize 4 and 64.
@@ -563,21 +563,21 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) {
DAWN_SKIP_TEST_IF(UsesWire());
wgpu::ShaderModule vsModuleNoSampler = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule vsModuleSampler = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var mySampler: sampler;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModuleNoSampler = utils::CreateShaderModule(device, R"(
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
wgpu::ShaderModule fsModuleSampler = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var mySampler: sampler;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
// Create BGLs with minBufferBindingSize 4 and 64.
@@ -631,7 +631,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
};
[[group(0), binding(0)]] var<uniform> ubo : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@@ -640,7 +640,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
};
[[group(0), binding(0)]] var<storage> ssbo : [[access(read_write)]] S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 descriptor;
@@ -656,13 +656,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 descriptor;
@@ -678,13 +678,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var myTexture : texture_3d<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 descriptor;
@@ -700,13 +700,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 descriptor;
@@ -720,12 +720,12 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
// Test it is an error to query an out of range bind group layout.
TEST_F(GetBindGroupLayoutTests, OutOfRangeIndex) {
ASSERT_DEVICE_ERROR(RenderPipelineFromFragmentShader(R"(
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})")
.GetBindGroupLayout(kMaxBindGroups));
ASSERT_DEVICE_ERROR(RenderPipelineFromFragmentShader(R"(
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})")
.GetBindGroupLayout(kMaxBindGroups + 1));
}
@@ -744,7 +744,7 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) {
[[group(0), binding(0)]] var<uniform> uniforms0 : S;
[[group(2), binding(0)]] var<uniform> uniforms2 : S;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
wgpu::BindGroupLayoutDescriptor desc = {};
@@ -790,11 +790,11 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 pipelineDesc;
@@ -830,11 +830,11 @@ TEST_F(GetBindGroupLayoutTests, DISABLED_FromCorrectEntryPoint) {
[[binding 0, set 0]] var<storage> data0 : [[access(read_write)]] Data;
[[binding 1, set 0]] var<storage> data1 : [[access(read_write)]] Data;
fn compute0() -> void {
fn compute0() {
data0.data = 0.0;
return;
}
fn compute1() -> void {
fn compute1() {
data1.data = 0.0;
return;
}

View File

@@ -24,13 +24,13 @@ class IndexBufferValidationTest : public ValidationTest {
wgpu::PrimitiveTopology primitiveTopology) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})");

View File

@@ -99,19 +99,17 @@ namespace {
// Creates a compute shader with given bindings
std::string CreateComputeShaderWithBindings(const std::vector<BindingDescriptor>& bindings) {
return kStructs + GenerateBindingString(bindings) +
"[[stage(compute), workgroup_size(1,1,1)]] fn main() -> void {}";
"[[stage(compute), workgroup_size(1,1,1)]] fn main() {}";
}
// Creates a vertex shader with given bindings
std::string CreateVertexShaderWithBindings(const std::vector<BindingDescriptor>& bindings) {
return kStructs + GenerateBindingString(bindings) +
"[[stage(vertex)]] fn main() -> void {}";
return kStructs + GenerateBindingString(bindings) + "[[stage(vertex)]] fn main() {}";
}
// Creates a fragment shader with given bindings
std::string CreateFragmentShaderWithBindings(const std::vector<BindingDescriptor>& bindings) {
return kStructs + GenerateBindingString(bindings) +
"[[stage(fragment)]] fn main() -> void {}";
return kStructs + GenerateBindingString(bindings) + "[[stage(fragment)]] fn main() {}";
}
// Concatenates vectors containing BindingDescriptor

View File

@@ -33,7 +33,7 @@ TEST_F(MultipleDeviceTest, ValidatesSameDevice) {
TEST_F(MultipleDeviceTest, ValidatesSameDeviceCreatePipelineAsync) {
wgpu::ShaderModuleWGSLDescriptor wgslDesc = {};
wgslDesc.source = R"(
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
}
)";

View File

@@ -176,13 +176,13 @@ namespace {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})");
@@ -213,7 +213,7 @@ namespace {
wgpu::ComputePipelineDescriptor descriptor;
descriptor.computeStage.module = utils::CreateShaderModule(device, R"(
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})");
descriptor.computeStage.entryPoint = "main";
device.CreateComputePipelineAsync(&descriptor, callback, &callbackData);

View File

@@ -35,7 +35,7 @@ namespace {
};
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
fsModule = utils::CreateShaderModule(device, R"(
@@ -49,7 +49,7 @@ namespace {
};
[[group(1), binding(1)]] var<storage> ssbo : [[access(read_write)]] Storage;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
wgpu::BindGroupLayout bgls[] = {

View File

@@ -28,13 +28,13 @@ class RenderPipelineValidationTest : public ValidationTest {
vsModule = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
})");
fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})");
}
@@ -193,7 +193,7 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputFormatCompatibility) {
stream << R"(
[[location(0)]] var<out> fragColor : vec4<)"
<< kScalarTypes[i] << R"(>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
@@ -411,7 +411,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
[[group(0), binding(0)]] var myTexture : texture_2d<)"
<< kScalarTypes[i] << R"(>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
@@ -458,7 +458,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
stream << R"(
[[group(0), binding(0)]] var myTexture : )"
<< kTextureKeywords[i] << R"(<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
@@ -485,7 +485,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
};
[[group(0), binding(0)]] var<storage> dst : [[access(read_write)]] Dst;
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
dst.data[VertexIndex] = 0x1234u;
})");
@@ -592,13 +592,13 @@ TEST_F(RenderPipelineValidationTest, DepthCompareUndefinedIsError) {
TEST_F(RenderPipelineValidationTest, EntryPointNameValidation) {
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> position : vec4<f32>;
[[stage(vertex)]] fn vertex_main() -> void {
[[stage(vertex)]] fn vertex_main() {
position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
return;
}
[[location(0)]] var<out> color : vec4<f32>;
[[stage(fragment)]] fn fragment_main() -> void {
[[stage(fragment)]] fn fragment_main() {
color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
return;
}
@@ -645,11 +645,11 @@ TEST_F(RenderPipelineValidationTest, VertexAttribCorrectEntryPoint) {
[[location(0)]] var<in> attrib0 : vec4<f32>;
[[location(1)]] var<in> attrib1 : vec4<f32>;
[[stage(vertex)]] fn vertex0() -> void {
[[stage(vertex)]] fn vertex0() {
position = attrib0;
return;
}
[[stage(vertex)]] fn vertex1() -> void {
[[stage(vertex)]] fn vertex1() {
position = attrib1;
return;
}
@@ -690,11 +690,11 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputCorrectEntryPoint) {
[[location(0)]] var<out> colorFloat : vec4<f32>;
[[location(0)]] var<out> colorUint : vec4<u32>;
[[stage(fragment)]] fn fragmentFloat() -> void {
[[stage(fragment)]] fn fragmentFloat() {
colorFloat = vec4<f32>(0.0, 0.0, 0.0, 0.0);
return;
}
[[stage(fragment)]] fn fragmentUint() -> void {
[[stage(fragment)]] fn fragmentUint() {
colorUint = vec4<u32>(0u, 0u, 0u, 0u);
return;
}
@@ -734,11 +734,11 @@ TEST_F(RenderPipelineValidationTest, DISABLED_BindingsFromCorrectEntryPoint) {
[[binding 1, set 0]] var<uniform> var1 : Uniforms;
[[builtin(position)]] var<out> position : vec4<f32>;
fn vertex0() -> void {
fn vertex0() {
position = var0.data;
return;
}
fn vertex1() -> void {
fn vertex1() {
position = var1.data;
return;
}

View File

@@ -47,11 +47,11 @@ namespace {
// pipeline. But those bind groups in caller can be used for validation for other purposes.
wgpu::RenderPipeline CreateNoOpRenderPipeline() {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
pipelineDescriptor.vertex.module = vsModule;
@@ -62,7 +62,7 @@ namespace {
wgpu::ComputePipeline CreateNoOpComputePipeline() {
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})");
wgpu::ComputePipelineDescriptor pipelineDescriptor;
pipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, nullptr);
@@ -772,7 +772,7 @@ namespace {
// Create a passthrough render pipeline with a readonly buffer
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
@@ -780,7 +780,7 @@ namespace {
value : f32;
};
[[group(0), binding(0)]] var<storage> rBuffer : [[access(read)]] RBuffer;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
pipelineDescriptor.vertex.module = vsModule;
@@ -820,7 +820,7 @@ namespace {
value : f32;
};
[[group(0), binding(0)]] var<storage> rBuffer : [[access(read)]] RBuffer;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})");
wgpu::ComputePipelineDescriptor pipelineDescriptor;
pipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, &bgl0);
@@ -1550,12 +1550,12 @@ namespace {
{
// Create a passthrough render pipeline with a readonly storage texture
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})");
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
pipelineDescriptor.vertex.module = vsModule;
@@ -1581,7 +1581,7 @@ namespace {
// Create a passthrough compute pipeline with a readonly storage texture
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})");
wgpu::ComputePipelineDescriptor pipelineDescriptor;
pipelineDescriptor.layout = utils::MakeBasicPipelineLayout(device, &readBGL);

View File

@@ -61,7 +61,7 @@ TEST_F(ShaderModuleValidationTest, CreationSuccess) {
TEST_F(ShaderModuleValidationTest, FragmentOutputLocationExceedsMaxColorAttachments) {
std::ostringstream stream;
stream << "[[location(" << kMaxColorAttachments << R"()]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})";
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, stream.str().c_str()));
@@ -164,7 +164,7 @@ TEST_F(ShaderModuleValidationTest, CompilationMessages) {
std::ostringstream stream;
stream << R"([[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})";
wgpu::ShaderModule shaderModule = utils::CreateShaderModule(device, stream.str().c_str());

View File

@@ -25,12 +25,12 @@ class StorageTextureValidationTests : public ValidationTest {
mDefaultVSModule = utils::CreateShaderModule(device, R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
})");
mDefaultFSModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);
})");
}
@@ -88,7 +88,7 @@ class StorageTextureValidationTests : public ValidationTest {
<< "[[access(" << access << ")]] " << imageTypeDeclaration << "<"
<< imageFormatQualifier
<< ">;\n"
"[[stage(compute)]] fn main() -> void {\n"
"[[stage(compute)]] fn main() {\n"
"}\n";
return ostream.str();
@@ -124,7 +124,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
[[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(vertex_index)]] var<in> VertexIndex : u32;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = textureLoad(image0, vec2<i32>(i32(VertexIndex), 0));
})");
@@ -141,7 +141,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
[[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(frag_coord)]] var<in> FragCoord : vec4<f32>;
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = textureLoad(image0, vec2<i32>(FragCoord.xy));
})");
@@ -157,7 +157,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[builtin(vertex_index)]] var<in> vertex_index : u32;
[[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
textureStore(image0, vec2<i32>(i32(vertex_index), 0), vec4<f32>(1.0, 0.0, 0.0, 1.0));
})");
@@ -173,7 +173,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[builtin(frag_coord)]] var<in> frag_coord : vec4<f32>;
[[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
textureStore(image0, vec2<i32>(frag_coord.xy), vec4<f32>(1.0, 0.0, 0.0, 1.0));
})");
@@ -199,7 +199,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
};
[[group(0), binding(1)]] var<storage> buf : [[access(read_write)]] Buf;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
buf.data = textureLoad(image0, vec2<i32>(LocalInvocationID.xy)).x;
})");
@@ -217,7 +217,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
[[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
[[builtin(local_invocation_id)]] var<in> LocalInvocationID : vec3<u32>;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
textureStore(image0, vec2<i32>(LocalInvocationID.xy), vec4<f32>(0.0, 0.0, 0.0, 0.0));
})");
@@ -236,7 +236,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
{
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : [[access(read_write)]] texture_storage_2d<rgba8unorm>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
})"));
}
@@ -244,7 +244,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
{
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : [[access(read_write)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
})"));
}
@@ -252,7 +252,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
{
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : [[access(read_write)]] texture_storage_2d<rgba8unorm>;
[[stage(compute)]] fn main() -> void {
[[stage(compute)]] fn main() {
})"));
}
}

View File

@@ -65,10 +65,8 @@ TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) {
bundleDesc.cColorFormats[0] = renderPass.attachmentFormat;
utils::ComboRenderPipelineDescriptor2 desc;
desc.vertex.module =
utils::CreateShaderModule(device, "[[stage(vertex)]] fn main() -> void {}");
desc.cFragment.module =
utils::CreateShaderModule(device, "[[stage(fragment)]] fn main() -> void {}");
desc.vertex.module = utils::CreateShaderModule(device, "[[stage(vertex)]] fn main() {}");
desc.cFragment.module = utils::CreateShaderModule(device, "[[stage(fragment)]] fn main() {}");
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline2(&desc);
// Control cases: DrawIndirect and DrawIndexed are allowed inside a render pass.
@@ -134,7 +132,7 @@ TEST_F(UnsafeAPIValidationTest, DispatchIndirectDisallowed) {
wgpu::ComputePipelineDescriptor pipelineDesc;
pipelineDesc.computeStage.entryPoint = "main";
pipelineDesc.computeStage.module =
utils::CreateShaderModule(device, "[[stage(compute)]] fn main() -> void {}");
utils::CreateShaderModule(device, "[[stage(compute)]] fn main() {}");
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc);
// Control case: dispatch is allowed.

View File

@@ -27,7 +27,7 @@ class VertexBufferValidationTest : public ValidationTest {
fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
})");
}
@@ -46,7 +46,7 @@ class VertexBufferValidationTest : public ValidationTest {
vs << "[[location(" << i << ")]] var<in> a_position" << i << " : vec3<f32>;\n";
}
vs << "[[builtin(position)]] var<out> Position : vec4<f32>;";
vs << "[[stage(vertex)]] fn main() -> void {\n";
vs << "[[stage(vertex)]] fn main() {\n";
vs << "Position = vec4<f32>(";
for (unsigned int i = 0; i < bufferCount; ++i) {

View File

@@ -25,7 +25,7 @@ class VertexStateTest : public ValidationTest {
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, vertexSource);
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
[[stage(fragment)]] fn main() {
fragColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);
}
)");
@@ -46,7 +46,7 @@ class VertexStateTest : public ValidationTest {
const char* kDummyVertexShader = R"(
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
)";
@@ -102,7 +102,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) {
[[location(0)]] var<in> a : vec4<f32>;
[[location(1)]] var<in> b : vec4<f32>;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
)");
@@ -111,7 +111,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) {
CreatePipeline(true, state, R"(
[[location(0)]] var<in> a : vec4<f32>;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
)");
@@ -120,7 +120,7 @@ TEST_F(VertexStateTest, PipelineCompatibility) {
CreatePipeline(false, state, R"(
[[location(2)]] var<in> a : vec4<f32>;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
[[stage(vertex)]] fn main() {
Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
}
)");