Skip to content
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
Remove Adreno 3xx flip workaround
  • Loading branch information
Summersay415 committed Jul 28, 2025
commit 18d14ff18e3a5a42faad4f439f3d957be85e4a6d
19 changes: 3 additions & 16 deletions drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,6 @@ typedef void(GLAPIENTRY *DebugMessageCallbackARB)(DEBUGPROCARB callback, const v

void RasterizerGLES3::initialize() {
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()));

// FLIP XY Bug: Are more devices affected?
// Confirmed so far: all Adreno 3xx with old driver (until 2018)
// ok on some tested Adreno devices: 4xx, 5xx and 6xx
flip_xy_workaround = GLES3::Config::get_singleton()->flip_xy_workaround;
}

void RasterizerGLES3::finalize() {
Expand Down Expand Up @@ -431,19 +426,11 @@ void RasterizerGLES3::_blit_render_target_to_screen(DisplayServer::WindowID p_sc

Vector2 screen_rect_end = p_blit.dst_rect.get_end();

// Adreno (TM) 3xx devices have a bug that create wrong Landscape rotation of 180 degree
// Reversing both the X and Y axis is equivalent to rotating 180 degrees
bool flip_x = false;
if (flip_xy_workaround && screen_rect_end.x > screen_rect_end.y) {
flip_y = !flip_y;
flip_x = !flip_x;
}

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);
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);
Vector2 p1 = Vector2(p_blit.dst_rect.position.x, flip_y ? screen_rect_end.y : p_blit.dst_rect.position.y);
Vector2 p2 = Vector2(screen_rect_end.x, flip_y ? p_blit.dst_rect.position.y : screen_rect_end.y);
Vector2 size = p2 - p1;

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));
Rect2 screenrect = Rect2(Vector2(0.0, flip_y ? 1.0 : 0.0), Vector2(1.0, flip_y ? -1.0 : 1.0));

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

Expand Down
1 change: 0 additions & 1 deletion drivers/gles3/rasterizer_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class RasterizerGLES3 : public RendererCompositor {
float delta = 0;

double time_total = 0.0;
bool flip_xy_workaround = false;

#ifdef WINDOWS_ENABLED
static bool screen_flipped_y;
Expand Down
3 changes: 0 additions & 3 deletions drivers/gles3/storage/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ Config::Config() {
//Adreno 3xx Compatibility
const String rendering_device_name = String::utf8((const char *)glGetString(GL_RENDERER));
if (rendering_device_name.left(13) == "Adreno (TM) 3") {
flip_xy_workaround = true;
disable_particles_workaround = true;

// ignore driver version 331+
Expand All @@ -229,8 +228,6 @@ Config::Config() {
// OpenGL ES 3.0 [email protected] (GIT@09fef447e8, I1fe547a144, 1661493934) (Date:08/25/22)
String driver_version = gl_version.get_slice("V@", 1).get_slicec(' ', 0);
if (driver_version.is_valid_float() && driver_version.to_float() >= 331.0) {
flip_xy_workaround = false;

//TODO: also 'GPUParticles'?
//https://github.com/godotengine/godot/issues/92662#issuecomment-2161199477
//disable_particles_workaround = false;
Expand Down
1 change: 0 additions & 1 deletion drivers/gles3/storage/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ class Config {

// Adreno 3XX compatibility.
bool disable_particles_workaround = false; // Set to 'true' to disable 'GPUParticles'.
bool flip_xy_workaround = false;

// PowerVR GE 8320 workaround.
bool disable_transform_feedback_shader_cache = false;
Expand Down
Loading