Commit Graph

756 Commits

Author SHA1 Message Date
pstef 6a302d0602 PSVita: add missing include 2025-04-10 21:10:45 +00:00
LibretroAdmin 72efcab3e7 Silence more warnings 2025-02-09 21:11:35 +01:00
LibretroAdmin b211adaaca Function argument name standardization 2025-01-17 19:55:32 +01:00
LibretroAdmin 31b7812720 Function argument name standardization 2025-01-17 04:16:12 +01:00
LibretroAdmin a9b0e45013 (glslang_utill.c) One less string copy per iteration 2025-01-17 03:01:59 +01:00
libretroadmin c477956f23 Cleanups/style nits 2024-12-25 22:52:12 +01:00
libretroadmin 44238e909f Consistent viewport naming conventions 2024-12-24 22:50:51 +01:00
libretroadmin de8f979cb7 less string copies 2024-12-24 05:10:09 +01: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
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
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
Eric Warmenhoven b557bc9523
Fixing compiler warnings (#17001) 2024-09-14 13:11:20 -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 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 d60d320e76 Simplified parameter parsing to have all shader formats use the same slang method
(when HAVE_SLANG and HAVE_SPIRV_CROSS are defined) - backport of HyperSpaceMadness' PR
2024-09-08 15:25:40 +02:00
hunterk 1e94c92dbf
improve GLES version directive granularity (#16888) 2024-08-17 09:57:17 -05:00
hunterk 6b8025fdca
fix segfault with vulkan shaders (#16810) 2024-07-23 22:09:39 -07:00
libretroadmin c095b420d1 Move GL3 C code over to C file - put rest in extern "C" codeblock 2024-07-22 01:43:21 +02:00
libretroadmin b4e5a8fb70 Don't use std::min/std::max 2024-07-22 01:24:09 +02:00
libretroadmin c99c5399f5 Move C Vulkan code over from shader_vulkan.cpp to vulkan_common.c 2024-07-22 00:52:53 +02:00
libretroadmin 907711db8c Don't use 'using namespace' 2024-07-22 00:34:57 +02:00
libretroadmin 73afe24266 Use C comments instead of C++ comments for C files 2024-07-20 16:16:16 +02:00
libretroadmin 9e171cb665 Add missing header 2024-06-26 15:40:29 +02:00
libretroadmin 3d40dff4f5 strtok_r - small syntactic cleanup 2024-06-26 15:38:09 +02:00
libretroadmin 5a2a6db589 (glslang) use strtok_r instead of strtok 2024-06-26 15:36:31 +02:00
libretroadmin af11f8f54c Use strlcpy when no formatting is required 2024-06-13 07:02:38 +02:00
libretroadmin a74675a718 Remove unneeded ENABLE_HLSL code from glslang 2024-05-23 01:25:37 +02:00
Carlo Refice adaa19cbf7
vulkan: Add support for A2R10G10B10 HDR format (#16435) 2024-04-18 07:34:46 -07:00
MajorPainTheCactus eef34e9461
Added rolling scan line simulation based on the shader subframe feature. This is implemented with a scrolling scissor rect rather than in the shader itself as this is more efficient although may not work for every shader pass - we may need an option to exclude certain passes. The implementation simply divides the screen up by the number of sub frames and then moves the scissor rect down over the screen over the number of sub frames. (#16282) 2024-03-19 08:59:36 -07:00
Ophidon 7b711214a7
Slang Subframe Shaders Feature (#16209)
Adds support for sub-frame shaders to vulkan/glcore/dx10-11-12.

Builds on the concept already present for frame duplication in use for BFI, to present multiple 'sub' frames per real frame to the shaders, so they can run at a higher framerate than the content framerate. Must be enabled via subframe shaders setting under synchronization settings to be active.

Will allow BFI to be implemented inside of the shaders, among any other use for the higher framerate shader authors can devise.

CurrentSubFrame and TotalSubFrames have been available inside the shaders to track what they want to do on an given subframe. TotalSubFrames will always be 1 when the setting is disabled (and when in menu/ff/pause). Framecount will not increment on sub-frames, as it does not for injected bfi frames now. Should not interfere with any existing shaders that do not check for subframes.
2024-02-09 03:12:55 -08:00
Bobby Smith bd10a88a57
[Vulkan] Fix a validation error (#15946) 2023-11-24 11:23:58 -08:00
fishcu 1b50470c96
Add FinalViewportSize support to GLSL (#15891)
* Change rotation type to int to maximize compatibility and to match glUniform1i

* Change to C style comment; Make comment more useful (hopefully)

* Add support for FinalViewportSize in GLSL
2023-11-10 16:45:20 -08:00
libretroadmin 1743e8244b Avoid some implicit memsets 2023-07-17 16:53:46 +02:00
libretroadmin 5e614ea19c Update 2023-07-16 23:04:53 +02:00
libretroadmin 35c512d5ba Get rid of some impicit memsets 2023-07-16 22:51:09 +02:00
libretroadmin bd090dea71 Replace more strlcat calls 2023-07-16 18:07:49 +02:00
libretroadmin 0517354181 * replace more strlcat calls with strlcpy
* Get rid of unnecessary string copies by clever usage of strlcpy
* Get rid of unnecessary temp variables when not needed
2023-06-18 22:37:01 +02:00
libretroadmin 7b60626943 Silence -Wsign-compare warning 2023-06-18 13:08:55 +02:00
libretroadmin 631301b3f7 * Cut down on strlcat calls when possible and replace them with clever
usage of strlcpy (when position/offset of previous strlcpy/snprintf call
is known. strlcat implementation in libretro-common makes implicit strlen
call, using strlcpy avoids this
* Reduce a bunch of local char variables by use of said clever usage,
should save up on local stack size usage
2023-06-18 12:06:12 +02:00
Grisly Glee 4202f8650d
Fix trivial signedness warnings (#15377)
* Fix trivial signedness warnings

* Followup on trivial signedness warnings
2023-06-14 04:43:11 +02:00
libretroadmin f3fe46393c Cleanups 2023-06-01 20:29:05 +02:00
libretroadmin 36cf7f00a8 Cleanups 2023-06-01 19:59:11 +02:00
libretroadmin 6b93152253 * Add some TODO/FIXME localize notes
* some snprintf refactors
2023-05-01 20:49:32 +02:00
barbudreadmon 1fb9853a93
(Shaders) pass rotation index to shaders (#15136) 2023-03-26 21:20:27 +01:00
LibretroAdmin a2f34a6836
Update shader_glsl.c 2023-02-26 19:03:05 +01:00
libretroadmin 7ebab640d7 Cleanups/style nits 2023-02-23 13:15:14 +01:00
libretroadmin cc85d7fd6d (EGL) Cleanups
(GLSL) Buildfix
2023-02-21 21:09:47 +01:00
barbudreadmon d47bbe5cc1
(GLSL) send rotation index to shader (#12827) 2023-02-21 20:53:01 +01:00
libretroadmin 1f0a5f9615 (libretro-common) retro_endianness.h - Get rid of warning: #warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated [-Wcpp]
#  warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated
    ^~~~~~~
2023-02-21 13:35:04 +01:00
libretroadmin bb48289dd4 (GL3) Move functions over to shader_gl3.cpp and make them static 2023-01-24 04:24:22 +01:00