Skip to content

Commit e373f0e

Browse files
Zhenyao MoChromium LUCI CQ
Zhenyao Mo
authored and
Chromium LUCI CQ
committed
Remove two gpu workarounds
clear_to_zero_or_one_broken reset_teximage2d_base_level They were only used for non-ANGLE paths. TEST=bots R=kbr@chromium.org Bug: 1136972,710443,705865 Change-Id: Ia31396809373211d0f369399540d3ce476644909 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4863062 Commit-Queue: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Auto-Submit: Zhenyao Mo <zmo@chromium.org> Cr-Commit-Position: refs/heads/main@{#1197236}
1 parent 843ed27 commit e373f0e

13 files changed

+0
-122
lines changed

gpu/config/gpu_driver_bug_list.json

-33
Original file line numberDiff line numberDiff line change
@@ -2055,39 +2055,6 @@
20552055
"rely_on_implicit_sync_for_swap_buffers"
20562056
]
20572057
},
2058-
{
2059-
"id": 236,
2060-
"description": "glClearColor does not always work on Intel 6xxx Mac drivers",
2061-
"cr_bugs": [710443],
2062-
"os": {
2063-
"type": "macosx",
2064-
"version": {
2065-
"op": "<",
2066-
"value": "10.12.6"
2067-
}
2068-
},
2069-
"vendor_id": "0x8086",
2070-
"device_id": ["0x1626", "0x162B", "0x1622"],
2071-
"features": [
2072-
"clear_to_zero_or_one_broken"
2073-
]
2074-
},
2075-
{
2076-
"id": 239,
2077-
"description": "Reset TexImage2D base level to 0 on Intel Mac 10.12.4",
2078-
"cr_bugs": [705865],
2079-
"os": {
2080-
"type": "macosx",
2081-
"version": {
2082-
"op": ">=",
2083-
"value": "10.12.4"
2084-
}
2085-
},
2086-
"vendor_id": "0x8086",
2087-
"features": [
2088-
"reset_teximage2d_base_level"
2089-
]
2090-
},
20912058
{
20922059
"id": 240,
20932060
"cr_bugs": [750306, 764526],

gpu/config/gpu_feature_info.cc

-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "base/containers/contains.h"
88
#include "gpu/config/gpu_blocklist.h"
99
#include "gpu/config/gpu_driver_bug_list.h"
10-
#include "gpu/config/gpu_driver_bug_workaround_type.h"
1110
#include "ui/gl/gl_context.h"
1211

1312
namespace gpu {
@@ -29,14 +28,6 @@ GpuFeatureInfo& GpuFeatureInfo::operator=(GpuFeatureInfo&&) = default;
2928

3029
void GpuFeatureInfo::ApplyToGLContext(gl::GLContext* gl_context) const {
3130
DCHECK(gl_context);
32-
gl::GLWorkarounds gl_workarounds;
33-
if (IsWorkaroundEnabled(gpu::CLEAR_TO_ZERO_OR_ONE_BROKEN)) {
34-
gl_workarounds.clear_to_zero_or_one_broken = true;
35-
}
36-
if (IsWorkaroundEnabled(RESET_TEXIMAGE2D_BASE_LEVEL)) {
37-
gl_workarounds.reset_teximage2d_base_level = true;
38-
}
39-
gl_context->SetGLWorkarounds(gl_workarounds);
4031
gl_context->SetDisabledGLExtensions(this->disabled_extensions);
4132
}
4233

gpu/config/gpu_workaround_list.txt

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ check_egl_fence_before_wait
99
check_ycbcr_studio_g22_left_p709_for_nv12_support
1010
clamp_texture_base_level_and_max_level
1111
clear_pixel_unpack_buffer_before_copyteximage
12-
clear_to_zero_or_one_broken
1312
clear_uniforms_before_first_program_use
1413
count_all_in_varyings_packing
1514
decode_encode_srgb_for_generatemipmap
@@ -119,7 +118,6 @@ rely_on_implicit_sync_for_swap_buffers
119118
remove_dynamic_indexing_of_swizzled_vector
120119
remove_invariant_and_centroid_for_essl3
121120
reset_base_mipmap_level_before_texstorage
122-
reset_teximage2d_base_level
123121
restore_scissor_on_fbo_change
124122
rewrite_do_while_loops
125123
rewrite_float_unary_minus_operator

gpu/ipc/service/command_buffer_stub.cc

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include "ui/gl/gl_context.h"
4444
#include "ui/gl/gl_implementation.h"
4545
#include "ui/gl/gl_switches.h"
46-
#include "ui/gl/gl_workarounds.h"
4746
#include "ui/gl/init/gl_factory.h"
4847

4948
#if BUILDFLAG(IS_WIN)

gpu/ipc/service/gles2_command_buffer_stub.cc

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
#include "ui/gl/gl_surface_egl.h"
5151
#include "ui/gl/gl_switches.h"
5252
#include "ui/gl/gl_utils.h"
53-
#include "ui/gl/gl_workarounds.h"
5453
#include "ui/gl/init/gl_factory.h"
5554

5655
#if BUILDFLAG(IS_WIN)

gpu/ipc/service/raster_command_buffer_stub.cc

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "ui/gl/gl_context.h"
3232
#include "ui/gl/gl_implementation.h"
3333
#include "ui/gl/gl_switches.h"
34-
#include "ui/gl/gl_workarounds.h"
3534
#include "ui/gl/init/gl_factory.h"
3635

3736
#if BUILDFLAG(IS_WIN)

gpu/ipc/service/webgpu_command_buffer_stub.cc

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "ui/gl/gl_context.h"
3434
#include "ui/gl/gl_implementation.h"
3535
#include "ui/gl/gl_switches.h"
36-
#include "ui/gl/gl_workarounds.h"
3736
#include "ui/gl/init/gl_factory.h"
3837

3938
#if BUILDFLAG(IS_WIN)

ui/gl/BUILD.gn

-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ component("gl") {
109109
"gl_utils.h",
110110
"gl_version_info.cc",
111111
"gl_version_info.h",
112-
"gl_workarounds.h",
113112
"gpu_switching_manager.cc",
114113
"gpu_switching_manager.h",
115114
"gpu_timing.cc",

ui/gl/gl_context.cc

-6
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ bool GLContext::MakeCurrent(GLSurface* surface) {
113113

114114
GLApi* GLContext::CreateGLApi(DriverGL* driver) {
115115
real_gl_api_ = new RealGLApi;
116-
real_gl_api_->set_gl_workarounds(gl_workarounds_);
117116
real_gl_api_->SetDisabledExtensions(disabled_gl_extensions_);
118117
real_gl_api_->Initialize(driver);
119118
return real_gl_api_;
@@ -367,11 +366,6 @@ void GLContext::SetCurrent(GLSurface* surface) {
367366
}
368367
}
369368

370-
void GLContext::SetGLWorkarounds(const GLWorkarounds& workarounds) {
371-
DCHECK(!real_gl_api_);
372-
gl_workarounds_ = workarounds;
373-
}
374-
375369
void GLContext::SetDisabledGLExtensions(
376370
const std::string& disabled_extensions) {
377371
DCHECK(!real_gl_api_);

ui/gl/gl_context.h

-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "ui/gl/gl_implementation_wrapper.h"
2222
#include "ui/gl/gl_share_group.h"
2323
#include "ui/gl/gl_state_restorer.h"
24-
#include "ui/gl/gl_workarounds.h"
2524
#include "ui/gl/gpu_preference.h"
2625

2726
namespace gl {
@@ -164,9 +163,6 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext>,
164163
// Creates a GPUTimingClient class which abstracts various GPU Timing exts.
165164
virtual scoped_refptr<GPUTimingClient> CreateGPUTimingClient() = 0;
166165

167-
// Set the GL workarounds.
168-
void SetGLWorkarounds(const GLWorkarounds& workarounds);
169-
170166
void SetDisabledGLExtensions(const std::string& disabled_gl_extensions);
171167

172168
// Gets the GLStateRestorer for the context.
@@ -329,7 +325,6 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext>,
329325

330326
static bool switchable_gpus_supported_;
331327

332-
GLWorkarounds gl_workarounds_;
333328
std::string disabled_gl_extensions_;
334329

335330
bool static_bindings_initialized_ = false;

ui/gl/gl_gl_api_implementation.cc

-34
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,6 @@ void RealGLApi::glTexImage2DFn(GLenum target,
310310
GLenum gl_format = GetTexFormat(version_.get(), format);
311311
GLenum gl_type = GetPixelType(version_.get(), type, format);
312312

313-
// TODO(yizhou): Check if cubemap, 3d texture or texture2d array has the same
314-
// bug on intel mac.
315-
if (!version_->is_angle && gl_workarounds_.reset_teximage2d_base_level &&
316-
target == GL_TEXTURE_2D) {
317-
GLint base_level = 0;
318-
GLApiBase::glGetTexParameterivFn(target, GL_TEXTURE_BASE_LEVEL,
319-
&base_level);
320-
if (base_level) {
321-
GLApiBase::glTexParameteriFn(target, GL_TEXTURE_BASE_LEVEL, 0);
322-
GLApiBase::glTexImage2DFn(target, level, gl_internal_format, width,
323-
height, border, gl_format, gl_type, pixels);
324-
GLApiBase::glTexParameteriFn(target, GL_TEXTURE_BASE_LEVEL, base_level);
325-
return;
326-
}
327-
}
328313
GLApiBase::glTexImage2DFn(target, level, gl_internal_format, width, height,
329314
border, gl_format, gl_type, pixels);
330315
}
@@ -435,21 +420,6 @@ void RealGLApi::glClearFn(GLbitfield mask) {
435420
}
436421
}
437422

438-
void RealGLApi::glClearColorFn(GLclampf red,
439-
GLclampf green,
440-
GLclampf blue,
441-
GLclampf alpha) {
442-
if (!version_->is_angle && gl_workarounds_.clear_to_zero_or_one_broken &&
443-
(1 == red || 0 == red) && (1 == green || 0 == green) &&
444-
(1 == blue || 0 == blue) && (1 == alpha || 0 == alpha)) {
445-
if (1 == alpha)
446-
alpha = 2;
447-
else
448-
alpha = -1;
449-
}
450-
GLApiBase::glClearColorFn(red, green, blue, alpha);
451-
}
452-
453423
void RealGLApi::glDrawArraysFn(GLenum mode, GLint first, GLsizei count) {
454424
if (!g_null_draw_bindings_enabled) {
455425
GLApiBase::glDrawArraysFn(mode, first, count);
@@ -564,10 +534,6 @@ void RealGLApi::ClearCachedGLExtensions() {
564534
filtered_exts_str_.clear();
565535
}
566536

567-
void RealGLApi::set_gl_workarounds(const GLWorkarounds& workarounds) {
568-
gl_workarounds_ = workarounds;
569-
}
570-
571537
void RealGLApi::set_version(std::unique_ptr<GLVersionInfo> version) {
572538
version_ = std::move(version);
573539
}

ui/gl/gl_gl_api_implementation.h

-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "base/memory/raw_ptr.h"
1212
#include "ui/gl/gl_bindings.h"
1313
#include "ui/gl/gl_export.h"
14-
#include "ui/gl/gl_workarounds.h"
1514

1615
namespace gl {
1716

@@ -130,10 +129,6 @@ class GL_EXPORT RealGLApi : public GLApiBase {
130129
void* pixels) override;
131130

132131
void glClearFn(GLbitfield mask) override;
133-
void glClearColorFn(GLclampf red,
134-
GLclampf green,
135-
GLclampf blue,
136-
GLclampf alpha) override;
137132
void glDrawArraysFn(GLenum mode, GLint first, GLsizei count) override;
138133
void glDrawElementsFn(GLenum mode,
139134
GLsizei count,
@@ -145,7 +140,6 @@ class GL_EXPORT RealGLApi : public GLApiBase {
145140

146141
void glUseProgramFn(GLuint program) override;
147142

148-
void set_gl_workarounds(const GLWorkarounds& workarounds);
149143
void set_version(std::unique_ptr<GLVersionInfo> version);
150144
void ClearCachedGLExtensions();
151145

@@ -159,7 +153,6 @@ class GL_EXPORT RealGLApi : public GLApiBase {
159153
std::vector<std::string> filtered_exts_;
160154
std::string filtered_exts_str_;
161155

162-
GLWorkarounds gl_workarounds_;
163156
std::unique_ptr<GLVersionInfo> version_;
164157
};
165158

ui/gl/gl_workarounds.h

-21
This file was deleted.

0 commit comments

Comments
 (0)