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:
parent
84e1dca464
commit
564bea9da1
|
@ -20,23 +20,26 @@
|
|||
class ScissorTest : public DawnTest {
|
||||
protected:
|
||||
wgpu::RenderPipeline CreateQuadPipeline(wgpu::TextureFormat format) {
|
||||
wgpu::ShaderModule vsModule =
|
||||
utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"(
|
||||
#version 450
|
||||
const vec2 pos[6] = vec2[6](
|
||||
vec2(-1.0f, -1.0f), vec2(-1.0f, 1.0f), vec2(1.0f, -1.0f),
|
||||
vec2(1.0f, 1.0f), vec2(-1.0f, 1.0f), vec2(1.0f, -1.0f)
|
||||
);
|
||||
void main() {
|
||||
gl_Position = vec4(pos[gl_VertexIndex], 0.5, 1.0);
|
||||
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
||||
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||
|
||||
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
||||
vec2<f32>(-1.0, -1.0),
|
||||
vec2<f32>(-1.0, 1.0),
|
||||
vec2<f32>( 1.0, -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 =
|
||||
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"(
|
||||
#version 450
|
||||
layout(location = 0) out vec4 fragColor;
|
||||
void main() {
|
||||
fragColor = vec4(0.0f, 1.0f, 0.0f, 1.0f);
|
||||
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(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);
|
||||
})");
|
||||
|
||||
utils::ComboRenderPipelineDescriptor descriptor(device);
|
||||
|
|
Loading…
Reference in New Issue