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

[GSoC 2019] RetroPlayer: OpenGL back-end for shaders #114

Draft
wants to merge 5 commits into
base: feature_shaders_gl
Choose a base branch
from

Conversation

gusandrianos
Copy link

@gusandrianos gusandrianos commented Aug 23, 2019

Description

This PR extends the functionality #86 brought to RetroPlayer by introducing support for other platforms through an OpenGL implementation.
The code in this PR is part of this GSoC project

In short, this code adds support for multi-pass shader presets, as defined in the libretro spec, which opens a whole new world of customization to the look and feel of games, through the massive amount of presets available in this format.

While the spec is written with cg shaders in mind, it is also extended to GLSL and slang shaders.

You can read more about the current state of my solution, what works and what doesn't(yet), here.

Motivation and Context

Shaders can be used to:

  • Scale lower resolution games to higher resolutions
  • Emulate the look of CRT or other types of monitors
  • Apply noise reduction or anti-aliasing filters

Of course, the list goes on. Most importantly, shaders can be used to elevate the gameplay experience and make it more immersive. A game can either look like it's being displayed on a CRT or a Gameboy or an LCD monitor or be upscaled and viewed on a 4K monitor, the possibilities are endless.

Regarding the commits in this PR.

I should mention that the last commit that falls under the GSoC umbrella is this one. Anything that follows it should not be considered as part of the GSoC project.

Let's give you some context about each commit.
The first three commits are setting up the relevant parts of code for usage in the next commit.
The fourth commit contains all the work that involves the processing and rendering of the shader presets.
The fifth commit connects the code to RetroPlayer.

How Has This Been Tested?

I took a brute force approach by testing almost every preset in the glsl-shaders repo. It has only been tested on Linux and it is unknown if it works on other platforms that use OpenGL.

To test this code yourself

  • Build Kodi using the guides on the main repository
  • Download and install the game.shader.presets binary add-on
  • Get the latest glsl-shaders from libretro's repository
  • Extract the shaders in /your/kodi/directory/addons/game.shader.presets/resources/libretro/glsl
  • Replace the contents of ShaderPresetsDefault.xml in the resources directory with this file. This is a temporary workaround, I will update the add-on to choose the correct file depending on the situation.

Screenshots (if appropriate):

Here's a video that demonstrates what these changes do.
YouTube Demo

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)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@gusandrianos gusandrianos force-pushed the retroplayer-shaders-gsoc19 branch 8 times, most recently from e4c7260 to e6e3dab Compare August 23, 2019 22:28
@gusandrianos gusandrianos changed the title Retroplayer: OpenGL back-end for shaders RetroPlayer: OpenGL back-end for shaders Aug 24, 2019
@garbear
Copy link
Owner

garbear commented Sep 2, 2019

@KostasAndrianos can you cherry-pick these 7 commits? 327d997~7...327d997

@gusandrianos gusandrianos force-pushed the retroplayer-shaders-gsoc19 branch 5 times, most recently from f5e103b to def1361 Compare September 2, 2019 09:42

unsigned int numPasses = static_cast<unsigned int>(m_passes.size());

for (unsigned shaderIdx = 0; shaderIdx < numPasses; ++shaderIdx)

Choose a reason for hiding this comment

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

Lines from here to 267 are copied as-is from D3D and should be moved to common code since they're not backend specific. Probably just a method with the passes as input and the scaled size as output.

Copy link
Author

Choose a reason for hiding this comment

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

Indeed, will do that

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, there's lots of places where common code can be factored out. The good news is duplication got us this far, and now these places are easy to find.

@gusandrianos gusandrianos force-pushed the retroplayer-shaders-gsoc19 branch from 79b1e74 to d23157e Compare October 11, 2019 20:16
@@ -76,6 +85,8 @@ namespace RETRO

virtual void Render(uint8_t alpha);

std::map<CRenderBufferOpenGL*, std::unique_ptr<RenderBufferTextures>> m_RBTexturesMap;
Copy link
Owner

Choose a reason for hiding this comment

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

Missing the header <memory>; added in gusandrianos#2

if (it != m_RBTexturesMap.end())
{
rbTextures = it->second.get();
} else {
Copy link
Owner

Choose a reason for hiding this comment

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

Style infraction; fixed in gusandrianos#2

@gusandrianos gusandrianos force-pushed the retroplayer-shaders-gsoc19 branch from e461396 to db8f7fc Compare October 18, 2019 16:51
namespace KODI
{
namespace RETRO
{
class CRenderContext;
class CRenderBufferOpenGL;
Copy link
Owner

Choose a reason for hiding this comment

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

Alphabetize to reduce likelihood of git conflicts

@garbear garbear force-pushed the feature_shaders_gl branch 4 times, most recently from 7d3fc5e to 7368539 Compare March 9, 2020 07:00
@garbear garbear force-pushed the feature_shaders_gl branch from d58a368 to b80fd1e Compare October 29, 2020 12:25
@gusandrianos gusandrianos force-pushed the retroplayer-shaders-gsoc19 branch from ecb8114 to b8b6546 Compare March 14, 2021 11:06
@gusandrianos gusandrianos marked this pull request as draft March 14, 2021 11:08
@KOPRajs
Copy link

KOPRajs commented Jan 6, 2025

Ok, so I've got the GL environment back online and I've successfully built Kodi with the latest patches.

Since it contains both the GL support and the Achievements, I need the game.libretro with API 5.0.0. Where do I find the latest sources?

Also, might be worth to note that I needed to manually downgrade Flatbuffers. It seems that it was updated to 23.3.3 for Omega: xbmc@35be40d

I was not able to build your current branch against it and I needed to downgrade it back to 2.0.0.

@KOPRajs
Copy link

KOPRajs commented Jan 6, 2025

Where do I find the latest sources?

I've found it here: https://github.com/kodi-game/game.libretro/tree/retroplayer-omega

@KOPRajs
Copy link

KOPRajs commented Jan 7, 2025

So, I've successfully runtime tested the latest patches for both GL and GLES and I've got the shaders working. No idea why it renders black on macOS for you. Can you please find out in which version it stopped working?

While getting the GL environment back online, I've found out some unfinished work left in the local repo, so I'll try to finish this now and maybe I'll try to sync the rest of the shader code between DX and GL.

@garbear
Copy link
Owner

garbear commented Jan 7, 2025

I was not able to build your current branch against it and I needed to downgrade it back to 2.0.0.

If my branch is hard to build it's because I've backported over a hundred PRs to keep the work on top of the history able to be applied cleanly against master with zero lines of conflicts. But as a result, everything on top of the history applies cleanly against master, so you can create your own fork of master and cherry-pick any of our work instead of working on retroplayer-21.1, if you want.

Sadly, I wanted both v21 stability for my main build running the apartment, and zero technical debt for all the RetroPlayer work. That's lead to the nightmare of retroplayer-21.1, which is now a fork as different from upstream as v21 is from v22. The cost is now working on retroplayer-21.1 too, or spending git fu effort to share commits with master. But fortunately with the zero technical debt, any shader work is PRd against master without any rebasing effort.

Can you please find out in which version it stopped working?

Unfortunately I've only been working on macOS ARM since my workstation was in pieces on my floor needing a new CPU, which is basically since that November release, so I've never seen shaders work on macOS ARM. Luckily Kodi has a policy that broken platforms don't block working platforms.

While getting the GL environment back online, I've found out some unfinished work left in the local repo, so I'll try to finish this now and maybe I'll try to sync the rest of the shader code between DX and GL.

Syncing the shader code is needed to open our shader PR, and is the last step before DX is ready to upstream.

The bigger problem is syncing code between GL and GLES. xbmc#25207 broke our GL/GLES shaders instantly. I had to #ifdef a GLES texture into the GL code. That's right, GLES became dependency of all GL platforms! We clearly can't have that, and GL/GLES need to be refactored so that GL uses GL textures and GLES uses GLES textures.

@KOPRajs
Copy link

KOPRajs commented Jan 7, 2025

Sadly, I wanted both v21 stability for my main build running the apartment, and zero technical debt for all the RetroPlayer work. That's lead to the nightmare of retroplayer-21.1, which is now a fork as different from upstream as v21 is from v22.

I'm not sure that the issue with Flatbuffers is related to your branch. It seems that the build script was updated with the new version of Flatbuffers (in master), but the savestates code in Kodi is not compatible with it.

P. S. I started the work on the code clean up and syncing the DX and the GL files. For now I'm not sure what would be the best way to get rid of the GLES ifdefs. If we split the GL and GLES code, there is going to be a lot of duplicate code. It actually does not seem to be that bad with the ifdefs to me.

@garbear
Copy link
Owner

garbear commented Jan 7, 2025

I'm not sure that the issue with Flatbuffers is related to your branch. It seems that the build script was updated with the new version of Flatbuffers (in master), but the savestates code in Kodi is not compatible with it.

I've been meticulous in backporting all flatbuffers stuff from master to my branch. Cleaning the repo and rebuilding from scratch could fix the problem.

If we split the GL and GLES code, there is going to be a lot of duplicate code.

Kodi has faced the problem in the past. We agreed that while duplicate code should be avoided, it's sometime beneficial to take on lots of duplicated code to focus on cleaning up architecture and achieving good code separation. Architecture is far more important than code duplication.

@KOPRajs
Copy link

KOPRajs commented Jan 8, 2025

I've done the clean up and the sync between DX and GL code:
KOPRajs@906c62a

There are no real changes in the code apart from a few removed lines that were not in use, removed old comments, removed unused declaration created by the copy/paste from DX to GL etc. I've synced the headers and then sync the order of functions to match the headers, synced comments, white spaces etc.

This time I've done proper testing in both Windows and Linux (GL/GLES).

EDIT: Even when you look a hundred times, you always find another thing to fix just after you post the changes. I needed to amend the commit once more, sorry.

@garbear
Copy link
Owner

garbear commented Jan 8, 2025

Really nice cleanup. This is definitely needed, as shaders are still largely student code (absolutely no shade on students, they're just by definition learning the styles and abstractions used across the codebase). The more cleanup like this we do, the less work reviewers will have, and the quicker it'll be merged.

I think the only big problem left is that we absolutely cannot do my hack when rebasing on xbmc#25207:

--- a/xbmc/guilib/CMakeLists.txt
+++ b/xbmc/guilib/CMakeLists.txt
@@ -164,8 +164,10 @@ set(HEADERS DDSImage.h
             XBTFReader.h)
 
 if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET ${APP_NAME_LC}::OpenGLES)
-  list(APPEND SOURCES Shader.cpp)
-  list(APPEND HEADERS Shader.h)
+  list(APPEND SOURCES Shader.cpp
+                      TextureGLES.cpp)
+  list(APPEND HEADERS Shader.h
+                      TextureGLES.h)
 
   if(TARGET ${APP_NAME_LC}::OpenGl)
     list(APPEND SOURCES GUIFontTTFGL.cpp
@@ -178,11 +180,9 @@ if(TARGET ${APP_NAME_LC}::OpenGl OR TARGET ${APP_NAME_LC}::OpenGLES)
 
   if(TARGET ${APP_NAME_LC}::OpenGLES)
     list(APPEND SOURCES GUIFontTTFGLES.cpp
-                        GUITextureGLES.cpp
-                        TextureGLES.cpp)
+                        GUITextureGLES.cpp)
     list(APPEND HEADERS GUIFontTTFGLES.h
-                        GUITextureGLES.h
-                        TextureGLES.h)
+                        GUITextureGLES.h)
   endif()
 
 endif()

That's the GL/GLES separation I was talking about.

Once that's solved, we can start thinking about a PR.

@KOPRajs
Copy link

KOPRajs commented Jan 8, 2025

I'm not able to help with this. To be honest, I'm not a real developer myself, more like an older student.

However, I can probably finish the left over work from last year, so expect a few more updates in the next days. Hopefully this time it is going to be something actually visible for the users.

P. S. I've updated the clean up commit, so please make sure you'll get the latest version from the https://github.com/KOPRajs/xbmc/tree/retroplayer-21.1 branch.

@garbear
Copy link
Owner

garbear commented Jan 8, 2025

Cool, clean and fix away. As a future project I'll do the GL/GLES separation.

Kodi v21.2 is going to be released in the next few days. When it's out I'll pull all your changes and do a 21.2 RP release.

@KOPRajs
Copy link

KOPRajs commented Jan 14, 2025

I've added another piece of the puzzle which brings us closer to full support of RA shader presets:
https://github.com/KOPRajs/xbmc/commits/retroplayer-21.1

The "Fix GLSL header and version" commit address 2 issues:

  1. Set the PARAMETER_UNIFORM define unconditionally for both vertex and fragment shader source code.
    This fixes shader presets which use parameters for the vertex shader (e.g. psp-2x.glslp).

  2. Fix the MoveVersionToFirstLine() function and set correct GLSL version.
    This fixes shaders which define GLSL version in the source (e.g. xbr-lv3.glslp). Previously all xBR shaders failed to compile and were rendered black, now they seem to work fine!
    For shaders without the version explicitly set, we set it according to the supported GL version.
    When testing this, I've found out that for OpenGL ES setting the GLSL version according to the GLES version breaks things. Looking into the RA source code it seems that it doesn't set the GLSL version for GLES either, so I did the same.
    Also, there is a small hope that this fix might make the GL shaders work in the macOS (if the missing version tag was the cause for the failed shader compilation).

Relevant RA source part for comparing the logic can be found here:
https://github.com/libretro/RetroArch/blob/0bb00773582414e4ea8db40636ec94639e4ac1ea/gfx/drivers_shader/shader_glsl.c#L494
https://github.com/libretro/RetroArch/blob/0bb00773582414e4ea8db40636ec94639e4ac1ea/gfx/drivers_shader/shader_glsl.c#L363

Supported GLSL version table can be found here:
https://en.wikipedia.org/wiki/OpenGL_Shading_Language

I've tested it on both GL and GLES and it seems to work fine.

P. S. Sorry for adding yet another GLES ifdef, at least this one should be easy to split.

Screenshot_20250114_164721
Screenshot_20250114_164840
Screenshot_20250114_164916

@garbear
Copy link
Owner

garbear commented Jan 14, 2025

Nice! I just released all our work. https://github.com/garbear/xbmc/releases/tag/retroplayer-21.1-20250114

@KOPRajs
Copy link

KOPRajs commented Jan 15, 2025

Why are the GL shaders disabled in the latest builds? Are you planning to upstream the DX shaders only?

A year ago, when I started fixing the most visible bugs in the GL shader code, I've proposed a change in the video filters UI. It is at the end of this post and then several posts below there are even pictures and mockups.
https://forum.kodi.tv/showthread.php?tid=173361&pid=3189974#pid3189974

What do you think about the proposed change in the UI? I still believe it is needed and that it should be done before the PR, because it actually removes the translated strings for the shaders. I'm probably not able to do the new UI myself, but at least we should remove the translated strings and fallback to filenames. There are many shaders that actually doesn't have any name apart from the filename.

P. S. Have you tested the latest changes on the macOS?

@garbear
Copy link
Owner

garbear commented Jan 15, 2025

Why are the GL shaders disabled in the latest builds? Are you planning to upstream the DX shaders only?

We had a bug reported by a user that I see on my macbook, where textures get all messed up. Here's the report: https://forum.kodi.tv/showthread.php?tid=378606&pid=3222009#pid3222009

I reverted just shaders so we can see if it fixes the glitch to narrow it down to one of our commits. I'll post a screenshot below.

  • Move the ShaderPresetsXXXX.xml to userdata/addon_data/game.shader.presers/, so it is user editable.

Good idea. We can check if this exists and use it, else fall back to the shipped XML in user add-ons, else fallback to the shipped XML in system add-ons.

  • Make the other filters removable from the list by a context menu (just like we did for savestates).
  • Create a "+" button in the end of the list which will open the standard browse file dialog and allow adding new filters (we can reuse the "+" button from savestates).
  • Create a "+" button in the end of the list which will open the standard browse file dialog and allow adding new filters (we can reuse the "+" button from savestates).
  • Optionally add a context menu item to move the current filter left or right in the list, so users can change order of the filters.

I hesitate to make shaders editable in the UI. It adds a lot of UI complexity, vs plopping files into userdata and editing an XML file and having them automatically show up. The thing I appreciate most about the current dialog is how simple it is. UI code is expensive, XML code is cheap.

  • Get rid of the "Category" and "Name" translated strings. It is impossible to get strings for every shader preset out there. Instead use the preset filename without suffix.

Agreed, getting rid of strings would be good. We could just show the filename without suffix.

P. S. Have you tested the latest changes on the macOS?

I'll test it now.

@garbear
Copy link
Owner

garbear commented Jan 15, 2025

Shaders work on macOS now!

Here's what happens with the glitch:

When I browse shaders and return to the GUI, textures get messed up.

Sometimes it's minor glitches

Screenshot 2025-01-15 at 10 24 38 AM

Sometimes it's the whole UI

Screenshot 2025-01-15 at 10 25 43 AM

The first image was after loading a shader or two, the second image was after I scrolled through all of them.

I may or may not have seen this glitch after playing a game without showing any shaders, which would be a bug in the GL renderer.

@KOPRajs
Copy link

KOPRajs commented Jan 15, 2025

Ok, so first of all we need to know, if it is related to the shader support. Unfortunately, I'm not able to reproduce this on Linux.

Second, we need to know what GL renderer is being used by the RP on your macOS: DMA, GL, GLES? Can you try to switch between GL and GLES build?

@KOPRajs
Copy link

KOPRajs commented Jan 15, 2025

The thing I appreciate most about the current dialog is how simple it is.

Have you seen the mockup pictures? The dialog is still the same, we would only need to add a context menu and the Add button either to the context menu or re-use the design from savestates as shown on the picture.

@garbear
Copy link
Owner

garbear commented Jan 15, 2025

Have you seen the mockup pictures? The dialog is still the same, we would only need to add a context menu and the Add button either to the context menu or re-use the design from savestates as shown on the picture.

You're right, it's a manageable amount of UI work. I like the idea, it's pretty cool.

@KOPRajs
Copy link

KOPRajs commented Jan 17, 2025

I've added new changes. Please test these on the macOS, if you can.

Apart from even more clean ups and minor fixes, we now have working sRGB framebuffer support on GL (I've tested it on cubic-gamma-correct.glslp and now I get the same output when compared to RA). In theory it should work on GLES3 as well (GLES2 is not supported), but I haven't found any shaders using sRGB and being compatible with the current state of support in RP, so I can't verify if it actually works for GLES.

Here is a summary of known issues and features, that we are still missing:

  1. Usage of optimal FBO texture sizes is temporary disabled, because it is causing scaling issues for both DX and GL.
  2. We are probably not passing all the runtime parameters needed by the shaders. It seems that each shader pass should have access to parameters of previous passes, not just its own (texture sizes etc.). Also there should be separate TexCoords defined for LUTs etc. When this is solved, the issue from point 1 will be possibly solved as well.
  3. It also seems that each shader pass should have access to input buffer of previous passes. For example the 4th pass of crt-easymode-halation.glslp is trying to access PassPrev3Texture. I don't even know which texture this should be, but it is not there.
  4. Mipmapping for the framebuffer textures is not implemented.
  5. Real-time parameters changing is not implemented, but I can think of how this can be added later by a context menu item added to the existing UI.

Anyway, a lot of shaders are working for both DX and GL/GLES. When we hunt down the GUI corruption bug, we are IMHO ready for the merge. It would be nice to have the proposed UI update before the merge as well + the GL / GLES refactor and split.

@garbear
Copy link
Owner

garbear commented Jan 17, 2025

Nice, stellar progress!

I did a new release with GL/GLES shaders enabled. I marked the one with them disabled as a test release, and linked to it for testers.

The release includes all your work available at the time, which was up until [Use triangle strip topology](https://github.com/KOPRajs/xbmc/commit/2b28a61b79ebdc084177865c1c3340514528e7c3). Hopefully it can get you feedback!

Thanks for being so detailed in your summaries. I reference everything I can find when making presentations for the team!

I'll give the commit a try on macOS.

@KOPRajs
Copy link

KOPRajs commented Jan 17, 2025

I've updated the summary a bit more. To be honest, I'm writing the summary primary for myself, so I don't forget already discovered issues, but it can serve as a starting point for anyone else trying to fix more shaders.

I marked the one with them disabled as a test release, and linked to it for testers.

Does this version solve the GUI issue?

Second, we need to know what GL renderer is being used by the RP on your macOS: DMA, GL, GLES? Can you try to switch between GL and GLES build?

How about this?

@garbear
Copy link
Owner

garbear commented Jan 18, 2025

Sorry, I've been consumed with being Release Manager the last few days. I've broken so many things! Not to mention incurring extra server costs and breaking binary add-ons for all windows installs.

Anyway, I'll try your latest branch on macos now. After 21.2 goes out today I'll do another release with your latest work.

@garbear
Copy link
Owner

garbear commented Jan 18, 2025

Shaders work great on macOS now. A couple are still black.

The texture corruption still persists after using shaders.

Screenshot 2025-01-18 at 12 42 11 PM

@KOPRajs
Copy link

KOPRajs commented Jan 18, 2025

What API are you using? GL or GLES? Can you try switch between those and see if the corruption occurs on both of them? And how about the testing version without shaders? Does it solve the corruption?

@garbear
Copy link
Owner

garbear commented Jan 18, 2025

macOS uses GL. But keep in mind we #ifdef in GLES textures. I don't think I can run in GLES on macos. No corruption without shaders.

@KOPRajs
Copy link

KOPRajs commented Jan 18, 2025

I would be surprised if you can't build it for GLES on macOS. Just try to switch gl for gles upon configure and rebuild.

@garbear
Copy link
Owner

garbear commented Jan 18, 2025

macOS is a depends build and configure is done in tools/depends before building depends. This determines what all the cmake stuff does. GLES isn't an option when building macos as far as i can see in the documentation.

EDIT: I think I found it. ./configure --with-rendersystem=gles

@KOPRajs
Copy link

KOPRajs commented Jan 19, 2025

It seems that you are right and you really can't use GLES context on macOS. At least we know that the corruption occurs on the GL core profile. I've just noticed that your current builds are missing the xbmc#22211. Can you try to include it and then test the shaders on macOS?

P. S. I'm currently trying to figure out how to implement the dynamic shader uniforms (number 2 and 3 from the TODO list above). It seems that we might need to change the logic and structure of the SetShaderParameters() again for both DX and GL because it is going to need access to the other shader passes.

@garbear
Copy link
Owner

garbear commented Jan 19, 2025

It seems that you are right and you really can't use GLES context on macOS. At least we know that the corruption occurs on the GL core profile. I've just noticed that your current builds are missing the xbmc#22211. Can you try to include it and then test the shaders on macOS?

I'll give local VAOs a try again, but I now remember I removed it in 2022 hunting the same graphical glitch, which I got on my Intel macbook all the way back then. I remember the macOS glitch happening when games were played on my RetroPlayer branch, possibly without loading any shaders. It was only my branch (which had VAOs), not vanilla Kodi.

At the end of the day, Apple's OpenGL is from like 2017, so this might be a bug that has to be hunted on a macbook.

P. S. I'm currently trying to figure out how to implement the dynamic shader uniforms (number 2 and 3 from the TODO list above). It seems that we might need to change the logic and structure of the SetShaderParameters() again for both DX and GL because it is going to need access to the other shader passes.

I like the work you've done to unify GL and DX so far. Further refactoring is welcome, especially if slightly different architecture is needed.

Ideally more of the stuff should be put behind an IInterface, which enforces sharing of logic. But that increases code size, so such abstraction isn't always worth it. We currently only have basic abstraction in the shader code, which is fine to upstream, but IMO more abstraction would make the code clearer by sharing some logic between the graphics APIs.

@KOPRajs
Copy link

KOPRajs commented Jan 22, 2025

I wanted to simply remove the DX specific functions from the GL code, before I started implementing changes needed for the frame uniforms (issue 2 and 3 from the TODO list), but I ended up doing another round of cleanups all around. The two new commits don't add anything for the user. If we are lucky, they don't break anything neither:
https://github.com/KOPRajs/xbmc/commits/retroplayer-21.1/

Now I can finally try to implement something useful to get the remaining GLSL shaders working.

EDIT: Tested on both DX and GL and it seems to working as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants