Update RenderBundleTests to use WGSL

Bug: dawn:572
Change-Id: Ide2ec5c70cc4f0abe8374bd9262ef9da02c9a4ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33881
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Austin Eng 2020-11-26 15:36:26 +00:00 committed by Commit Bot service account
parent a3e7e69dd7
commit d7f4e808e7
1 changed files with 16 additions and 17 deletions

View File

@ -31,23 +31,22 @@ class RenderBundleTest : public DawnTest {
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
wgpu::ShaderModule vsModule =
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"(
#version 450
layout(location = 0) in vec4 pos;
void main() {
gl_Position = pos;
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[location(0)]] var<in> pos : vec4<f32>;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
Position = pos;
})");
wgpu::ShaderModule fsModule =
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"(
#version 450
layout(location = 0) out vec4 fragColor;
layout (set = 0, binding = 0) uniform fragmentUniformBuffer {
vec4 color;
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[location(0)]] var<out> fragColor : vec4<f32>;
[[block]] struct Ubo {
[[offset(0)]] color : vec4<f32>;
};
void main() {
fragColor = color;
[[set(0), binding(0)]] var<uniform> fragmentUniformBuffer : Ubo;
[[stage(fragment)]] fn main() -> void {
fragColor = fragmentUniformBuffer.color;
})");
utils::ComboRenderPipelineDescriptor descriptor(device);