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.
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>
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
- 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
- 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
- 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)
- 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