-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Impeller] Fix GL depth state. (#51040)
This patch fixes problems with GL depth (in service of #50856): * The depth + stencil masks weren't being set prior to clearing. * When the driver identifies as desktop GL rather than ES, use `glClearDepth` and `glDepthRange` rather than `glClearDepthf` and `glDepthRangef`.
- Loading branch information
Showing
8 changed files
with
109 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
impeller/renderer/backend/gles/test/proc_table_gles_unittests.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include <optional> | ||
|
||
#include "flutter/testing/testing.h" // IWYU pragma: keep | ||
#include "gtest/gtest.h" | ||
#include "impeller/renderer/backend/gles/proc_table_gles.h" | ||
#include "impeller/renderer/backend/gles/test/mock_gles.h" | ||
|
||
namespace impeller { | ||
namespace testing { | ||
|
||
#define EXPECT_AVAILABLE(proc_ivar) \ | ||
EXPECT_TRUE(mock_gles->GetProcTable().proc_ivar.IsAvailable()); | ||
#define EXPECT_UNAVAILABLE(proc_ivar) \ | ||
EXPECT_FALSE(mock_gles->GetProcTable().proc_ivar.IsAvailable()); | ||
|
||
TEST(ProcTableGLES, ResolvesCorrectClearDepthProcOnES) { | ||
auto mock_gles = MockGLES::Init(std::nullopt, "OpenGL ES 3.0"); | ||
EXPECT_TRUE(mock_gles->GetProcTable().GetDescription()->IsES()); | ||
|
||
FOR_EACH_IMPELLER_ES_ONLY_PROC(EXPECT_AVAILABLE); | ||
FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(EXPECT_UNAVAILABLE); | ||
} | ||
|
||
TEST(ProcTableGLES, ResolvesCorrectClearDepthProcOnDesktopGL) { | ||
auto mock_gles = MockGLES::Init(std::nullopt, "OpenGL 4.0"); | ||
EXPECT_FALSE(mock_gles->GetProcTable().GetDescription()->IsES()); | ||
|
||
FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(EXPECT_AVAILABLE); | ||
FOR_EACH_IMPELLER_ES_ONLY_PROC(EXPECT_UNAVAILABLE); | ||
} | ||
|
||
} // namespace testing | ||
} // namespace impeller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters