Update Draw(Indexed)?(Indirect)?Tests to use WGSL

Bug: dawn:572
Change-Id: I8c5e89588d0794e7716d0e8db76634ffa477bf78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33764
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Austin Eng 2020-11-26 13:05:35 +00:00 committed by Commit Bot service account
parent e433709e6e
commit 1dc64736c4
4 changed files with 44 additions and 56 deletions

View File

@ -26,20 +26,17 @@ class DrawIndexedIndirectTest : public DawnTest {
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
wgpu::ShaderModule vsModule = wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( [[location(0)]] var<in> pos : vec4<f32>;
#version 450 [[builtin(position)]] var<out> Position : vec4<f32>;
layout(location = 0) in vec4 pos; [[stage(vertex)]] fn main() -> void {
void main() { Position = pos;
gl_Position = pos;
})"); })");
wgpu::ShaderModule fsModule = wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"( [[location(0)]] var<out> fragColor : vec4<f32>;
#version 450 [[stage(fragment)]] fn main() -> void {
layout(location = 0) out vec4 fragColor; fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
void main() {
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor(device); utils::ComboRenderPipelineDescriptor descriptor(device);

View File

@ -26,20 +26,17 @@ class DrawIndexedTest : public DawnTest {
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
wgpu::ShaderModule vsModule = wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( [[location(0)]] var<in> pos : vec4<f32>;
#version 450 [[builtin(position)]] var<out> Position : vec4<f32>;
layout(location = 0) in vec4 pos; [[stage(vertex)]] fn main() -> void {
void main() { Position = pos;
gl_Position = pos;
})"); })");
wgpu::ShaderModule fsModule = wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"( [[location(0)]] var<out> fragColor : vec4<f32>;
#version 450 [[stage(fragment)]] fn main() -> void {
layout(location = 0) out vec4 fragColor; fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
void main() {
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor(device); utils::ComboRenderPipelineDescriptor descriptor(device);

View File

@ -26,20 +26,17 @@ class DrawIndirectTest : public DawnTest {
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
wgpu::ShaderModule vsModule = wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( [[location(0)]] var<in> pos : vec4<f32>;
#version 450 [[builtin(position)]] var<out> Position : vec4<f32>;
layout(location = 0) in vec4 pos; [[stage(vertex)]] fn main() -> void {
void main() { Position = pos;
gl_Position = pos;
})"); })");
wgpu::ShaderModule fsModule = wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"( [[location(0)]] var<out> fragColor : vec4<f32>;
#version 450 [[stage(fragment)]] fn main() -> void {
layout(location = 0) out vec4 fragColor; fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
void main() {
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor(device); utils::ComboRenderPipelineDescriptor descriptor(device);

View File

@ -26,20 +26,17 @@ class DrawTest : public DawnTest {
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize); renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
wgpu::ShaderModule vsModule = wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( [[location(0)]] var<in> pos : vec4<f32>;
#version 450 [[builtin(position)]] var<out> Position : vec4<f32>;
layout(location = 0) in vec4 pos; [[stage(vertex)]] fn main() -> void {
void main() { Position = pos;
gl_Position = pos;
})"); })");
wgpu::ShaderModule fsModule = wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"( [[location(0)]] var<out> fragColor : vec4<f32>;
#version 450 [[stage(fragment)]] fn main() -> void {
layout(location = 0) out vec4 fragColor; fragColor = vec4<f32>(0.0, 1.0, 0.0, 1.0);
void main() {
fragColor = vec4(0.0, 1.0, 0.0, 1.0);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor(device); utils::ComboRenderPipelineDescriptor descriptor(device);