Use GetBindGroupLayout in ColorStateTests
Bug: dawn:276 Change-Id: If5824bc4870f8842481f7b4012c47ad709395e57 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14020 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
be5c135672
commit
3d38301020
|
@ -37,13 +37,6 @@ class ColorStateTest : public DawnTest {
|
||||||
}
|
}
|
||||||
)");
|
)");
|
||||||
|
|
||||||
bindGroupLayout = utils::MakeBindGroupLayout(
|
|
||||||
device, {
|
|
||||||
{0, wgpu::ShaderStage::Fragment, wgpu::BindingType::UniformBuffer},
|
|
||||||
});
|
|
||||||
|
|
||||||
pipelineLayout = utils::MakeBasicPipelineLayout(device, &bindGroupLayout);
|
|
||||||
|
|
||||||
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
renderPass = utils::CreateBasicRenderPass(device, kRTSize, kRTSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +63,6 @@ class ColorStateTest : public DawnTest {
|
||||||
)");
|
)");
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
||||||
baseDescriptor.layout = pipelineLayout;
|
|
||||||
baseDescriptor.vertexStage.module = vsModule;
|
baseDescriptor.vertexStage.module = vsModule;
|
||||||
baseDescriptor.cFragmentStage.module = fsModule;
|
baseDescriptor.cFragmentStage.module = fsModule;
|
||||||
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||||
|
@ -78,7 +70,6 @@ class ColorStateTest : public DawnTest {
|
||||||
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
||||||
testDescriptor.layout = pipelineLayout;
|
|
||||||
testDescriptor.vertexStage.module = vsModule;
|
testDescriptor.vertexStage.module = vsModule;
|
||||||
testDescriptor.cFragmentStage.module = fsModule;
|
testDescriptor.cFragmentStage.module = fsModule;
|
||||||
testDescriptor.cColorStates[0] = colorStateDescriptor;
|
testDescriptor.cColorStates[0] = colorStateDescriptor;
|
||||||
|
@ -102,7 +93,8 @@ class ColorStateTest : public DawnTest {
|
||||||
|
|
||||||
wgpu::Buffer buffer =
|
wgpu::Buffer buffer =
|
||||||
utils::CreateBufferFromData(device, &data, bufferSize, wgpu::BufferUsage::Uniform);
|
utils::CreateBufferFromData(device, &data, bufferSize, wgpu::BufferUsage::Uniform);
|
||||||
return utils::MakeBindGroup(device, bindGroupLayout, {{0, buffer, 0, bufferSize}});
|
return utils::MakeBindGroup(device, testPipeline.GetBindGroupLayout(0),
|
||||||
|
{{0, buffer, 0, bufferSize}});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test that after drawing a triangle with the base color, and then the given triangle spec, the
|
// Test that after drawing a triangle with the base color, and then the given triangle spec, the
|
||||||
|
@ -205,8 +197,6 @@ class ColorStateTest : public DawnTest {
|
||||||
wgpu::RenderPipeline basePipeline;
|
wgpu::RenderPipeline basePipeline;
|
||||||
wgpu::RenderPipeline testPipeline;
|
wgpu::RenderPipeline testPipeline;
|
||||||
wgpu::ShaderModule vsModule;
|
wgpu::ShaderModule vsModule;
|
||||||
wgpu::BindGroupLayout bindGroupLayout;
|
|
||||||
wgpu::PipelineLayout pipelineLayout;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -796,7 +786,6 @@ TEST_P(ColorStateTest, IndependentColorState) {
|
||||||
)");
|
)");
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
||||||
baseDescriptor.layout = pipelineLayout;
|
|
||||||
baseDescriptor.vertexStage.module = vsModule;
|
baseDescriptor.vertexStage.module = vsModule;
|
||||||
baseDescriptor.cFragmentStage.module = fsModule;
|
baseDescriptor.cFragmentStage.module = fsModule;
|
||||||
baseDescriptor.colorStateCount = 4;
|
baseDescriptor.colorStateCount = 4;
|
||||||
|
@ -804,7 +793,6 @@ TEST_P(ColorStateTest, IndependentColorState) {
|
||||||
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
||||||
testDescriptor.layout = pipelineLayout;
|
|
||||||
testDescriptor.vertexStage.module = vsModule;
|
testDescriptor.vertexStage.module = vsModule;
|
||||||
testDescriptor.cFragmentStage.module = fsModule;
|
testDescriptor.cFragmentStage.module = fsModule;
|
||||||
testDescriptor.colorStateCount = 4;
|
testDescriptor.colorStateCount = 4;
|
||||||
|
@ -898,7 +886,6 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
||||||
)");
|
)");
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
||||||
baseDescriptor.layout = pipelineLayout;
|
|
||||||
baseDescriptor.vertexStage.module = vsModule;
|
baseDescriptor.vertexStage.module = vsModule;
|
||||||
baseDescriptor.cFragmentStage.module = fsModule;
|
baseDescriptor.cFragmentStage.module = fsModule;
|
||||||
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||||
|
@ -906,7 +893,6 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
||||||
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
||||||
testDescriptor.layout = pipelineLayout;
|
|
||||||
testDescriptor.vertexStage.module = vsModule;
|
testDescriptor.vertexStage.module = vsModule;
|
||||||
testDescriptor.cFragmentStage.module = fsModule;
|
testDescriptor.cFragmentStage.module = fsModule;
|
||||||
testDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
testDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||||
|
@ -1022,7 +1008,6 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) {
|
||||||
)");
|
)");
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
utils::ComboRenderPipelineDescriptor baseDescriptor(device);
|
||||||
baseDescriptor.layout = pipelineLayout;
|
|
||||||
baseDescriptor.vertexStage.module = vsModule;
|
baseDescriptor.vertexStage.module = vsModule;
|
||||||
baseDescriptor.cFragmentStage.module = fsModule;
|
baseDescriptor.cFragmentStage.module = fsModule;
|
||||||
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||||
|
@ -1030,7 +1015,6 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) {
|
||||||
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
||||||
|
|
||||||
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
utils::ComboRenderPipelineDescriptor testDescriptor(device);
|
||||||
testDescriptor.layout = pipelineLayout;
|
|
||||||
testDescriptor.vertexStage.module = vsModule;
|
testDescriptor.vertexStage.module = vsModule;
|
||||||
testDescriptor.cFragmentStage.module = fsModule;
|
testDescriptor.cFragmentStage.module = fsModule;
|
||||||
testDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
testDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||||
|
|
|
@ -112,8 +112,6 @@ namespace utils {
|
||||||
cDepthStencilState.stencilWriteMask = 0xff;
|
cDepthStencilState.stencilWriteMask = 0xff;
|
||||||
descriptor->depthStencilState = nullptr;
|
descriptor->depthStencilState = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
descriptor->layout = utils::MakeBasicPipelineLayout(device, nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace utils
|
} // namespace utils
|
||||||
|
|
Loading…
Reference in New Issue