Commit Graph
803 Commits
Author SHA1 Message Date
Henrik Rydgård e009d182ff Merge pull request #22034 from hrydgard/disable-opengl-on-ios
Remove OpenGL support on iOS
2026-08-06 19:38:00 +02:00
Henrik Rydgård ed1956b5fb Merge pull request #22035 from hrydgard/libretro-vulkan-cleanup
Vulkan: remove libretro's global function-pointer wrapper hack - by Claude AI
2026-08-06 18:50:20 +02:00
Henrik Rydgård 092ab42fe7 Clean up ugly usage of the g_nativeLibDir global. Now it's local in VulkanLoader. 2026-08-06 18:12:04 +02:00
Henrik Rydgård 4160414b31 Vulkan: remove libretro's global function-pointer wrapper hack
libretro/libretro_vulkan.cpp got PPSSPP's libretro core working with
RetroArch's Vulkan integration by globally monkey-patching PPSSPP's Vulkan
loader function pointers (vkCreateInstance, vkCreateDevice,
vkCreateSwapchainKHR, vkAcquireNextImageKHR, vkQueuePresentKHR,
vkQueueSubmit, etc.) so the unmodified VulkanContext class would end up
wrapping RetroArch's already-existing VkInstance/VkDevice instead of
creating its own, and so a fake VkSwapchainKHR (a self-managed array of
images synced against RetroArch's retro_hw_render_interface_vulkan
callbacks) could stand in for the real swapchain that libretro's Vulkan
model doesn't have. Flagged in-code as "a wacky wrapper".

Replaces that with first-class support in VulkanContext for the two things
libretro actually needs:

- Adopting an externally-created instance/device instead of faking
  vkCreateInstance/vkCreateDevice: VulkanContext::CreateInstanceExternal()
  adopts RetroArch's VkInstance; CreateDevice() gained optional
  extraDeviceExtensions/extraRequiredFeatures params so RetroArch's
  requirements get merged into a real vkCreateDevice() call;
  ownsInstance_/ownsDevice_ flags (the latter set via
  SetDeviceExternallyOwned()) mean DestroyInstance()/DestroyDevice() skip
  the real vkDestroy* calls when something else owns the object, without
  needing to intercept anything. VulkanLoader gained
  VulkanLoadFromGetInstanceProcAddr() for bootstrapping from a
  host-supplied proc-addr getter instead of dlopen/dlsym-ing the loader
  ourselves - vkGetDeviceProcAddr is resolved via the real instance handle
  (not NULL), since per the Vulkan spec it's not one of the handful of
  commands queryable with a NULL instance.
- A pluggable presentation backend (Common/GPU/Vulkan/VulkanPresentation.h)
  for hosts with no real VK_KHR_swapchain, replacing the fake-swapchain-
  handle trick. VulkanContext::GetPresentation() is null by default, so
  every existing platform's real-swapchain code path is untouched;
  libretro/LibretroVulkanPresentation implements this interface directly
  against retro_hw_render_interface_vulkan, as real class state instead of
  file-scope globals. Several pieces of state that are normally only
  populated as a side effect of ReinitSurface()/InitSwapchain() - the
  graphics queue/queue family index (ChooseQueue() is entangled with
  real-surface presentation-support checks), the swapchain format, and
  the available present modes - needed presentation-aware fallbacks since
  libretro never calls that real-surface path at all.

libretro/LibretroVulkanContext.cpp now drives VulkanContext's real, public
API directly - no more hijacked function pointers, no more fake surface or
swapchain. libretro/libretro_vulkan.cpp is deleted.

Verified with a full build+run in RetroArch (not just compile-time
checks): the libretro Makefile doesn't track header dependencies
(cl.exe doesn't support -MMD/-MP, and Makefile.common never sets up an
equivalent), so a `make clean` full rebuild is required after any header
change to avoid linking stale object code from before the change - several
of the fixes above were initially masked by exactly that.
2026-08-06 17:07:05 +02:00
Henrik Rydgård c490d4ef36 Headless SDL: Add support for Vulkan rendering 2026-08-06 11:06:03 +02:00
Katharine Chui c39205496c bring back VulkanContext::SetCbGetDrawSize for linux wayland
It was removed during https://github.com/hrydgard/ppsspp/pull/21982

