68 Commits

Author SHA1 Message Date
libretroadmin
14b1af9e1a Revert "Start reducing size of video_shader_pass struct to reduce"
This reverts commit 0ab10f73c29f25a7e4763accfdf80ffd61208803.
2024-09-11 19:17:20 +02:00
libretroadmin
5892551f75 Avoid strlen calls in video_shader_replace_wildcards 2024-09-10 16:33:08 +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
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
37190f8036 Header uniformity cleanups 2023-05-30 21:21:05 +02:00
libretroadmin
c07e6a6da2 Cleanups 2023-05-30 20:30:37 +02:00
HyperspaceMadness
e4a11cff59
Shader Preset - Wildcard Replacement in Paths on Load (#15023)
When a simple preset loads, wildcards which are found in paths inside the presets will 
be replaced with values coming from the current RetroArch context.  This will operate
on both texture paths and reference paths.

This would allow you to do things like have one preset which could be used with the entire list of images from the Bezel Project

E.G. 
    "/shaders/MyBackground_$VID-DRV$ _$CORE$.png" 
would be replaced with
   "/shaders/MyBackground_glcore_YabaSanshiro.png"
If  no file found at that path, the path will revert to the original path, so operates as a fallback
   "/shaders/MyBackground_$VID-DRV$ _$CORE$.png" 

  * Possible wildcards/tokens to be replaced:
 * 
 *   $CONTENT-DIR$ -> Content Directory of the game rom
 * 
 *   $CORE$       -> Core name
 * 
 *   $GAME$       -> Game ROM's name
 * 
 *   $VID-DRV$   -> Video Driver: Currently active driver, possible replacement values:
 *       glcore
 *       gl
 *       vulkan
 *       d3d11
 *       d3d9_hlsl
 *       "N/A"
 * 
 *   $VID-DRV-SHADER-EXT$   -> Video Driver Shader File Extension: The extension of shaders type supported by the current video driver:
 *       cg
 *       glsl
 *       slang
 * 
 *   $VID-DRV-PRESET-EXT$   -> Video Driver Preset File Extension: The extension of shaders type supported by the current video driver:
 *       cgp
 *       glslp
 *       slangp
 * 
 *   $CORE-REQ-ROT$   -> Core Requested Rotation: Rotation the core is requesting, possible replacement values:
 *       CORE-REQ-ROT-0
 *       CORE-REQ-ROT-90
 *       CORE-REQ-ROT-180
 *       CORE-REQ-ROT-270
 * 
 *   $VID-ALLOW-CORE-ROT$   -> Video Allow Core Rotation: Reflects Retroarch's setting allowing the core requested rotation to affect the final rotation:
 *       VID-ALLOW-CORE-ROT-OFF
 *       VID-ALLOW-CORE-ROT-ON
 * 
 *   $VID-USER-ROT$   -> Video User Rotation: Rotation the core is requesting, possible replacement values, does not affect the UI:
 *       VID-USER-ROT-0
 *       VID-USER-ROT-90
 *       VID-USER-ROT-180
 *       VID-USER-ROT-270
 * 
 *   $VID-FINAL-ROT$   -> Video Final Rotation: Rotation which is the sum of the user rotation and the core rotation if it has been allowed, does not affect the UI:
 *       VID-FINAL-ROT-0
 *       VID-FINAL-ROT-90
 *       VID-FINAL-ROT-180
 *       VID-FINAL-ROT-270
 * 
 *   $SCREEN-ORIENT$   -> Screen Orientation: User adjusted screen orientation, will change windows from landscape to portrait, including the Retroarch UI:
 *       SCREEN-ORIENT-0
 *       SCREEN-ORIENT-90
 *       SCREEN-ORIENT-180
 *       SCREEN-ORIENT-270
 * 
 *   $VIEW-ASPECT-ORIENT$   -> Viewport Aspect Orientation: Orientation of the aspect ratio of the RetroArch viewport
 *       VIEW-ASPECT-ORIENT-HORZ
 *       VIEW-ASPECT-ORIENT-VERT
 * 
 *   $CORE-ASPECT-ORIENT$   -> Core Aspect Orientation: Orientation of the aspect ratio requested by the core
 *       CORE-ASPECT-ORIENT-HORZ
 *       CORE-ASPECT-ORIENT-VERT
 * 
 *   $PRESET_DIR$  -> Preset directory's name
 * 
 *   $PRESET$     -> Preset's name
 * 
 * If no wildcards are found within the path, or the path 
 * after replacing the wildcards does not exist on disk,
 * the path returned will be unaffected.
2023-02-26 19:06:57 +01:00
libretroadmin
7eedfc8673 No C++ comments in C files 2022-12-22 23:06:48 +01:00
LibretroAdmin
097a7d7fc5
- C89 buildfixes (#14758)
- Don't declare static function prototypes in headers
2022-12-22 22:14:50 +01:00
LibretroAdmin
f836328c56
Append Preset (#14737) (#14757)
WIP version of Append and Prepend preset, Includes UI for Standard Retroarch, but not the QT UI companion

Co-authored-by: HyperspaceMadness <remimcgill@hotmail.com>
2022-12-22 21:36:32 +01:00
sonninnos
3b921ffbfa
Fix shader toggle and add hotkey + sublabel (#14628) 2022-11-15 22:14:09 +01:00
LibretroAdmin
d0b3c1742d (Video) use flags for FBO passes, GL2 renderchain, etc 2022-10-26 21:21:21 +02:00
libretroadmin
99ac1af9d2 (video_shader_parse)
* Return value of function was never used, so remove it
* Move variables to proper scope
* Miscellaneous cleanups
2022-07-11 14:00:35 +02:00
twinaphex
ec7b7821fa Move code out of retroarch.c 2021-10-29 14:13:16 +02:00
twinaphex
b3d724b7a3 Move code out of retroarch.c 2021-09-18 22:05:03 +02:00
twinaphex
2490f6e215 Move code from retroarch.c to video_shader_parse.c 2021-09-11 18:15:35 +02:00
Remi McGill
fdee0f4e7e Max_Shader_Parameters_Increased_to_1024 2021-07-22 10:20:50 -04:00
twinaphex
d911dd6efc (video_shader_parse.c) Tons of functions here should have been
made static, tons of log spam put behind DEBUG ifdefs
2021-03-24 18:31:20 +01:00
HyperspaceMadness
0c526b6498 Shaders Load Refactor and Fix Referenced Texture Loading
Partial update to work with shaders directly

More Edits

More changes

more shader fixes

More Fixes Compiling, reference load still wrong

Added Feedback & things are working

Logging Fixes

Log Fix

More Fixes

Added Feedback Logging

Fixes for file pathing in Linux

Fix GLCore and Crash in QT Saving

Code Cleanup

Removed Unused Function filepath.c

Code Cleanup
2020-12-26 21:09:27 -05:00
HyperspaceMadness
35b49f3b82 Shader_Increase_Max_Textures_Line 2020-11-22 09:50:24 -05:00
HyperspaceMadness
5008ac6eb0
Merge branch 'master' into Shader_Save_Load 2020-11-10 17:05:23 -05:00
HyperspaceMadness
a5e57aa74d Increase_Shader_Parameter_Count_to_512 2020-11-06 22:42:15 -05:00
HyperspaceMadness
70bf90c5d8 Shader_Preset_Simple_Save_Cleaned_2020_11_01 2020-11-01 09:18:40 -05:00
twinaphex
09f72c1465 Turn function static 2020-09-04 04:07:29 +02:00
twinaphex
be3345b766 Reorder structs for alignment 2020-08-27 22:17:51 +02:00
HyperspaceMadness
7c6bb925c4 Increased Slang Max Params, Textures & Passes 2020-07-05 13:45:58 -04:00
twinaphex
1f553ac1c4 Get rid of menu_shader_set_modified - instead, add a single
'modified' variable to video_shader struct
2020-03-06 17:05:20 +01:00
twinaphex
1105d1019d Reduce some configuration dependencies 2020-02-12 16:13:28 +01:00
twinaphex
6d0286efbd Turn video_shader_parse_type into macro 2020-01-22 14:30:55 +01:00
LazyBumHorse
a882901e39 save unmodified auto-shaders as a reference instead of a copy, see:
- implement #reference directive for auto-shaders
 - replace usual preset saving and loading functions with video_shader_read_preset() and video_shader_write_preset()
 - apply saved presets automatically for console menus
 - move auto-shader saving logic from menus into menu_shader.c menu_shader_manager_save_auto_preset()
 - refactor menu_shader_manager_save_preset() into menu_shader_manager_save_preset_internal()
2019-08-22 16:57:28 +02:00
LazyBumHorse
f8b92770d4 simplify video_shader_read_conf_preset() calls 2019-07-21 18:15:28 +02:00
LazyBumHorse
2245af23e9 much improved handling of relative shader paths
- save texture paths in relative format as well
 - always write portable relative paths on Windows using '/' instead of '\'
 - remove an ancient piece of code that could sometimes fail loading relative paths
 - fix absolute path handling between different drives for Windows
 - integrate video_shader_resolve_relative() into video_shader_parse_* functions
2019-07-20 18:29:46 +02:00
twinaphex
f0f5c32b51 Remove state tracker - legacy code - we can revisit this later
and integrate it in a way so that it scales across all drivers
2019-07-09 07:39:38 +02:00
LazyBumHorse
c20c67bd3a proper shader compatibility checks
- move shader flags from the video drivers to the context drivers
 - rework config_load_shader_preset() from configuration.c into retroarch_load_shader_preset() in retroarch.c with proper compatibility check
 - implicitly call retroarch_load_shader_preset() in retroarch_get_shader_preset() once per core/content life cycle
 - use video_shader_is_supported() instead of video_driver_test_all_flags() where appropriate
 - remove GFX_CTX_FLAGS_NONE because it is meaningless
2019-06-18 13:46:41 +02:00
LazyBumHorse
692dc9f6a9 refactor shader checks affected by last commit and more:
- gl.c: refactor backend fallback into more general gl2_get_fallback_shader_type
 - d3d9-12, gl_core, gx2_gfx, gl, vulkan: more consistent shader init and `set_shader` behavior
 - configuration.c: remove check_shader_compatibility
 - shader_glsl.c, shader_gl_cg.c: use `video_shader_get_type_from_ext`
 - shader_gl_cg.c: add shader type check with fallback to stock like in shader_glsl.c
 - menu_shader.c: use `enum rarch_shader_type` instead of `unsigned`
 - video_shader_parse.c: add `video_shader_to_str` for easier logging
 - remove `type` from `struct video_shader`, which was always set to CG and wrongly used in lang_process.cpp's `slang_process()` (has no further consequences because the code is unused)
2019-06-18 13:44:19 +02:00
LazyBumHorse
42e35c825f refactor some video_shader_parse functions
- video_shader_parse_type()'s fallback only worked for NULL paths and was wrongly used, now returns RARCH_SHADER_NONE like video_shader_get_type_from_ext().
 - video_shader_get_type_from_ext() should not be checking video driver flags, this is instead done by video_shader_is_supported()
 - video_driver_get_all_flags() did not actually 'get' flags, changed to video_driver_test_all_flags()

workaround for crash due to glcore not always using at least OpenGL 3.2
2019-06-18 13:12:56 +02:00
twinaphex
f60306b232 Rename read_conf_cgp/write_conf_cgp to
read_conf_preset/write_conf_preset
2019-06-15 09:00:35 +02:00
LazyBumHorse
2816730b2f make shader presets use relative paths
Also change fill_pathname_resolve_relative() to apply path_resolve_realpath() as well
2019-06-07 16:11:06 +02:00
twinaphex
57e11a10e7 Reimplement video_shader_get_type_from_ext 2019-03-13 20:32:19 +01:00
orbea
bfc366decc Squeeze extra blank lines with cat(1).
Example:

find . -type f -iname '*.c' | while read -r i; do
  cat -s "$i" > "$i.new"
  mv "$i.new" "$i"
done
2019-01-08 11:04:58 -08:00
Brad Parker
e4834250b9 Qt: set shader dialog title to current preset/shader name 2018-08-18 12:39:17 -04:00
Brad Parker
560149857b shaders: track the pass for each parameter 2018-08-14 18:46:32 -04:00
Stuart Carnie
411bcf8bdd feat(apple): Metal support for macOS
* includes rgui
* shader support

This is a work-in-progress and there are some bugs and visual artifacts
still to be fixed.
2018-06-20 21:33:45 -07:00
twinaphex
e75992a66f Get rid of HAVE_SHADER_MANAGER 2018-02-25 23:03:39 +01:00
twinaphex
74309e6e1c shader code - Get rid of more hashes 2018-02-25 17:20:22 +01:00
aliaspider
e225e96025 (D3D11) multi-pass shaders: add support for history frames. 2018-02-03 13:29:00 +01:00
aliaspider
e30c7edd8d (D3D11) multi-pass shaders: add support for feed-back textures. 2018-02-02 19:57:45 +01:00
aliaspider
6fe3a31617 (D3D11) multi-pass shaders: add support for wrap modes and lut
mipmapping.
2018-02-02 17:18:41 +01:00
Brad Parker
f087b150c9 Add quick menu option to watch shader files for changes and recompile automatically (Linux only for now) 2018-01-25 15:50:57 -05:00