Skip to content

Commit 18d14ff

Browse files
committed
Remove Adreno 3xx flip workaround
1 parent 8b2739e commit 18d14ff

File tree

4 files changed

+3
-21
lines changed

4 files changed

+3
-21
lines changed

drivers/gles3/rasterizer_gles3.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ typedef void(GLAPIENTRY *DebugMessageCallbackARB)(DEBUGPROCARB callback, const v
207207

208208
void RasterizerGLES3::initialize() {
209209
Engine::get_singleton()->print_header(vformat("OpenGL API %s - Compatibility - Using Device: %s - %s", RS::get_singleton()->get_video_adapter_api_version(), RS::get_singleton()->get_video_adapter_vendor(), RS::get_singleton()->get_video_adapter_name()));
210-
211-
// FLIP XY Bug: Are more devices affected?
212-
// Confirmed so far: all Adreno 3xx with old driver (until 2018)
213-
// ok on some tested Adreno devices: 4xx, 5xx and 6xx
214-
flip_xy_workaround = GLES3::Config::get_singleton()->flip_xy_workaround;
215210
}
216211

217212
void RasterizerGLES3::finalize() {
@@ -431,19 +426,11 @@ void RasterizerGLES3::_blit_render_target_to_screen(DisplayServer::WindowID p_sc
431426

432427
Vector2 screen_rect_end = p_blit.dst_rect.get_end();
433428

434-
// Adreno (TM) 3xx devices have a bug that create wrong Landscape rotation of 180 degree
435-
// Reversing both the X and Y axis is equivalent to rotating 180 degrees
436-
bool flip_x = false;
437-
if (flip_xy_workaround && screen_rect_end.x > screen_rect_end.y) {
438-
flip_y = !flip_y;
439-
flip_x = !flip_x;
440-
}
441-
442-
Vector2 p1 = Vector2(flip_x ? screen_rect_end.x : p_blit.dst_rect.position.x, flip_y ? screen_rect_end.y : p_blit.dst_rect.position.y);
443-
Vector2 p2 = Vector2(flip_x ? p_blit.dst_rect.position.x : screen_rect_end.x, flip_y ? p_blit.dst_rect.position.y : screen_rect_end.y);
429+
Vector2 p1 = Vector2(p_blit.dst_rect.position.x, flip_y ? screen_rect_end.y : p_blit.dst_rect.position.y);
430+
Vector2 p2 = Vector2(screen_rect_end.x, flip_y ? p_blit.dst_rect.position.y : screen_rect_end.y);
444431
Vector2 size = p2 - p1;
445432

446-
Rect2 screenrect = Rect2(Vector2(flip_x ? 1.0 : 0.0, flip_y ? 1.0 : 0.0), Vector2(flip_x ? -1.0 : 1.0, flip_y ? -1.0 : 1.0));
433+
Rect2 screenrect = Rect2(Vector2(0.0, flip_y ? 1.0 : 0.0), Vector2(1.0, flip_y ? -1.0 : 1.0));
447434

448435
glViewport(int(MIN(p1.x, p2.x)), int(MIN(p1.y, p2.y)), Math::abs(size.x), Math::abs(size.y));
449436

drivers/gles3/rasterizer_gles3.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ class RasterizerGLES3 : public RendererCompositor {
5656
float delta = 0;
5757

5858
double time_total = 0.0;
59-
bool flip_xy_workaround = false;
6059

6160
#ifdef WINDOWS_ENABLED
6261
static bool screen_flipped_y;

drivers/gles3/storage/config.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ Config::Config() {
212212
//Adreno 3xx Compatibility
213213
const String rendering_device_name = String::utf8((const char *)glGetString(GL_RENDERER));
214214
if (rendering_device_name.left(13) == "Adreno (TM) 3") {
215-
flip_xy_workaround = true;
216215
disable_particles_workaround = true;
217216

218217
// ignore driver version 331+
@@ -229,8 +228,6 @@ Config::Config() {
229228
// OpenGL ES 3.0 [email protected] (GIT@09fef447e8, I1fe547a144, 1661493934) (Date:08/25/22)
230229
String driver_version = gl_version.get_slice("V@", 1).get_slicec(' ', 0);
231230
if (driver_version.is_valid_float() && driver_version.to_float() >= 331.0) {
232-
flip_xy_workaround = false;
233-
234231
//TODO: also 'GPUParticles'?
235232
//https://github.com/godotengine/godot/issues/92662#issuecomment-2161199477
236233
//disable_particles_workaround = false;

drivers/gles3/storage/config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class Config {
9898

9999
// Adreno 3XX compatibility.
100100
bool disable_particles_workaround = false; // Set to 'true' to disable 'GPUParticles'.
101-
bool flip_xy_workaround = false;
102101

103102
// PowerVR GE 8320 workaround.
104103
bool disable_transform_feedback_shader_cache = false;

0 commit comments

Comments
 (0)