On Linux Wayland however this can be observed without:
34:25:550 Vulkan/VulkanContext.cpp:1401 I[G3D]: surfCapabilities_.current: -1x-1
34:25:550 Vulkan/VulkanContext.cpp:1406 I[G3D]: surfCapabilities_.current after clamp: -1x-1 min: 1x1 max: 32768x32768 computed: 1x1 cbdraw
2026-08-06 00:29:21 +02:00
Henrik Rydgård 10a5d2f810 OpenGL: Improve checks for fragment shader float precision.
Fixes #22001 (although there may be other artifacts).
2026-07-30 10:03:15 +02:00
Henrik Rydgård b46566adc2 Logging improvements 2026-07-29 14:42:24 +02:00
Henrik Rydgård 1c40facc4c Vulkan SDL: Remove an old workaround 2026-07-26 19:10:46 +02:00
Henrik Rydgård 3784bbe0e6 Delete the AndroidVulkanContext, replace with the generic VulkanGraphicsContext 2026-07-26 19:10:46 +02:00
Henrik Rydgård e3d36e2741 Move the VulkanGraphicsContext to its correct location in Common/GPU/Vulkan 2026-07-26 14:15:15 +02:00
Henrik Rydgård 7f218acc53 Change the GraphicsContext interface to be more consistent 2026-07-26 10:22:00 +02:00
Henrik Rydgård f5a8ad172e Fix various issues with the headless build (for running frame dumps) 2026-07-19 00:09:06 +02:00
Henrik Rydgård 26313b6314 Log improvements 2026-07-15 12:03:05 +02:00
Henrik Rydgård c1ceea1405 Correct Vulkan initialization for devices that don't support Vulkan 1.1. 2026-07-15 11:57:27 +02:00
Henrik Rydgård cd40e2d4f0 Delete more code related to hardware skinning 2026-07-14 17:17:40 +02:00
Henrik Rydgård 5f7281bd8e Remove old vestiges of geometry shader support 2026-07-08 18:25:08 +02:00
Henrik Rydgård ebc564a465 Centralize handling of another GPU flag 2026-06-27 13:50:03 +02:00
Henrik Rydgård 7b3405ab86 Fix a Vulkan lifetime issue causing invalid descriptors on shutdown
Also simplifies the code a little
2026-06-25 21:56:33 +02:00
Henrik Rydgård 623545bd24 Delete the "Hardware tessellation" feature.
Very hard to maintain and debug, not worth it.
2026-06-16 16:17:14 +02:00
Henrik Rydgård ea8a648737 Refactor UI shader presets, prepare for some updates to the ImGe debugger 2026-06-14 11:08:56 +02:00
Henrik Rydgård e0634f3df9 Assorted cleanup and tweaks 2026-06-13 13:34:41 +02:00
Henrik Rydgård aee05fcebb vkGetDataFormatSupport is surprisingly expensive on some devices, cache it. 2026-06-13 13:34:38 +02:00
Henrik Rydgård 928cdea420 Fix vulkan validation error after #21616
See #21616
2026-06-05 10:09:23 +02:00
jasaaved 5e25118043 Fix the exclusive fullscreen config guard and switching the setting on/off
Previously the exclusive fullscreen option in the settings screen was
guarded by a compile-time #ifdef VK_EXT_full_screen_exclusive, which is
always true on Windows. It now uses a runtime fullScreenExclusiveSupported
cap derived from whether the extension is actually enabled by the driver.

Switching between borderless and exclusive fullscreen currently requires a
restart. This is because once DWM has claimed the window (any frames
presented), ALLOWED_EXT cannot re-engage exclusive mode on an existing
swapchain. A new process gets a fresh HWND that DWM has not claimed yet,
so ALLOWED_EXT works correctly at startup.

