Update ScissorTests to use WGSL

Bug: dawn:572
Change-Id: Id083979bf24360d4db25eb5afa0e60eb0151d750
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33768
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Austin Eng 2020-11-30 20:36:31 +00:00 committed by Commit Bot service account
parent 84e1dca464
commit 564bea9da1
1 changed files with 18 additions and 15 deletions

View File

@ -20,23 +20,26 @@
class ScissorTest : public DawnTest { class ScissorTest : public DawnTest {
protected: protected:
wgpu::RenderPipeline CreateQuadPipeline(wgpu::TextureFormat format) { wgpu::RenderPipeline CreateQuadPipeline(wgpu::TextureFormat format) {
wgpu::ShaderModule vsModule = wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"( [[builtin(vertex_idx)]] var<in> VertexIndex : u32;
#version 450 [[builtin(position)]] var<out> Position : vec4<f32>;
const vec2 pos[6] = vec2[6](
vec2(-1.0f, -1.0f), vec2(-1.0f, 1.0f), vec2(1.0f, -1.0f), const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
vec2(1.0f, 1.0f), vec2(-1.0f, 1.0f), vec2(1.0f, -1.0f) vec2<f32>(-1.0, -1.0),
); vec2<f32>(-1.0, 1.0),
void main() { vec2<f32>( 1.0, -1.0),
gl_Position = vec4(pos[gl_VertexIndex], 0.5, 1.0); vec2<f32>( 1.0, 1.0),
vec2<f32>(-1.0, 1.0),
vec2<f32>( 1.0, -1.0));
[[stage(vertex)]] fn main() -> void {
Position = vec4<f32>(pos[VertexIndex], 0.5, 1.0);
})"); })");
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.0f, 1.0f, 0.0f, 1.0f);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor(device); utils::ComboRenderPipelineDescriptor descriptor(device);