mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-20 10:25:28 +00:00
Remove utility to create shader modules from GLSL
And rename CreateShaderModuleFromWGSL to CreateShaderModule. Bug: dawn:572 Change-Id: I80dab401078b2001d738b87d6e24437f93b690d1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45764 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org> Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
1452cf60e5
commit
7aec4ae7c5
@@ -1083,11 +1083,11 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
wgpu::BindGroupLayout mBindGroupLayout;
|
||||
|
||||
wgpu::RenderPipeline CreateRenderPipeline() {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
@@ -1110,7 +1110,7 @@ class SetBindGroupValidationTest : public ValidationTest {
|
||||
}
|
||||
|
||||
wgpu::ComputePipeline CreateComputePipeline() {
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
value : vec2<f32>;
|
||||
};
|
||||
@@ -1486,7 +1486,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
mVsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
mVsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
}
|
||||
@@ -1557,7 +1557,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest {
|
||||
|
||||
ss << "[[stage(fragment)]] fn main() -> void {}";
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, ss.str().c_str());
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, ss.str().c_str());
|
||||
|
||||
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
|
||||
pipelineDescriptor.vertex.module = mVsModule;
|
||||
@@ -1688,11 +1688,11 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
wgpu::RenderPipeline CreateFSRenderPipeline(
|
||||
const char* fsShader,
|
||||
std::vector<wgpu::BindGroupLayout> bindGroupLayout) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, fsShader);
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fsShader);
|
||||
|
||||
wgpu::PipelineLayoutDescriptor descriptor;
|
||||
descriptor.bindGroupLayoutCount = bindGroupLayout.size();
|
||||
@@ -1722,7 +1722,7 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
|
||||
wgpu::ComputePipeline CreateComputePipeline(
|
||||
const char* shader,
|
||||
std::vector<wgpu::BindGroupLayout> bindGroupLayout) {
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, shader);
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, shader);
|
||||
|
||||
wgpu::PipelineLayoutDescriptor descriptor;
|
||||
descriptor.bindGroupLayoutCount = bindGroupLayout.size();
|
||||
@@ -2052,11 +2052,11 @@ class ComparisonSamplerBindingTest : public ValidationTest {
|
||||
protected:
|
||||
wgpu::RenderPipeline CreateFragmentPipeline(wgpu::BindGroupLayout* bindGroupLayout,
|
||||
const char* fragmentSource) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, fragmentSource);
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fragmentSource);
|
||||
|
||||
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
|
||||
pipelineDescriptor.vertex.module = vsModule;
|
||||
|
||||
@@ -22,7 +22,7 @@ class ComputeIndirectValidationTest : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
wgpu::ShaderModule computeModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule computeModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(compute), workgroup_size(1)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
|
||||
@@ -23,13 +23,13 @@ class DrawIndirectValidationTest : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
Position = vec4<f32>(0.0, 0.0, 0.0, 0.0);
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> fragColor : vec4<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
fragColor = vec4<f32>(0.0, 0.0, 0.0, 0.0);
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
class GetBindGroupLayoutTests : public ValidationTest {
|
||||
protected:
|
||||
wgpu::RenderPipeline RenderPipelineFromFragmentShader(const char* shader) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, shader);
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, shader);
|
||||
|
||||
utils::ComboRenderPipelineDescriptor2 descriptor;
|
||||
descriptor.layout = nullptr;
|
||||
@@ -43,7 +43,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
|
||||
// Native.
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -53,7 +53,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S2 {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -139,7 +139,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
|
||||
// Native.
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -442,7 +442,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
|
||||
|
||||
// Test it is valid to have duplicate bindings in the shaders.
|
||||
TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -452,7 +452,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -476,7 +476,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
// Native.
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule vsModule4 = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule4 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : f32;
|
||||
};
|
||||
@@ -485,7 +485,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule vsModule64 = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule64 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : mat4x4<f32>;
|
||||
};
|
||||
@@ -494,7 +494,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule4 = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule4 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : f32;
|
||||
};
|
||||
@@ -503,7 +503,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule64 = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule64 = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : mat4x4<f32>;
|
||||
};
|
||||
@@ -562,20 +562,20 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) {
|
||||
// Native.
|
||||
DAWN_SKIP_TEST_IF(UsesWire());
|
||||
|
||||
wgpu::ShaderModule vsModuleNoSampler = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModuleNoSampler = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule vsModuleSampler = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModuleSampler = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var mySampler: sampler;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModuleNoSampler = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModuleNoSampler = utils::CreateShaderModule(device, R"(
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModuleSampler = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModuleSampler = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var mySampler: sampler;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -625,7 +625,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::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -634,7 +634,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -653,13 +653,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
|
||||
|
||||
// Test it is invalid to have conflicting binding texture multisampling in the shaders.
|
||||
TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
|
||||
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
@@ -675,13 +675,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
|
||||
|
||||
// Test it is invalid to have conflicting binding texture dimension in the shaders.
|
||||
TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
|
||||
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var myTexture : texture_3d<f32>;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
@@ -697,13 +697,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
|
||||
|
||||
// Test it is invalid to have conflicting binding texture component type in the shaders.
|
||||
TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
|
||||
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var myTexture : texture_2d<i32>;
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
@@ -784,7 +784,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
|
||||
|
||||
wgpu::PipelineLayout pipelineLayout = device.CreatePipelineLayout(&pipelineLayoutDesc);
|
||||
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct S {
|
||||
pos : vec4<f32>;
|
||||
};
|
||||
@@ -793,7 +793,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
@@ -823,7 +823,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
|
||||
// Test that fragment output validation is for the correct entryPoint
|
||||
// TODO(dawn:216): Re-enable when we correctly reflect which bindings are used for an entryPoint.
|
||||
TEST_F(GetBindGroupLayoutTests, DISABLED_FromCorrectEntryPoint) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Data {
|
||||
data : f32;
|
||||
};
|
||||
|
||||
@@ -22,13 +22,13 @@ class IndexBufferValidationTest : public ValidationTest {
|
||||
protected:
|
||||
wgpu::RenderPipeline MakeTestPipeline(wgpu::IndexFormat format,
|
||||
wgpu::PrimitiveTopology primitiveTopology) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> fragColor : vec4<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
|
||||
|
||||
@@ -142,7 +142,7 @@ class MinBufferSizeTestsBase : public ValidationTest {
|
||||
// Creates compute pipeline given a layout and shader
|
||||
wgpu::ComputePipeline CreateComputePipeline(const std::vector<wgpu::BindGroupLayout>& layouts,
|
||||
const std::string& shader) {
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, shader.c_str());
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, shader.c_str());
|
||||
|
||||
wgpu::ComputePipelineDescriptor csDesc;
|
||||
csDesc.layout = nullptr;
|
||||
@@ -167,10 +167,9 @@ class MinBufferSizeTestsBase : public ValidationTest {
|
||||
wgpu::RenderPipeline CreateRenderPipeline(const std::vector<wgpu::BindGroupLayout>& layouts,
|
||||
const std::string& vertexShader,
|
||||
const std::string& fragShader) {
|
||||
wgpu::ShaderModule vsModule =
|
||||
utils::CreateShaderModuleFromWGSL(device, vertexShader.c_str());
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, vertexShader.c_str());
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, fragShader.c_str());
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, fragShader.c_str());
|
||||
|
||||
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
|
||||
pipelineDescriptor.vertex.module = vsModule;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<in> pos : vec2<f32>;
|
||||
|
||||
[[block]] struct S {
|
||||
@@ -38,7 +38,7 @@ namespace {
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Uniforms {
|
||||
color : vec4<f32>;
|
||||
};
|
||||
|
||||
@@ -26,13 +26,13 @@ class RenderPipelineValidationTest : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
})");
|
||||
|
||||
fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> fragColor : vec4<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
|
||||
@@ -195,8 +195,7 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputFormatCompatibility) {
|
||||
<< kScalarTypes[i] << R"(>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})";
|
||||
descriptor.cFragment.module =
|
||||
utils::CreateShaderModuleFromWGSL(device, stream.str().c_str());
|
||||
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
|
||||
|
||||
if (i == j) {
|
||||
device.CreateRenderPipeline2(&descriptor);
|
||||
@@ -414,8 +413,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
|
||||
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})";
|
||||
descriptor.cFragment.module =
|
||||
utils::CreateShaderModuleFromWGSL(device, stream.str().c_str());
|
||||
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
|
||||
|
||||
wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, kTextureComponentTypes[j]}});
|
||||
@@ -462,8 +460,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
|
||||
<< kTextureKeywords[i] << R"(<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})";
|
||||
descriptor.cFragment.module =
|
||||
utils::CreateShaderModuleFromWGSL(device, stream.str().c_str());
|
||||
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
|
||||
|
||||
wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
|
||||
device, {{0, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::Float,
|
||||
@@ -482,7 +479,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
|
||||
// Test that declaring a storage buffer in the vertex shader without setting pipeline layout won't
|
||||
// cause crash.
|
||||
TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
|
||||
wgpu::ShaderModule vsModuleWithStorageBuffer = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModuleWithStorageBuffer = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Dst {
|
||||
data : array<u32, 100>;
|
||||
};
|
||||
@@ -555,7 +552,7 @@ TEST_F(RenderPipelineValidationTest, StripIndexFormatRequired) {
|
||||
|
||||
// Test that the entryPoint names must be present for the correct stage in the shader module.
|
||||
TEST_F(RenderPipelineValidationTest, EntryPointNameValidation) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> position : vec4<f32>;
|
||||
[[stage(vertex)]] fn vertex_main() -> void {
|
||||
position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
@@ -605,7 +602,7 @@ TEST_F(RenderPipelineValidationTest, EntryPointNameValidation) {
|
||||
|
||||
// Test that vertex attrib validation is for the correct entryPoint
|
||||
TEST_F(RenderPipelineValidationTest, VertexAttribCorrectEntryPoint) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> position : vec4<f32>;
|
||||
[[location(0)]] var<in> attrib0 : vec4<f32>;
|
||||
[[location(1)]] var<in> attrib1 : vec4<f32>;
|
||||
@@ -651,7 +648,7 @@ TEST_F(RenderPipelineValidationTest, VertexAttribCorrectEntryPoint) {
|
||||
|
||||
// Test that fragment output validation is for the correct entryPoint
|
||||
TEST_F(RenderPipelineValidationTest, FragmentOutputCorrectEntryPoint) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> colorFloat : vec4<f32>;
|
||||
[[location(0)]] var<out> colorUint : vec4<u32>;
|
||||
|
||||
@@ -691,7 +688,7 @@ TEST_F(RenderPipelineValidationTest, FragmentOutputCorrectEntryPoint) {
|
||||
// Test that fragment output validation is for the correct entryPoint
|
||||
// TODO(dawn:216): Re-enable when we correctly reflect which bindings are used for an entryPoint.
|
||||
TEST_F(RenderPipelineValidationTest, DISABLED_BindingsFromCorrectEntryPoint) {
|
||||
wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct Uniforms {
|
||||
data : vec4<f32>;
|
||||
};
|
||||
|
||||
@@ -46,11 +46,11 @@ namespace {
|
||||
// in the caller, so it is always correct for binding validation between bind groups and
|
||||
// pipeline. But those bind groups in caller can be used for validation for other purposes.
|
||||
wgpu::RenderPipeline CreateNoOpRenderPipeline() {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
utils::ComboRenderPipelineDescriptor2 pipelineDescriptor;
|
||||
@@ -61,7 +61,7 @@ namespace {
|
||||
}
|
||||
|
||||
wgpu::ComputePipeline CreateNoOpComputePipeline() {
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(compute)]] fn main() -> void {
|
||||
})");
|
||||
wgpu::ComputePipelineDescriptor pipelineDescriptor;
|
||||
@@ -771,11 +771,11 @@ namespace {
|
||||
wgpu::BindGroup bg1 = utils::MakeBindGroup(device, bgl1, {{0, buffer}});
|
||||
|
||||
// Create a passthrough render pipeline with a readonly buffer
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct RBuffer {
|
||||
value : f32;
|
||||
};
|
||||
@@ -815,7 +815,7 @@ namespace {
|
||||
wgpu::BindGroup bg1 = utils::MakeBindGroup(device, bgl1, {{0, buffer}});
|
||||
|
||||
// Create a passthrough compute pipeline with a readonly buffer
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[block]] struct RBuffer {
|
||||
value : f32;
|
||||
};
|
||||
@@ -1549,11 +1549,11 @@ namespace {
|
||||
// Test render pass
|
||||
{
|
||||
// Create a passthrough render pipeline with a readonly storage texture
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
})");
|
||||
@@ -1579,7 +1579,7 @@ namespace {
|
||||
// Test compute pass
|
||||
{
|
||||
// Create a passthrough compute pipeline with a readonly storage texture
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
|
||||
[[stage(compute)]] fn main() -> void {
|
||||
})");
|
||||
|
||||
@@ -62,7 +62,7 @@ TEST_F(ShaderModuleValidationTest, FragmentOutputLocationExceedsMaxColorAttachme
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
|
||||
})";
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, stream.str().c_str()));
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, stream.str().c_str()));
|
||||
}
|
||||
|
||||
// Test that it is invalid to create a shader module with no chained descriptor. (It must be
|
||||
|
||||
@@ -23,12 +23,12 @@ class StorageTextureValidationTests : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
mDefaultVSModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
mDefaultVSModule = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
})");
|
||||
mDefaultFSModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
mDefaultFSModule = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> fragColor : vec4<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
fragColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
||||
@@ -120,7 +120,7 @@ class StorageTextureValidationTests : public ValidationTest {
|
||||
TEST_F(StorageTextureValidationTests, RenderPipeline) {
|
||||
// Readonly storage texture can be declared in a vertex shader.
|
||||
{
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
|
||||
[[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>;
|
||||
@@ -137,7 +137,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
|
||||
|
||||
// Read-only storage textures can be declared in a fragment shader.
|
||||
{
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[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>;
|
||||
@@ -154,7 +154,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
|
||||
|
||||
// Write-only storage textures cannot be declared in a vertex shader.
|
||||
if ((false) /* TODO(https://crbug.com/tint/449) */) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
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 {
|
||||
@@ -170,7 +170,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
|
||||
|
||||
// Write-only storage textures can be declared in a fragment shader.
|
||||
{
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
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 {
|
||||
@@ -190,7 +190,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) {
|
||||
TEST_F(StorageTextureValidationTests, ComputePipeline) {
|
||||
// Read-only storage textures can be declared in a compute shader.
|
||||
{
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
|
||||
[[builtin(local_invocation_id)]] var<in> LocalInvocationID : vec3<u32>;
|
||||
|
||||
@@ -213,7 +213,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
|
||||
|
||||
// Write-only storage textures can be declared in a compute shader.
|
||||
{
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, R"(
|
||||
[[group(0), binding(0)]] var image0 : [[access(write)]] texture_storage_2d<rgba8unorm>;
|
||||
[[builtin(local_invocation_id)]] var<in> LocalInvocationID : vec3<u32>;
|
||||
|
||||
@@ -234,7 +234,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) {
|
||||
TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
|
||||
// Read-write storage textures cannot be declared in a vertex shader by default.
|
||||
{
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
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 {
|
||||
})"));
|
||||
@@ -242,7 +242,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
|
||||
|
||||
// Read-write storage textures cannot be declared in a fragment shader by default.
|
||||
{
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
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 {
|
||||
})"));
|
||||
@@ -250,7 +250,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
|
||||
|
||||
// Read-write storage textures cannot be declared in a compute shader by default.
|
||||
{
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
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 {
|
||||
})"));
|
||||
@@ -317,10 +317,9 @@ TEST_F(StorageTextureValidationTests, StorageTextureFormatInShaders) {
|
||||
std::string computeShader =
|
||||
CreateComputeShaderWithStorageTexture(storageTextureBindingType, format);
|
||||
if (utils::TextureFormatSupportsStorageTexture(format)) {
|
||||
utils::CreateShaderModuleFromWGSL(device, computeShader.c_str());
|
||||
utils::CreateShaderModule(device, computeShader.c_str());
|
||||
} else {
|
||||
ASSERT_DEVICE_ERROR(
|
||||
utils::CreateShaderModuleFromWGSL(device, computeShader.c_str()));
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, computeShader.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +342,7 @@ TEST_F(StorageTextureValidationTests, UnsupportedWGSLStorageTextureFormat) {
|
||||
for (wgpu::StorageTextureAccess bindingType : kSupportedStorageTextureAccess) {
|
||||
for (wgpu::TextureFormat format : kUnsupportedTextureFormats) {
|
||||
std::string computeShader = CreateComputeShaderWithStorageTexture(bindingType, format);
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, computeShader.c_str()));
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, computeShader.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,7 +359,7 @@ TEST_F(StorageTextureValidationTests, UnsupportedTextureViewDimensionInShader) {
|
||||
for (wgpu::TextureViewDimension dimension : kUnsupportedTextureViewDimensions) {
|
||||
std::string computeShader =
|
||||
CreateComputeShaderWithStorageTexture(bindingType, kFormat, dimension);
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, computeShader.c_str()));
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, computeShader.c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -402,8 +401,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutEntryTypeMatchesShaderDecla
|
||||
// Create the compute shader with the given binding type.
|
||||
std::string computeShader =
|
||||
CreateComputeShaderWithStorageTexture(bindingTypeInShader, kStorageTextureFormat);
|
||||
wgpu::ShaderModule csModule =
|
||||
utils::CreateShaderModuleFromWGSL(device, computeShader.c_str());
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, computeShader.c_str());
|
||||
|
||||
// Set common fields of compute pipeline descriptor.
|
||||
wgpu::ComputePipelineDescriptor defaultComputePipelineDescriptor;
|
||||
@@ -479,8 +477,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutStorageTextureFormatMatches
|
||||
// format.
|
||||
std::string computeShader =
|
||||
CreateComputeShaderWithStorageTexture(bindingType, storageTextureFormatInShader);
|
||||
wgpu::ShaderModule csModule =
|
||||
utils::CreateShaderModuleFromWGSL(device, computeShader.c_str());
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, computeShader.c_str());
|
||||
|
||||
// Set common fields of compute pipeline descriptor.
|
||||
wgpu::ComputePipelineDescriptor defaultComputePipelineDescriptor;
|
||||
@@ -536,8 +533,7 @@ TEST_F(StorageTextureValidationTests, BindGroupLayoutViewDimensionMatchesShaderD
|
||||
// Create the compute shader with the given texture view dimension.
|
||||
std::string computeShader = CreateComputeShaderWithStorageTexture(
|
||||
bindingType, kStorageTextureFormat, dimensionInShader);
|
||||
wgpu::ShaderModule csModule =
|
||||
utils::CreateShaderModuleFromWGSL(device, computeShader.c_str());
|
||||
wgpu::ShaderModule csModule = utils::CreateShaderModule(device, computeShader.c_str());
|
||||
|
||||
// Set common fields of compute pipeline descriptor.
|
||||
wgpu::ComputePipelineDescriptor defaultComputePipelineDescriptor;
|
||||
@@ -768,7 +764,7 @@ TEST_F(StorageTextureValidationTests, MultisampledStorageTexture) {
|
||||
for (wgpu::StorageTextureAccess bindingType : kSupportedStorageTextureAccess) {
|
||||
std::string computeShader =
|
||||
CreateComputeShaderWithStorageTexture(bindingType, "", "image2DMS");
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModuleFromWGSL(device, computeShader.c_str()));
|
||||
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, computeShader.c_str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) {
|
||||
|
||||
utils::ComboRenderPipelineDescriptor2 desc;
|
||||
desc.vertex.module =
|
||||
utils::CreateShaderModuleFromWGSL(device, "[[stage(vertex)]] fn main() -> void {}");
|
||||
utils::CreateShaderModule(device, "[[stage(vertex)]] fn main() -> void {}");
|
||||
desc.cFragment.module =
|
||||
utils::CreateShaderModuleFromWGSL(device, "[[stage(fragment)]] fn main() -> void {}");
|
||||
utils::CreateShaderModule(device, "[[stage(fragment)]] fn main() -> void {}");
|
||||
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline2(&desc);
|
||||
|
||||
// Control cases: DrawIndirect and DrawIndexed are allowed inside a render pass.
|
||||
@@ -118,7 +118,7 @@ TEST_F(UnsafeAPIValidationTest, DispatchIndirectDisallowed) {
|
||||
wgpu::ComputePipelineDescriptor pipelineDesc;
|
||||
pipelineDesc.computeStage.entryPoint = "main";
|
||||
pipelineDesc.computeStage.module =
|
||||
utils::CreateShaderModuleFromWGSL(device, "[[stage(compute)]] fn main() -> void {}");
|
||||
utils::CreateShaderModule(device, "[[stage(compute)]] fn main() -> void {}");
|
||||
wgpu::ComputePipeline pipeline = device.CreateComputePipeline(&pipelineDesc);
|
||||
|
||||
// Control case: dispatch is allowed.
|
||||
@@ -216,7 +216,7 @@ TEST_F(UnsafeAPIValidationTest, OcclusionQueryDisallowed) {
|
||||
// Check that CreateComputePipelineAsync is disallowed as part of unsafe APIs
|
||||
TEST_F(UnsafeAPIValidationTest, CreateComputePipelineAsyncDisallowed) {
|
||||
wgpu::ComputePipelineDescriptor desc;
|
||||
desc.computeStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
desc.computeStage.module = utils::CreateShaderModule(device, R"(
|
||||
[[stage(compute)]] fn main() -> void {
|
||||
})");
|
||||
desc.computeStage.entryPoint = "main";
|
||||
@@ -236,12 +236,12 @@ TEST_F(UnsafeAPIValidationTest, CreateComputePipelineAsyncDisallowed) {
|
||||
// Check that CreateRenderPipelineAsync is disallowed as part of unsafe APIs
|
||||
TEST_F(UnsafeAPIValidationTest, CreateRenderPipelineAsyncDisallowed) {
|
||||
utils::ComboRenderPipelineDescriptor2 desc;
|
||||
desc.vertex.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
desc.vertex.module = utils::CreateShaderModule(device, R"(
|
||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||
[[stage(vertex)]] fn main() -> void {
|
||||
Position = vec4<f32>(0.0, 0.0, 0.0, 1.0);
|
||||
})");
|
||||
desc.cFragment.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
desc.cFragment.module = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> o_color : vec4<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
o_color = vec4<f32>(0.0, 1.0, 0.0, 1.0);
|
||||
|
||||
@@ -25,7 +25,7 @@ class VertexBufferValidationTest : public ValidationTest {
|
||||
void SetUp() override {
|
||||
ValidationTest::SetUp();
|
||||
|
||||
fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
fsModule = utils::CreateShaderModule(device, R"(
|
||||
[[location(0)]] var<out> fragColor : vec4<f32>;
|
||||
[[stage(fragment)]] fn main() -> void {
|
||||
fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
|
||||
@@ -59,7 +59,7 @@ class VertexBufferValidationTest : public ValidationTest {
|
||||
|
||||
vs << "}\n";
|
||||
|
||||
return utils::CreateShaderModuleFromWGSL(device, vs.str().c_str());
|
||||
return utils::CreateShaderModule(device, vs.str().c_str());
|
||||
}
|
||||
|
||||
wgpu::RenderPipeline MakeRenderPipeline(const wgpu::ShaderModule& vsModule,
|
||||
|
||||
@@ -22,8 +22,8 @@ class VertexStateTest : public ValidationTest {
|
||||
void CreatePipeline(bool success,
|
||||
const utils::ComboVertexStateDescriptor& state,
|
||||
const char* vertexSource) {
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, vertexSource);
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
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 {
|
||||
fragColor = vec4<f32>(1.0, 0.0, 0.0, 1.0);
|
||||
|
||||
Reference in New Issue
Block a user