Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions impeller/renderer/backend/gles/proc_table_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,20 @@ static bool ResourceIsLive(const ProcTableGLES& gl,
FML_UNREACHABLE();
}

bool ProcTableGLES::SetDebugLabel(DebugResourceType type,
GLint name,
std::string_view label) const {
bool ProcTableGLES::SupportsDebugLabels() const {
if (debug_label_max_length_ <= 0) {
return true;
return false;
}
if (!ObjectLabelKHR.IsAvailable()) {
return false;
}
return true;
}

bool ProcTableGLES::SetDebugLabel(DebugResourceType type,
GLint name,
std::string_view label) const {
if (!SupportsDebugLabels()) {
return true;
}
if (!ResourceIsLive(*this, type, name)) {
Expand Down
2 changes: 2 additions & 0 deletions impeller/renderer/backend/gles/proc_table_gles.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ class ProcTableGLES {

bool IsCurrentFramebufferComplete() const;

bool SupportsDebugLabels() const;

bool SetDebugLabel(DebugResourceType type,
GLint name,
std::string_view label) const;
Expand Down
7 changes: 6 additions & 1 deletion impeller/renderer/backend/gles/test/reactor_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TEST(ReactorGLES, UntrackedHandle) {
EXPECT_TRUE(reactor->React());
}

TEST(ReactorGLES, DISABLED_NameUntrackedHandle) {
TEST(ReactorGLES, NameUntrackedHandle) {
auto mock_gles_impl = std::make_unique<MockGLESImpl>();

EXPECT_CALL(*mock_gles_impl, GenTextures(1, _))
Expand All @@ -108,6 +108,11 @@ TEST(ReactorGLES, DISABLED_NameUntrackedHandle) {
MockGLES::Init(std::move(mock_gles_impl));
ProcTableGLES::Resolver resolver = kMockResolverGLES;
auto proc_table = std::make_unique<ProcTableGLES>(resolver);

if (!proc_table->SupportsDebugLabels()) {
GTEST_SKIP() << "This device doesn't support labelling.";
}

auto worker = std::make_shared<TestWorker>();
auto reactor = std::make_shared<ReactorGLES>(std::move(proc_table));
reactor->AddWorker(worker);
Expand Down
Loading