mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 00:47:13 +00:00
Remove [[block]] attribute from all shaders
This has been removed from WGSL and is now deprecated in Tint. Bug: tint:1324 Change-Id: Ic187ce3c5ce0723db6f3ca6483e9f5e73ce27acc Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/72880 Auto-Submit: James Price <jrprice@google.com> Reviewed-by: Corentin Wallez <cwallez@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
16ae3b8b95
commit
d4f8c39f52
@@ -1419,7 +1419,7 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
|
||||
@@ -1443,7 +1443,7 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
|
||||
wgpu::ComputePipeline CreateComputePipeline() {
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
|
||||
@@ -1871,7 +1871,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
|
||||
device.CreatePipelineLayout(&pipelineLayoutDescriptor);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << "[[block]] struct S { value : vec2<f32>; };";
|
||||
ss << "struct S { value : vec2<f32>; };";
|
||||
|
||||
// Build a shader which has bindings that match the pipeline layout.
|
||||
for (uint32_t l = 0; l < layouts.size(); ++l) {
|
||||
@@ -2051,7 +2051,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
|
||||
wgpu::RenderPipeline CreateRenderPipeline(std::vector<wgpu::BindGroupLayout> bindGroupLayouts) {
|
||||
return CreateFSRenderPipeline(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
|
||||
@@ -2086,7 +2086,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
wgpu::ComputePipeline CreateComputePipeline(
|
||||
std::vector<wgpu::BindGroupLayout> bindGroupLayouts) {
|
||||
return CreateComputePipeline(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniform0 : S;
|
||||
@@ -59,12 +59,12 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S2 {
|
||||
struct S2 {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(2), binding(0)]] var<uniform> uniform2 : S2;
|
||||
|
||||
[[block]] struct S3 {
|
||||
struct S3 {
|
||||
pos : mat4x4<f32>;
|
||||
};
|
||||
[[group(3), binding(0)]] var<storage, read_write> storage3 : S3;
|
||||
@@ -98,7 +98,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
|
||||
// Test that default BindGroupLayouts cannot be used in the creation of a new PipelineLayout
|
||||
TEST_F(GetBindGroupLayoutTests, DefaultBindGroupLayoutPipelineCompatibility) {
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -120,7 +120,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) {
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -290,7 +290,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -343,7 +343,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
binding.visibility = wgpu::ShaderStage::Fragment;
|
||||
binding.buffer.type = wgpu::BufferBindingType::Storage;
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> ssbo : S;
|
||||
@@ -357,7 +357,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
{
|
||||
binding.buffer.type = wgpu::BufferBindingType::Uniform;
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -372,7 +372,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
|
||||
{
|
||||
binding.buffer.type = wgpu::BufferBindingType::ReadOnlyStorage;
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read> ssbo : S;
|
||||
@@ -612,7 +612,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
|
||||
{
|
||||
binding.binding = 0;
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -627,7 +627,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
|
||||
{
|
||||
binding.binding = 1;
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(1)]] var<uniform> uniforms : S;
|
||||
@@ -642,7 +642,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
|
||||
{
|
||||
binding.binding = 2;
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(1)]] var<uniform> uniforms : S;
|
||||
@@ -658,7 +658,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
|
||||
// Test it is valid to have duplicate bindings in the shaders.
|
||||
TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniform0 : S;
|
||||
@@ -671,7 +671,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(1), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -697,7 +697,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule vsModule4 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : f32;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -708,7 +708,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule vsModule64 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : mat4x4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -719,7 +719,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule4 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : f32;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -729,7 +729,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule64 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : mat4x4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -864,7 +864,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) {
|
||||
// Test it is invalid to have conflicting binding types in the shaders.
|
||||
TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> ubo : S;
|
||||
@@ -875,7 +875,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> ssbo : S;
|
||||
@@ -988,7 +988,7 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) {
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms0 : S;
|
||||
@@ -1041,7 +1041,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
|
||||
wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&pipelineLayoutDesc);
|
||||
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -1082,7 +1082,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
|
||||
// Test that fragment output validation is for the correct entryPoint
|
||||
TEST_F(GetBindGroupLayoutTests, FromCorrectEntryPoint) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Data {
|
||||
struct Data {
|
||||
data : f32;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> data0 : Data;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace {
|
||||
std::ostringstream ostream;
|
||||
size_t index = 0;
|
||||
for (const BindingDescriptor& b : bindings) {
|
||||
ostream << "[[block]] struct S" << index << " { " << b.decl << "};\n";
|
||||
ostream << "struct S" << index << " { " << b.decl << "};\n";
|
||||
ostream << "[[group(" << b.group << "), binding(" << b.binding << ")]] ";
|
||||
switch (b.type) {
|
||||
case wgpu::BufferBindingType::Uniform:
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
struct S {
|
||||
transform : mat2x2<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> uniforms : S;
|
||||
@@ -38,12 +38,12 @@ namespace {
|
||||
})");
|
||||
|
||||
fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Uniforms {
|
||||
struct Uniforms {
|
||||
color : vec4<f32>;
|
||||
};
|
||||
[[group(1), binding(0)]] var<uniform> uniforms : Uniforms;
|
||||
|
||||
[[block]] struct Storage {
|
||||
struct Storage {
|
||||
dummy : array<f32>;
|
||||
};
|
||||
[[group(1), binding(1)]] var<storage, read_write> ssbo : Storage;
|
||||
|
||||
@@ -765,7 +765,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
|
||||
// cause crash.
|
||||
TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
|
||||
wgpu::ShaderModule vsModuleWithStorageBuffer = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Dst {
|
||||
struct Dst {
|
||||
data : array<u32, 100>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read_write> dst : Dst;
|
||||
@@ -1124,7 +1124,7 @@ TEST_F(RenderPipelineValidationTest, UnwrittenFragmentOutputsMask0) {
|
||||
// Test that fragment output validation is for the correct entryPoint
|
||||
TEST_F(RenderPipelineValidationTest, BindingsFromCorrectEntryPoint) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Uniforms {
|
||||
struct Uniforms {
|
||||
data : vec4<f32>;
|
||||
};
|
||||
[[group(0), binding(0)]] var<uniform> var0 : Uniforms;
|
||||
|
||||
@@ -761,7 +761,7 @@ namespace {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct RBuffer {
|
||||
struct RBuffer {
|
||||
value : f32;
|
||||
};
|
||||
[[group(0), binding(0)]] var<storage, read> rBuffer : RBuffer;
|
||||
|
||||
@@ -503,7 +503,7 @@ TEST_F(ShaderModuleValidationTest, OverridableConstantsNumericIDConflicts) {
|
||||
[[override(1234)]] let c0: u32;
|
||||
[[override(1234)]] let c1: u32;
|
||||
|
||||
[[block]] struct Buf {
|
||||
struct Buf {
|
||||
data : array<u32, 2>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user