Commit Graph

11653 Commits

Author SHA1 Message Date
Aleksey Samoilov 9ffb458626
wayland: add support for single-pixel-buffer-v1 protocol (#17298)
* wayland: add support for single-pixel-buffer-v1 protocol

* Create single pixel buffer instead of checkerboard if available

* Fix identations
2024-12-29 18:56:32 +01:00
Colin Kinloch e3cc0341b9
wayland: Fix improperly sized commits (#17309)
* Revert "wayland: Ignore splash sized events during splash"

This reverts commit 5ef24debe4.

* wayland: Fix improperly sized commits

* Set viewport on splash commit
* Don't commit "set video mode" viewport update
* Hide the libdecor frame before transitioning to fullscreen
2024-12-29 18:56:17 +01:00
LibretroAdmin 4297f02544 Use returntype for fill_pathname_basedir 2024-12-28 23:11:24 +01:00
Aramis 2c3e53e4e8
fix for closing window (#17301) 2024-12-28 17:26:04 +01:00
LibretroAdmin b8c9665753 Fix typo 2024-12-28 00:44:56 +01:00
LibretroAdmin e6373f2869 Position Latency accurately in statistics 2024-12-28 00:33:40 +01:00
Aleksey Samoilov 4fc6bbe8c2
wayland: improve logging (#17291)
* wayland: improve logging

* wayland: minor cleanup
2024-12-27 15:51:13 +01:00
LibretroAdmin 0d4eeb647a Warning cleanups/unused variables removal 2024-12-27 15:39:32 +01:00
LibretroAdmin 18c85b5ccd Cleanups -
* Less string copies
* Some general cleanups
* Add extra param to runloop_message_queue_push so we can pass size_t
of the message
* Consistent conventions for local variable usage for certain things
2024-12-27 15:13:45 +01:00
LibretroAdmin ed58e4a8d8 Conventionalize len variables:
* In function arguments, use 'size_t len'
* Inside the function, use '_len'
* If you need a seciondary len variable inside the function, use '__len'
2024-12-27 05:51:33 +01:00
Aleksey Samoilov a2d9c74978
wayland: add support for content-type-v1 protocol (#17288)
* wayland: add support for content-type-v1 protocol

* update gitignore, remove generated files

* Fix typos
2024-12-27 00:16:36 +01:00
libretroadmin 95f0297e7f Fix CLI shader loading 2024-12-26 05:10:00 +01:00
libretroadmin 5749a2179d Use members from path_data directly and bypass functions
in gfx_thumbnail_path
2024-12-26 02:48:05 +01:00
libretroadmin 92f134fb87 video_driver_frame - optimize string handling 2024-12-25 23:33:50 +01:00
libretroadmin c477956f23 Cleanups/style nits 2024-12-25 22:52:12 +01:00
libretroadmin 9c71620c53 (gfx_widget_load_content_animation) icon_file can be reduced to NAME_MAX_LENGTH size 2024-12-25 21:34:02 +01:00
Aleksey Samoilov 7887719d42
wayland: add support for cursor-shape-v1 protocol (#17284)
* wayland: add support for cursor-shape-v1 protocol

* Bump required wayland-protocols to 1.32
2024-12-25 08:18:45 -08:00
libretroadmin 9a5b2063b7 Simplify video_shader_replace_wildcards 2024-12-25 06:49:58 +01:00
libretroadmin 44238e909f Consistent viewport naming conventions 2024-12-24 22:50:51 +01:00
libretroadmin 8074a833aa Cleanups/less string copies and indirection 2024-12-24 21:07:31 +01:00
zoltanvb 6a85844b41
Pointer sanitization - x11, udev (#17281)
Adapt the sanitized pointer handling, discussed at #17196 :

X11 driver specific changes:

    make sure pointer position is always within [-0x7fff,0x7fff] by using the confined wrapper
    remove extra "inside" checks, general simplification
    enable pointer offscreen reporting

Udev driver specific changes:

    remove custom calculation and use common viewport translation
    unify pointer query instead of separate _x and _y
    enable pointer offscreen reporting

Other changes:

    more tuning of pointer conversion in video_driver.c for edges
    lightgun button ID conversion moved to input_driver.c
2024-12-24 07:08:58 -08:00
libretroadmin 67b0147a59 Cleanups - menu_entries_get_title returns results of strlcpy 2024-12-24 05:35:36 +01:00
libretroadmin de8f979cb7 less string copies 2024-12-24 05:10:09 +01:00
libretroadmin 772620f6fa gfx_widget_load_content_animation - use fill_pathname more 2024-12-23 06:33:43 +01:00
libretroadmin 442b9bc3da Syntax style nits 2024-12-23 05:44:40 +01:00
libretroadmin ca7e53e3ca string_replace_substring - move out implicit strlen 2024-12-23 00:40:09 +01:00
libretroadmin b90c2d440c Another buildfix 2024-12-22 22:11:19 +01:00
libretroadmin f8317a2a7e C89_BUILD fix 2024-12-22 22:09:54 +01:00
libretroadmin b3e5c578b3 Faster shader capabilities queries 2024-12-22 21:58:51 +01:00
libretroadmin 70f55f5976 video_shader_replace_wildcards - do away with the string arrays
and do string concatenation instead
2024-12-22 19:31:46 +01:00
libretroadmin 6b8466f87a menu_driver_set_thumbnail_system/menu_driver_get_thumbnail_system
just small wrapper functions, remove
2024-12-22 04:53:04 +01:00
zoltanvb 072d949346
Pointer handling sanitization - wayland and libretro.h changes (#17277)
Adapt the sanitized pointer handling, discussed at #17196:

Wayland driver specific changes:
- make sure pointer position is always within [-0x7fff,0x7fff]
  by using the confined wrapper
- enable lightgun to report -0x8000 if pointer is really offscreen
- remove extra "inside" checks
- report same pointer/lightgun coordinates for all ports
- simplify pointer and lightgun handling

Other changes:
- unify "offscreen" condition through input_driver.c
- slight tuning of pointer conversion in video_driver.c
- update libretro.h with explanation and pointer offscreen value
- small fixes on remote retropad test screen
2024-12-21 13:28:27 -08:00
LibretroAdmin 739f2ff55c
Reduce calls to path_remove_extension - use fill_pathname instead (#17270)
* Reduce calls to path_remove_extension - use fill_pathname instead

* More fill_pathname usage
2024-12-20 21:40:58 -08:00
Zach Morris b16f04de0a
Add Named_Logos (#17216)
* Draft:  Add Named_Logos

* Allow selecting Content Logo as a thumbnail display

* Increase pl_thumbnail_download index

to 4 to match the 4 available thumb types

---------

Co-authored-by: Rob Loach <robloach@gmail.com>
2024-12-20 18:52:27 -08:00
zoltanvb 30a656738b
Introduce video_driver_translate_coord_viewport_wrap clamping variant. (#17196)
Add another version of the coordinate translation that will not
report -0x8000 for offscreen values, but instead map the position
to the respective edge (0x7fff/-0x7fff). Not yet in use.

Udev driver updated to use the wrapper, as all other input drivers do.
2024-12-19 13:30:43 -08:00
Eric Warmenhoven 8d640fc048
ios9: Fix using opengles2 context (#17269) 2024-12-19 13:30:01 -08:00
libretroadmin 17fc55c762 fill_pathname_parent_dir_name - small cleanups 2024-12-19 21:05:43 +01:00
libretroadmin 4521f6bcb2 Cleanups 2024-12-18 20:15:58 +01:00
libretroadmin f047c247f9 (gfx/video_shader_parse) Readability 2024-12-18 15:54:42 +01:00
Jefferson Bezerra 5dbfbff6e3
Add upscale 1.66x filter (#17240) 2024-12-08 00:06:14 -08:00
Eric Warmenhoven 4d335c4855
iOS: Fix CAMetalLayer nativeScale confusion (#17225) 2024-12-02 07:52:38 -08:00
libretroadmin 2809421d4e Revert "static variables are initialized to '0' automatically as per C rules"
This reverts commit 2a0984b6e4.
2024-11-19 03:03:13 +01:00
libretroadmin 82e4504968 Revert "(pt. 2) static variables are initialized to '0' automatically as per C rules"
This reverts commit 47410df7a3.
2024-11-19 03:03:05 +01:00
libretroadmin 47410df7a3 (pt. 2) static variables are initialized to '0' automatically as per C rules 2024-11-18 15:59:46 +01:00
libretroadmin 2a0984b6e4 static variables are initialized to '0' automatically as per C rules 2024-11-18 15:33:34 +01:00
sonninnos e09039c77f
Disabled menu buildfixes (#17184)
* Disabled menu buildfixes

* Skip thumbnail features with menu disabled
2024-11-14 13:44:50 -08:00
Bernhard Schelling c039576441
Fix quick shift key presses getting ignored on dinput driver (#17185)
Because shift keys were ignored in the event message  and only issued during polling, a quick key press and release between polling would get ignored.
This change also fixes left alt up key events getting issued (and sent to the core) twice.
2024-11-14 13:44:41 -08:00
Antonio Orefice 2a56a827e8
Add Frametime Uniforms (#17155)
* Initial implementation of CoreAspect uniform

* float -> float_t

* Possibly fix wii_u building

* vulkan: use float instead of float_t;

* slangp: Advertise support of CoreAspect uniform
by defining _RARCH_HAS_COREASPECT_UNIFORM early in the shader source, just after "#extension GL_GOOGLE_cpp_style_line_directive : require"

* CoreAspect + glsl fix: use glUniform1f()

* Add CoreAspectRot uniform.
It reports CoreAspect value or 1/CoreAspect when the content is rotated by 90 or 270 deg.

* Fixed stupid typo

* Just use _HAS_COREASPECT_UNIFORMS to check for CoreAspect uniforms support (was _RARCH_HAS_COREASPECT_UNIFORMS)

* Rename CoreAspect, CoreAspectRot, _HAS_COREASPECT_UNIFORMS to OriginalAspect, OriginlAspectRot, _HAS_ORIGINALASPECT_UNIFORMS

* GLCore: void Pass::build_semantic_float needs glUniform1f.
...how on earth did it worked for UBO !?

* d3d10,11,12, wrong function called by overlook.

* Add test shader, will remove that before PR

* Fix metal rotated aspect reporting

* remove test shader

* Fix C89 Build

* Use OriginalAspectRotated instead of OriginalAspectRot

* Add CoreFPS and FrameTimeDelta Uniforms.
_HAS_ORIGINALASPECT_UNIFORMS is (#)defined and can be used to query for them.

* add test shader

* remote test shader

* Wrong paste.

* gx2: use float

* wrong indentation

* resolved merge conflict

* fix indentation

* Fix comment/Formatting

* Change uniform name from CoreFPS to OriginalFPS

* underliyng references: core_fps -> original_fps
2024-11-12 19:50:59 -08:00
LibretroAdmin e45bc853ec
Revert "Pointer confinement support (opt-in) (#17169)" (#17173)
This reverts commit 90ee413a81.
2024-11-07 07:31:47 -08:00
zoltanvb 90ee413a81
Pointer confinement support (opt-in) (#17169)
New environment set call to enable a bit more sensible handling of
absolute pointing devices (pointer and lightgun). With the
confinement enabled, pointing devices will not return neither
-0x8000 nor (0,0), which was anyway dependent on the input driver,
instead they will stay at the extreme edge.
2024-11-06 15:19:08 -08:00
sonninnos ae202515f6
Integer scale crash fix (#17170) 2024-11-06 14:35:33 -08:00
sonninnos 767be489d9
Custom aspect ratio safeguards (#17168) 2024-11-06 11:06:21 -08:00
sonninnos 71ed81dc38
Integer scale Y axis half step tweak (#17154) 2024-11-03 18:14:27 -06:00
sonninnos 273178b979
Integer scale X axis corrections (#17151)
* Integer scale X axis corrections

* Integer scale: Fall back to normal scale when content is larger than viewport
2024-11-02 09:40:11 -07:00
Antonio Orefice da5ecaa45a
Add OriginalAspect and OriginalAspectRot uniforms (#17123)
* Initial implementation of CoreAspect uniform

* float -> float_t

* Possibly fix wii_u building

* vulkan: use float instead of float_t;

* slangp: Advertise support of CoreAspect uniform
by defining _RARCH_HAS_COREASPECT_UNIFORM early in the shader source, just after "#extension GL_GOOGLE_cpp_style_line_directive : require"

* CoreAspect + glsl fix: use glUniform1f()

* Add CoreAspectRot uniform.
It reports CoreAspect value or 1/CoreAspect when the content is rotated by 90 or 270 deg.

* Fixed stupid typo

* Just use _HAS_COREASPECT_UNIFORMS to check for CoreAspect uniforms support (was _RARCH_HAS_COREASPECT_UNIFORMS)

* Rename CoreAspect, CoreAspectRot, _HAS_COREASPECT_UNIFORMS to OriginalAspect, OriginlAspectRot, _HAS_ORIGINALASPECT_UNIFORMS

* GLCore: void Pass::build_semantic_float needs glUniform1f.
...how on earth did it worked for UBO !?

* d3d10,11,12, wrong function called by overlook.

* Add test shader, will remove that before PR

* Fix metal rotated aspect reporting

* remove test shader

* Fix C89 Build

* Use OriginalAspectRotated instead of OriginalAspectRot
2024-11-02 04:04:12 -07:00
sonninnos cbafa3b513
Integer scale 'smart' tweak (#17139) 2024-10-30 17:56:56 -07:00
sonninnos 8ee6561a26
Vulkan: Use separate matrix for menu (#17134) 2024-10-29 12:03:37 -07:00
Eric Warmenhoven f887ebe301
ios9: buildfix (#17131) 2024-10-28 16:38:19 -07:00
sonninnos c847b02206
Integer overscale GPU screenshot crash fixes (#17118) 2024-10-26 06:45:45 -07:00
Eric Warmenhoven 98c7f20eae
iOS: Fix some minor refresh issues (#17112) 2024-10-26 06:45:37 -07:00
Antonio Orefice e1b2e29d51
slang shaders: add support for __has_include like C++17 macro. (#17109)
* slang shaders: add support for __has_include like C++17 macro.
This adds a new #pragma include_if_exist "filename" directive that acts like #include statements,
but does not return error if the file does not exists.

* removed unuseful define
2024-10-21 14:45:44 -07:00
sonninnos 73fc26c132
RGUI integer scale fix (#17099) 2024-10-15 19:08:58 -07:00
sonninnos 84b58dd001
Pixel perfect integer scaling improvements (#17098) 2024-10-14 14:44:10 -07:00
Viačasłaŭ 3019b926c2
Fix typos (#17068) 2024-10-01 17:36:33 -07:00
sonninnos 1cc2210185
Vulkan: Negative viewport position correction (#17063) 2024-09-29 11:12:12 -07:00
sonninnos 1e1b24c359
Show also current frame cache size in stats (#17056) 2024-09-28 23:53:26 -05:00
sonninnos 7cb1543edd
Use frame cache size in integer scaling instead of av info geometry (#17057) 2024-09-28 23:53:14 -05:00
sonninnos ea9a086f82
MSVC buildfix (#17061) 2024-09-28 23:52:37 -05:00
Colin Kinloch 63bd0b75d5
Reapply "wayland: Commit viewport resizes (#16419)" (#17026) (#17030)
This reverts commit 3ee3f2ae52.

Removing roundtrips seems to keep things snappy whilst fixing COSMIC.
2024-09-27 14:37:47 -07:00
sonninnos ecd626ec5e
Automatic Frame Delay: More improvements (#17041) 2024-09-27 14:37:11 -07:00
Eric Warmenhoven ea1b6852c5
apple: switch from MTKView to CAMetalLayer for vulkan (again) (#17045) 2024-09-27 14:36:45 -07:00
Eric Warmenhoven 10a1154b06
Avoid calling strlcpy when copying string onto itself (#17031) 2024-09-24 19:24:46 -05:00
Colin Kinloch c90f7aba6c
Use reverse DNS name for desktop file and icon (#16449)
Reverse DNS being com.libretro.RetroArch
2024-09-23 09:03:48 -07:00
alphabitserial 3ee3f2ae52
Revert "wayland: Commit viewport resizes (#16419)" (#17026)
This reverts commit 08496b302c.
2024-09-22 23:44:48 -07:00
sonninnos 4b177d0ac7
Refresh rate switching fixes and cleanups (#17021) 2024-09-20 20:09:02 -07:00
pastalian 4ce7dd6fd5
Explicitly cast to a pointer in wayland builds (#17019)
The build with `--enable-wayland --disable-kms` has a part where an
unsigned long is passed as a void*, but GCC 14 enforces
-Werror=int-conversion, causing the build to fail.
https://gcc.gnu.org/gcc-14/porting_to.html#int-conversion
2024-09-20 14:19:24 -07:00
Eric Warmenhoven 187497eea8
Revert "apple: switch from MTKView to CAMetalLayer for vulkan (#16959)" (#17017)
This reverts commit 95d53183f5.
2024-09-19 11:48:40 -07:00
sonninnos dbfb88721b
Automatic Frame Delay: Fix special overtime edge case (#17013) 2024-09-18 02:45:07 -07:00
sonninnos 6713e3b7f7
(Vulkan) Prefer IMMEDIATE mode without vsync (#17009)
* (Vulkan) Prefer IMMEDIATE mode without vsync

* Clamp max_swapchain_images and hard_sync_frames

* (Vulkan) Improve fastforward frameskip option hack
2024-09-17 10:23:02 -07:00
Eric Warmenhoven b557bc9523
Fixing compiler warnings (#17001) 2024-09-14 13:11:20 -07:00
libretroadmin 71326a7eaa fill_pathnam_expanded_and_absolute - pass size parameter to function 2024-09-13 20:38:02 +02:00
libretroadmin bd8ed67205 Dehardcode size parameter for strlcpy call 2024-09-13 20:22:20 +02:00
Eric Warmenhoven 9135065bfc
Fix strlcpy being passed a length that's too long (#16998) 2024-09-13 11:11:24 -07:00
libretroadmin 14b1af9e1a Revert "Start reducing size of video_shader_pass struct to reduce"
This reverts commit 0ab10f73c2.
2024-09-11 19:17:20 +02:00
libretroadmin 787c1e1130 video_monitor_compute_fps_statistics - turn static 2024-09-11 17:23:28 +02:00
libretroadmin 23bd9686e5 Silence unused variable warnings 2024-09-11 15:48:43 +02:00
Emanuel Haupt 7a0d568f04
Incorporate FreeBSD port patches (#16221)
This commit imports a series of patches from the FreeBSD port of RetroArch to
improve build compatibility and address specific issues encountered in the
FreeBSD environment. These patches, sourced from the FreeBSD Ports collection
(https://cgit.freebsd.org/ports/tree/games/retroarch/files), have been adapted
and tested to ensure they integrate seamlessly with the current build process.
2024-09-10 18:11:40 -07:00
libretroadmin d2eed0dabe Remove unused referenced variables 2024-09-10 23:39:14 +02:00
Eric Warmenhoven 4d20d08080
fix to avoid reacquiring a mutex reentrantly (#16985) 2024-09-10 12:03:04 -07:00
libretroadmin 5892551f75 Avoid strlen calls in video_shader_replace_wildcards 2024-09-10 16:33:08 +02:00
libretroadmin 29f011acef * Inline find_last_slash
* explore_load_icons - fill_pathname_slash is equivalent to usage
of strlen here, no need to call strlen
2024-09-10 16:02:06 +02:00
libretroadmin 046c2375e7 Downsize big char arrays in shader structs - a lot of these get
allocated on the stack so this would cost a lot of memory
2024-09-10 07:03:50 +02:00
Eric Warmenhoven cfbfd01f38
iOS: Last bits of iOS 12 support, including loading an older MoltenVK library (#16982) 2024-09-09 21:27:29 -07:00
libretroadmin f4ed638347 Rewrite libretro-common task_queue, use flags 2024-09-10 02:42:07 +02:00
libretroadmin 285e38bd87 (video_shader_parse) Cleanups 2024-09-09 22:47:33 +02:00
libretroadmin 6020877043 Cleanups 2024-09-09 22:01:37 +02:00
libretroadmin 0ab10f73c2 Start reducing size of video_shader_pass struct to reduce
massive size of video_shader struct
2024-09-09 18:28:38 +02:00
libretroadmin c79b02b1c8 Dehardcode some more variable sizes 2024-09-09 16:42:02 +02:00
libretroadmin 7f87a46744 More downsizing of variables 2024-09-09 16:18:32 +02:00
libretroadmin e675ea7e29 Variable cleanups - add TODO/FIXME notes for spurious variable sizes 2024-09-09 15:22:08 +02:00