Skip to content

Make ENABLE_OPENGL and ENABLE_VULKAN toggle associated code when compiling#1887

Merged
Exzap merged 37 commits into
cemu-project:mainfrom
emiyl:vulkan-opengl-options
May 9, 2026
Merged

Make ENABLE_OPENGL and ENABLE_VULKAN toggle associated code when compiling#1887
Exzap merged 37 commits into
cemu-project:mainfrom
emiyl:vulkan-opengl-options

Conversation

@emiyl

@emiyl emiyl commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

This will enable building without OpenGL or Vulkan, which helps to build on devices without either graphic API, such as iOS.

Changes

  • Only compile OpenGL and Vulkan specific files when they are enabled
  • Changed a load of if/else statements for graphic APIs to some lovely switch statements instead
  • #ifdef'd all the switch statements and any OpenGL and Vulkan specific functions
  • Created a "RendererCore.cpp" file for functions that all the renderers use.
  • MainWindow is now more resilient if the config shows an unknown graphic API value
  • Fixed an issue in LatteDecompilerAnalyzer where it would check if the API isn't Metal only when Metal was enabled
  • GeneralSettings2 now has an m_api_map, so that graphic API values stay consistent with wxChoice box

@emiyl emiyl marked this pull request as draft April 20, 2026 22:20
@emiyl emiyl changed the title Add compiler options for ENABLE_OPENGL and ENABLE_VULKAN Make ENABLE_OPENGL and ENABLE_VULKAN actually remove relevant code from compiling Apr 20, 2026
@emiyl emiyl changed the title Make ENABLE_OPENGL and ENABLE_VULKAN actually remove relevant code from compiling Make ENABLE_OPENGL and ENABLE_VULKAN remove relevant code from compiling Apr 20, 2026
@emiyl emiyl changed the title Make ENABLE_OPENGL and ENABLE_VULKAN remove relevant code from compiling Make ENABLE_OPENGL and ENABLE_VULKAN toggle associated code from compiling Apr 21, 2026
@emiyl emiyl changed the title Make ENABLE_OPENGL and ENABLE_VULKAN toggle associated code from compiling Make ENABLE_OPENGL and ENABLE_VULKAN toggle associated code when compiling Apr 21, 2026
@emiyl emiyl marked this pull request as ready for review April 21, 2026 02:00

void LatteShader_prepareSeparableUniforms(LatteDecompilerShader* shader)
{
#ifdef ENABLE_OPENGL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why has this been removed? this function has a lot of opengl stuff in it 🤔

@goeiecool9999 goeiecool9999 Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Because the whole file is not compiled now when OpenGL is disabled. I added an ifdef at the call site.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

..oh yeah

@goeiecool9999

goeiecool9999 commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Just a heads up, I have moved all of the index cache stuff from RendererCore back to OpenGLRendererCore. It's only used by OpenGL. Vulkan and Metal have their own implementation

@emiyl

emiyl commented Apr 21, 2026

Copy link
Copy Markdown
Contributor Author

Oh sweet thank you - I wasn't too sure what was needed and what wasn't for those two functions so I kinda just shoved everything over until it built lol - this looks a lot cleaner though

@Exzap Exzap merged commit 0fc7403 into cemu-project:main May 9, 2026
8 checks passed
@emiyl emiyl deleted the vulkan-opengl-options branch May 12, 2026 15:25
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.

3 participants