The proper fix is to use VK_FULL_SCREEN_EXCLUSIVE_APPLICATION_CONTROLLED_EXT
with vkAcquireFullScreenExclusiveModeEXT/vkReleaseFullScreenExclusiveModeEXT
to explicitly negotiate exclusive mode with DWM mid-session without needing
a restart. To be done in a follow-up.
2026-06-03 17:15:13 -07:00
jasaaved 0c23cdaf3d Windows Vulkan: default to borderless fullscreen, add exclusive option
Vulkan swapchain now explicitly sets VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT by default, enabling proper borderless fullscreen behavior with benefits including better Alt+Tab, VRR/G-Sync/FreeSync, and Auto HDR support.
2026-06-03 17:15:13 -07:00
Henrik Rydgård f60e27a9b7 Just some refactoring of the GPUStatistics struct, and more use of StringWriter 2026-05-29 14:40:31 +02:00
Henrik Rydgård 9845a78a46 Vulkan: Correct handling of VK_ERROR_OUT_OF_DATE_KHR 2026-05-28 10:56:35 +02:00
Herman Semenoff b1d140e8e7 OpenGL/Vulkan/UI: duplicate fields move to separate const reference var 2026-05-27 12:26:12 +02:00
Herman Semenoff eaae4dca82 Vulkan: duplicate fields move to separate const reference var 2026-05-27 12:23:47 +02:00
Henrik Rydgård dd125b2e4d Delete obsolete (and non-working) support for GPUs without non-pow-2 textures. 2026-05-24 14:15:34 +02:00
Henrik Rydgård 4a420c95c2 Remove some redundant device caps, show clip/cull/depth-clamp in system info 2026-05-21 11:59:26 +02:00
Henrik Rydgård 947217d1be Convert the pre-rotation to just the matrix multiplication. 2026-05-17 10:59:40 +02:00
Henrik Rydgård 85ddf03c4b Vulkan: Remove deprecated use of device layers 2026-05-13 23:09:04 +02:00
Henrik Rydgård 28166cb35d Add "allocation slack" to our pushbuffers. Fixes a memory overwrite bug
Reported by Joseph on Discord.

Sometimes, things could align perfectly so allocations happend exactly
at the end of a pushbuffer. At the same time, we allow our vertex decoder to write an extra few
bytes if it needs to for speed. Unfortunately I missed this interaction,
resulting in some uncommon crashes that were especially common with
heavy-geometry things like modified GTA LCS with PS2 assets, for
example.

The problem was reported with Vulkan, but our OpenGL backend had the
same issue too.
2026-05-13 15:55:34 +02:00
Henrik Rydgård ed274c8a7e Just some lint fixing 2026-05-13 11:37:26 +02:00
Henrik Rydgård 575e08ff6c Merge pull request #21589 from hrydgard/assorted-ui-fixes
Fix display of HTTP links in recents list
2026-04-24 13:21:19 +02:00
Henrik Rydgård b2d0b8e3cc Improve display of http links in recents list 2026-04-23 16:55:29 +02:00
Henrik Rydgård d108fe25d1 Rework constant buffer loading, barrier fix 2026-04-23 13:32:06 +02:00
Henrik Rydgård 4c2be7f8af More work. Some initialization order problem. 2026-04-23 13:31:51 +02:00
Henrik Rydgård 4335a327cd Hackery to prepare for constant buffers in compute 2026-04-23 13:31:51 +02:00
Henrik Rydgård 317f811ca2 Slight improvement to our terrible GPU performance heuristic 2026-04-07 11:39:39 -06:00
Henrik Rydgård 02a624075a Android: Make the "Auto" rotation mode override user rotation lock (SENSOR mode) 2026-03-31 10:43:27 -06:00
Henrik Rydgård 3083d37728 Add support for the raintegration menu rebuild event 2026-03-26 17:18:12 -06:00
Henrik Rydgård 7e3079b035 VulkanRenderManager: Try to survive StopThreads being called twice (shouldn't happen, but...) 2026-03-13 10:33:00 +01:00
Henrik Rydgård 845f9f3d55 Add missing check to Vulkan init. Disable validation on android-x86-64
The latter is broken in the Android SDK emulator.
2026-02-27 23:57:50 +01:00
Henrik Rydgård 9097dd935a Somewhat improve the UI of the adhoc server list 2026-02-26 17:17:42 +01:00
Henrik Rydgård e50199ad0a Fix the gemini-written video player to actually work 2026-02-26 09:33:26 +01:00
Henrik Rydgård 5aeb38412d Fix another valgrind warning 2026-02-19 11:46:14 +01:00
Henrik Rydgård 5a5c7028b9 Assorted warning fixes and data initialization to please valgrind 2026-02-19 11:24:46 +01:00