Use GetBindGroupLayout in DepthStencilStateTests

Bug: dawn:276
Change-Id: Ibd3fcf7131c3c1aa4e8723f7235aa7a1dc55ff46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14026
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Austin Eng 2019-12-03 21:24:05 +00:00 committed by Commit Bot service account
parent 159d5c6a90
commit ca5f61f9ed

View File

@ -80,14 +80,6 @@ class DepthStencilStateTest : public DawnTest {
fragColor = vec4(myUbo.color, 1.f);
}
)");
bindGroupLayout = utils::MakeBindGroupLayout(
device, {
{0, wgpu::ShaderStage::Vertex | wgpu::ShaderStage::Fragment,
wgpu::BindingType::UniformBuffer},
});
pipelineLayout = utils::MakeBasicPipelineLayout(device, &bindGroupLayout);
}
struct TestSpec {
@ -277,14 +269,9 @@ class DepthStencilStateTest : public DawnTest {
wgpu::Buffer buffer = utils::CreateBufferFromData(
device, &data, sizeof(TriangleData), wgpu::BufferUsage::Uniform);
// Create a bind group for the data
wgpu::BindGroup bindGroup = utils::MakeBindGroup(
device, bindGroupLayout, {{0, buffer, 0, sizeof(TriangleData)}});
// Create a pipeline for the triangles with the test spec's depth stencil state
utils::ComboRenderPipelineDescriptor descriptor(device);
descriptor.layout = pipelineLayout;
descriptor.vertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.cDepthStencilState = test.depthStencilState;
@ -293,6 +280,10 @@ class DepthStencilStateTest : public DawnTest {
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
// Create a bind group for the data
wgpu::BindGroup bindGroup = utils::MakeBindGroup(
device, pipeline.GetBindGroupLayout(0), {{0, buffer, 0, sizeof(TriangleData)}});
pass.SetPipeline(pipeline);
pass.SetStencilReference(test.stencil); // Set the stencil reference
pass.SetBindGroup(
@ -318,8 +309,6 @@ class DepthStencilStateTest : public DawnTest {
wgpu::TextureView depthTextureView;
wgpu::ShaderModule vsModule;
wgpu::ShaderModule fsModule;
wgpu::BindGroupLayout bindGroupLayout;
wgpu::PipelineLayout pipelineLayout;
};
// Test compilation and usage of the fixture