Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetroPlayer: Fix black screen for RGB emulators on some GLES platforms #16421

Merged
merged 2 commits into from
Nov 17, 2019

Conversation

garbear
Copy link
Member

@garbear garbear commented Jul 31, 2019

Description

This PR fixes the black screen shown in emulators across some GLES platforms.

The problem is visible during gameplay, when the screen is black. However, when the game is paused and the menu appears, the video is correctly shown under the dialog.

The fix adds a new GLES shader that sets the alpha bits to 0xff, removing transparency issues.

Motivation and Context

Fixes kodi-game/game.libretro.stella#5 and others.

Addresses the bug mentioned in #15771

How Has This Been Tested?

Tested using Stella emulator on RPi 3 running LibreELEC.

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)


void main ()
{
vec4 rgb;
Copy link
Member

@VelocityRa VelocityRa Aug 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion for all of main. Simplify the code and not read the 4th component of the texture since it's not used:

void main ()
{
  vec3 rgb = texture2D(m_samp0, m_cord0.xy).rgb;

#if defined(KODI_LIMITED_RANGE)
  rgb *= (235.0 - 16.0) / 255.0;
  rgb += 16.0 / 255.0;
#endif

  gl_FragColor = vec4(rgb, 1.0);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried this and games work, but now GUI textures are having the invisible problem

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm weird, it should be functionally the same.

Copy link
Member Author

@garbear garbear Sep 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must have been stale build files, because I retried your suggestion and found that I made a typo. With the typo fixed, everything works. I'm adding your suggestion to the PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tried this and games work, but now GUI textures are having the invisible problem

I'm seeing a similar issue with OSMC builds. Invisible logos under MyOSMC. Tested using the latest commit as well.

@garbear
Copy link
Member Author

garbear commented Sep 1, 2019

Created a test image for RPi 2: https://github.com/kodi-game/LibreELEC.tv/releases/tag/v9.1-20190901

@garbear
Copy link
Member Author

garbear commented Oct 29, 2019

Uploaded a new image (had a report the last one got corrupted): https://github.com/kodi-game/LibreELEC.tv/releases

@garbear
Copy link
Member Author

garbear commented Oct 30, 2019

Received a report that the new image also fixes black screen. @VelocityRa @gusandrianos look good?

@gusandrianos
Copy link
Contributor

@garbear Not sure what you're talking about... I have yet to add GLES and so far, I haven't noticed any black screen issues, neither on Nvidia nor on Intel GPUs

Copy link
Member

@VelocityRa VelocityRa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gusandrianos was about another issue, not w/ your shaders
lgtm

Copy link
Contributor

@gusandrianos gusandrianos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VelocityRa Yeah, my mistake.
Also lgtm

@dagwieers
Copy link
Contributor

Could this be merged and backported to Leia, please?
This bug is causing most games to fail on Raspberry Pi.

Fixes black screen with RGB emulators on RPi.
@garbear
Copy link
Member Author

garbear commented Nov 13, 2019

Updated for Rechi's style comment. Will merge the PR when jenkins is happy.

@garbear garbear merged commit 0eb515c into xbmc:master Nov 17, 2019
@garbear garbear deleted the black-screen branch November 17, 2019 08:02
@garbear
Copy link
Member Author

garbear commented Nov 17, 2019

Sorry, I missed the 18.5 cutoff. If there's talk of 18.6 I'll do a backport.

@Rechi
Copy link
Member

Rechi commented Nov 17, 2019

@garbear please always set milestone before or right after merging a PR.

@dagwieers
Copy link
Contributor

I know triage isn't fun, but it would be nice if important bugs (like this one) would be labeled or added to a milestone so it wouldn't be forgotten like this.

Especially the milestones functionality of GitHub would make it easy to ensure nothing important gets left behind. Or at least postponing it becomes a deliberate decision, and not an oversight.

The problem with milestones here is that you can't have two milestones set (i.e. one for Leia and one for Matrix)

@DaveTBlake DaveTBlake added this to the Matrix 19.0-alpha 1 milestone Nov 18, 2019
@DaveTBlake
Copy link
Member

DaveTBlake commented Nov 18, 2019

Sorry, I missed the 18.5 cutoff. If there's talk of 18.6 I'll do a backport.

@garbear do the backport, and providing there are some fixes to release I will do a 18.6 release. It is as near we can get to doing RERO

@garbear
Copy link
Member Author

garbear commented Nov 27, 2019

Backport PR is open with test build based on LE 9.2: #16969

EDIT: Build is here: https://github.com/kodi-game/LibreELEC.tv/releases/tag/v9.2-20191126

Maven85 pushed a commit to Maven85/kodi that referenced this pull request Jan 21, 2020
RetroPlayer: Fix black screen for RGB emulators on some GLES platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LE: Black screen after starting Emulator
7 participants