mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-15 03:41:34 +00:00
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:
parent
159d5c6a90
commit
ca5f61f9ed
@ -80,14 +80,6 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
fragColor = vec4(myUbo.color, 1.f);
|
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 {
|
struct TestSpec {
|
||||||
@ -277,14 +269,9 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
wgpu::Buffer buffer = utils::CreateBufferFromData(
|
wgpu::Buffer buffer = utils::CreateBufferFromData(
|
||||||
device, &data, sizeof(TriangleData), wgpu::BufferUsage::Uniform);
|
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
|
// Create a pipeline for the triangles with the test spec's depth stencil state
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor descriptor(device);
|
utils::ComboRenderPipelineDescriptor descriptor(device);
|
||||||
descriptor.layout = pipelineLayout;
|
|
||||||
descriptor.vertexStage.module = vsModule;
|
descriptor.vertexStage.module = vsModule;
|
||||||
descriptor.cFragmentStage.module = fsModule;
|
descriptor.cFragmentStage.module = fsModule;
|
||||||
descriptor.cDepthStencilState = test.depthStencilState;
|
descriptor.cDepthStencilState = test.depthStencilState;
|
||||||
@ -293,6 +280,10 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
|
|
||||||
wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
|
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.SetPipeline(pipeline);
|
||||||
pass.SetStencilReference(test.stencil); // Set the stencil reference
|
pass.SetStencilReference(test.stencil); // Set the stencil reference
|
||||||
pass.SetBindGroup(
|
pass.SetBindGroup(
|
||||||
@ -318,8 +309,6 @@ class DepthStencilStateTest : public DawnTest {
|
|||||||
wgpu::TextureView depthTextureView;
|
wgpu::TextureView depthTextureView;
|
||||||
wgpu::ShaderModule vsModule;
|
wgpu::ShaderModule vsModule;
|
||||||
wgpu::ShaderModule fsModule;
|
wgpu::ShaderModule fsModule;
|
||||||
wgpu::BindGroupLayout bindGroupLayout;
|
|
||||||
wgpu::PipelineLayout pipelineLayout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Test compilation and usage of the fixture
|
// Test compilation and usage of the fixture
|
||||||
|
Loading…
x
Reference in New Issue
Block a user