Use GetBindGroupLayout in MultisampledRenderingTests

Bug: dawn:276
Change-Id: I31e879a9e4ed7cc7ccbb882502942302dfd19bb4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14028
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Austin Eng 2019-12-03 21:18:05 +00:00 committed by Commit Bot service account
parent ac89f2d619
commit 476a14a7cc
1 changed files with 3 additions and 11 deletions

View File

@ -106,7 +106,7 @@ class MultisampledRenderingTest : public DawnTest {
uint32_t uniformDataSize) { uint32_t uniformDataSize) {
wgpu::Buffer uniformBuffer = utils::CreateBufferFromData( wgpu::Buffer uniformBuffer = utils::CreateBufferFromData(
device, uniformData, uniformDataSize, wgpu::BufferUsage::Uniform); device, uniformData, uniformDataSize, wgpu::BufferUsage::Uniform);
wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, mBindGroupLayout, wgpu::BindGroup bindGroup = utils::MakeBindGroup(device, pipeline.GetBindGroupLayout(0),
{{0, uniformBuffer, 0, uniformDataSize}}); {{0, uniformBuffer, 0, uniformDataSize}});
wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass); wgpu::RenderPassEncoder renderPassEncoder = commandEncoder.BeginRenderPass(&renderPass);
@ -179,7 +179,6 @@ class MultisampledRenderingTest : public DawnTest {
wgpu::TextureView mResolveView; wgpu::TextureView mResolveView;
wgpu::Texture mDepthStencilTexture; wgpu::Texture mDepthStencilTexture;
wgpu::TextureView mDepthStencilView; wgpu::TextureView mDepthStencilView;
wgpu::BindGroupLayout mBindGroupLayout;
private: private:
wgpu::RenderPipeline CreateRenderPipelineForTest(const char* fs, wgpu::RenderPipeline CreateRenderPipelineForTest(const char* fs,
@ -201,14 +200,6 @@ class MultisampledRenderingTest : public DawnTest {
pipelineDescriptor.cFragmentStage.module = pipelineDescriptor.cFragmentStage.module =
utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, fs); utils::CreateShaderModule(device, utils::SingleShaderStage::Fragment, fs);
mBindGroupLayout = utils::MakeBindGroupLayout(
device, {
{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::UniformBuffer},
});
wgpu::PipelineLayout pipelineLayout =
utils::MakeBasicPipelineLayout(device, &mBindGroupLayout);
pipelineDescriptor.layout = pipelineLayout;
if (hasDepthStencilAttachment) { if (hasDepthStencilAttachment) {
pipelineDescriptor.cDepthStencilState.format = kDepthStencilFormat; pipelineDescriptor.cDepthStencilState.format = kDepthStencilFormat;
pipelineDescriptor.cDepthStencilState.depthWriteEnabled = true; pipelineDescriptor.cDepthStencilState.depthWriteEnabled = true;
@ -223,7 +214,8 @@ class MultisampledRenderingTest : public DawnTest {
pipelineDescriptor.cColorStates[i].format = kColorFormat; pipelineDescriptor.cColorStates[i].format = kColorFormat;
} }
return device.CreateRenderPipeline(&pipelineDescriptor); wgpu::RenderPipeline pipeline = device.CreateRenderPipeline(&pipelineDescriptor);
return pipeline;
} }
}; };