Update DepthStencilCopyTests to use WGSL
Note: some shaders blocked on crbug.com/tint/329 Bug: dawn:572 Change-Id: I31e745fa5f0b5b698432442da0e6c00586fe062f Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33760 Commit-Queue: Austin Eng <enga@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
parent
054d85366a
commit
84e1dca464
|
@ -28,12 +28,19 @@ class DepthStencilCopyTests : public DawnTest {
|
||||||
DawnTest::SetUp();
|
DawnTest::SetUp();
|
||||||
|
|
||||||
// Draw a square in the bottom left quarter of the screen.
|
// Draw a square in the bottom left quarter of the screen.
|
||||||
mVertexModule = utils::CreateShaderModule(device, utils::SingleShaderStage::Vertex, R"(
|
mVertexModule = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
#version 450
|
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
|
||||||
void main() {
|
[[builtin(position)]] var<out> Position : vec4<f32>;
|
||||||
const vec2 pos[6] = vec2[6](vec2(-1.f, -1.f), vec2(0.f, -1.f), vec2(-1.f, 0.f),
|
|
||||||
vec2(-1.f, 0.f), vec2(0.f, -1.f), vec2( 0.f, 0.f));
|
[[stage(vertex)]] fn main() -> void {
|
||||||
gl_Position = vec4(pos[gl_VertexIndex], 0.f, 1.f);
|
const pos : array<vec2<f32>, 6> = array<vec2<f32>, 6>(
|
||||||
|
vec2<f32>(-1.0, -1.0),
|
||||||
|
vec2<f32>( 0.0, -1.0),
|
||||||
|
vec2<f32>(-1.0, 0.0),
|
||||||
|
vec2<f32>(-1.0, 0.0),
|
||||||
|
vec2<f32>( 0.0, -1.0),
|
||||||
|
vec2<f32>( 0.0, 0.0));
|
||||||
|
Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
|
||||||
})");
|
})");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,13 +239,16 @@ class DepthStencilCopyTests : public DawnTest {
|
||||||
// Pipeline for a full screen quad.
|
// Pipeline for a full screen quad.
|
||||||
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
||||||
|
|
||||||
pipelineDescriptor.vertexStage.module =
|
pipelineDescriptor.vertexStage.module = 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>;
|
||||||
void main() {
|
|
||||||
const vec2 pos[3] = vec2[3](vec2(-1.f, -1.f), vec2(3.f, -1.f), vec2(-1.f, 3.f));
|
[[stage(vertex)]] fn main() -> void {
|
||||||
gl_Position = vec4(pos[gl_VertexIndex], 0.f, 1.f);
|
const pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
||||||
gl_Position = vec4(pos[gl_VertexIndex], 0.f, 1.f);
|
vec2<f32>(-1.0, -1.0),
|
||||||
|
vec2<f32>( 3.0, -1.0),
|
||||||
|
vec2<f32>(-1.0, 3.0));
|
||||||
|
Position = vec4<f32>(pos[VertexIndex], 0.0, 1.0);
|
||||||
})");
|
})");
|
||||||
|
|
||||||
// Sample the input texture and write out depth. |result| will only be set to 1 if we
|
// Sample the input texture and write out depth. |result| will only be set to 1 if we
|
||||||
|
@ -619,10 +629,8 @@ TEST_P(DepthStencilCopyTests, ToStencilAspect) {
|
||||||
// A quad is drawn in the bottom left.
|
// A quad is drawn in the bottom left.
|
||||||
utils::ComboRenderPipelineDescriptor renderPipelineDesc(device);
|
utils::ComboRenderPipelineDescriptor renderPipelineDesc(device);
|
||||||
renderPipelineDesc.vertexStage.module = mVertexModule;
|
renderPipelineDesc.vertexStage.module = mVertexModule;
|
||||||
renderPipelineDesc.cFragmentStage.module =
|
renderPipelineDesc.cFragmentStage.module = utils::CreateShaderModuleFromWGSL(device, R"(
|
||||||
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, R"(
|
[[stage(fragment)]] fn main() -> void {
|
||||||
#version 450
|
|
||||||
void main() {
|
|
||||||
})");
|
})");
|
||||||
renderPipelineDesc.cDepthStencilState.format = wgpu::TextureFormat::Depth24PlusStencil8;
|
renderPipelineDesc.cDepthStencilState.format = wgpu::TextureFormat::Depth24PlusStencil8;
|
||||||
renderPipelineDesc.cDepthStencilState.stencilFront.passOp =
|
renderPipelineDesc.cDepthStencilState.stencilFront.passOp =
|
||||||
|
|
Loading…
Reference in New Issue