OpenGL: Set default values for dynamic states before clear
This patch fixes a bug on the OpenGL backend by setting default values for dynamic states (blend color, viewport, scissor rectangle, etc) before clearing the attachments of the render pass so that the full area of the attachments can be cleared correctly. BUG=dawn:126, dawn:137, dawn:141 TEST=dawn_end2end_tests Change-Id: I9ddf74a67413ed51f83a69a3dc2c2377a0622cac Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7080 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
f112ceca34
commit
974a150327
|
@ -680,6 +680,13 @@ namespace dawn_native { namespace opengl {
|
|||
}
|
||||
}
|
||||
|
||||
// Set defaults for dynamic state before executing clears and commands.
|
||||
PersistentPipelineState persistentPipelineState;
|
||||
persistentPipelineState.SetDefaultState();
|
||||
glBlendColor(0, 0, 0, 0);
|
||||
glViewport(0, 0, renderPass->width, renderPass->height);
|
||||
glScissor(0, 0, renderPass->width, renderPass->height);
|
||||
|
||||
// Clear framebuffer attachments as needed
|
||||
{
|
||||
for (uint32_t i : IterateBitSet(renderPass->colorAttachmentsSet)) {
|
||||
|
@ -725,17 +732,9 @@ namespace dawn_native { namespace opengl {
|
|||
RenderPipeline* lastPipeline = nullptr;
|
||||
uint64_t indexBufferBaseOffset = 0;
|
||||
|
||||
PersistentPipelineState persistentPipelineState;
|
||||
|
||||
PushConstantTracker pushConstants;
|
||||
InputBufferTracker inputBuffers;
|
||||
|
||||
// Set defaults for dynamic state
|
||||
persistentPipelineState.SetDefaultState();
|
||||
glBlendColor(0, 0, 0, 0);
|
||||
glViewport(0, 0, renderPass->width, renderPass->height);
|
||||
glScissor(0, 0, renderPass->width, renderPass->height);
|
||||
|
||||
Command type;
|
||||
while (mCommands.NextCommandId(&type)) {
|
||||
switch (type) {
|
||||
|
|
|
@ -112,12 +112,6 @@ class RenderPassLoadOpTests : public DawnTest {
|
|||
|
||||
// Tests clearing, loading, and drawing into color attachments
|
||||
TEST_P(RenderPassLoadOpTests, ColorClearThenLoadAndDraw) {
|
||||
// TODO(jiawei.shao@intel.com): investigate why the test is flaky on Linux Intel OpenGL drivers.
|
||||
// Currently we cannot collect PCI IDs from OpenGL drivers, we have to skip it on all OpenGL
|
||||
// backends.
|
||||
// Tracking bug: https://bugs.chromium.org/p/dawn/issues/detail?id=126
|
||||
DAWN_SKIP_TEST_IF(IsOpenGL() && IsLinux());
|
||||
|
||||
// Part 1: clear once, check to make sure it's cleared
|
||||
utils::ComboRenderPassDescriptor renderPassClearZero({renderTargetView});
|
||||
auto commandsClearZeroEncoder = device.CreateCommandEncoder();
|
||||
|
|
Loading…
Reference in New Issue