Port RenderBundleValidationTests to WGSL

Bug: dawn:572
Change-Id: Id71f2d49c60238939c70bb1d7c93a45b25ca3dcb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33928
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2020-11-26 11:30:55 +00:00 committed by Commit Bot service account
parent 9175f00eec
commit b7eb1e15fa
1 changed files with 23 additions and 18 deletions

View File

@ -27,24 +27,29 @@ namespace {
void SetUp() override {
ValidationTest::SetUp();
vsModule = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"(
#version 450
layout(location = 0) in vec2 pos;
layout (set = 0, binding = 0) uniform vertexUniformBuffer {
mat2 transform;
vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[location(0)]] var<in> pos : vec2<f32>;
[[block]] struct S {
[[offset(0)]] transform : mat2x2<f32>;
};
void main() {
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
})");
fsModule = utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"(
#version 450
layout (set = 1, binding = 0) uniform fragmentUniformBuffer {
vec4 color;
fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[block]] struct Uniforms {
[[offset(0)]] color : vec4<f32>;
};
layout (set = 1, binding = 1) buffer storageBuffer {
float dummy[];
[[set(1), binding(0)]] var<uniform> uniforms : Uniforms;
[[block]] struct Storage {
[[offset(0)]] dummy : [[stride(4)]] array<f32>;
};
void main() {
[[set(1), binding(1)]] var<storage_buffer> ssbo : [[access(read_write)]] Storage;
[[stage(fragment)]] fn main() -> void {
})");
wgpu::BindGroupLayout bgls[] = {