Commit Graph

298 Commits

Author SHA1 Message Date
twinaphex bf8cae10a3 Move retroarch_get_shader_preset to video_shader_parse.c 2021-10-29 16:35:50 +02:00
twinaphex ec7b7821fa Move code out of retroarch.c 2021-10-29 14:13:16 +02:00
twinaphex 9b4636ff62 Fixes --disable-menu 2021-10-15 14:32:07 +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
twinaphex 544a17926b Use path_basename_nocompression where we are sure we are not
dealing with a filename with a compressed archive hash
2021-04-11 17:44:41 +02:00
twinaphex 78f7deffba Get rid of early return in video_shader_write_root_preset 2021-03-24 18:44:55 +01: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
Autechre 33110603e5
Shader log spam reduction (#11977)
* (Shaders) Change label

* Create RARCH_DBG - if you have Logging Verbosity set to 0, the
shader parsing log spam will show, otherwise it won't
2021-02-03 13:49:07 +01:00
twinaphex f4a20870c7 video_shader_write_referenced_preset - logic flaw -
loaded_shader_preset_path is a character array - conditional boolean
check would always evaluate to true - check if string is empty
instead
2021-01-18 20:30:21 +01:00
twinaphex 552f973833 Cleanups/remove unused variables 2021-01-16 17:17:16 +01:00
Autechre 9797ba9f27
Merge pull request #11743 from HyperspaceMadness/Shaders_Fix_Simple_Preset_Relative_Texture_Paths
Shaders Load Refactor and Fix Referenced Texture Loading
2020-12-31 16:13:20 +01:00
Remi McGill 8d1b949c9c Shaders Fix Config Memory Leak 2020-12-30 11:02:59 -05:00
twinaphex 357b7d68f6 (libretro-common) Rename rhash to lrc_hash
(rcheevos) Rename rhash to rc_hash
2020-12-28 19:55:54 +01:00
HyperspaceMadness f86dbfc5a2 Shaders Fix Referencing issue in QT 2020-12-27 20:32:43 -05:00
Remi McGill 0c504906cb Shaders - Fixed a Reference Pathing Issue on QT 2020-12-27 12:47:47 -05: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 e98a8ce591 Shaders Fix Crash change num shader passes in UI 2020-11-30 19:30:15 -05:00
HyperspaceMadness 06e32982db Shaders_SaveAs_Fix_And_Better_Reference_Handling 2020-11-29 19:16:38 -05:00
HyperspaceMadness f0c4343cb9 Removed extra printf left behind 2020-11-22 19:39:34 -05:00
HyperspaceMadness abb2d06ce9 Shader_Multi-Level_Referenced_Presets 2020-11-22 19:10:08 -05:00
HyperspaceMadness deb8e2b88c Shader_Preset_Remove_parameters_line 2020-11-14 21:23:18 -05:00
HyperspaceMadness fd240f9a32 Shader Save Load Cleanup and UI Rename 2020-11-04 10:05:46 -05:00
HyperspaceMadness 1185df5f39 Shader Save & Load Fixes params not being loaded 2020-11-03 23:12:59 -05:00
HyperspaceMadness f6e35420bc Simple Shader Save Cleanup 2020-11-02 21:07:20 -05:00
HyperspaceMadness 70bf90c5d8 Shader_Preset_Simple_Save_Cleaned_2020_11_01 2020-11-01 09:18:40 -05:00
twinaphex 5fdf0c818d Cleanups 2020-09-04 04:15:46 +02:00
twinaphex 91d78c1e9f video_shader_read_reference_path - simplify 2020-09-04 04:12:51 +02:00
twinaphex 09f72c1465 Turn function static 2020-09-04 04:07:29 +02:00
twinaphex 88c0024a52 Cleanup video_shader_read_reference_path 2020-09-04 03:49:41 +02:00
twinaphex 63b77fb542 Use config_get_entry where possible instead of config_get_array
to prevent string allocation on heap
2020-08-27 16:20:49 +02:00
twinaphex 4388303077 video_shader_write_conf_preset - use less mallocs 2020-08-26 19:19:26 +02:00
twinaphex 1118ba09ec video_shader_resolve_current_parameters - don't use malloc 2020-08-26 19:10:43 +02:00
twinaphex 3ff29abbc8 video_shader_parse_pass - don't use malloc 2020-08-26 19:07:36 +02:00
twinaphex 603b2bf166 Simplify video_shader_read_conf_preset 2020-08-26 18:54:14 +02:00
twinaphex 86424a0cd8 (video_shader_parse) Use string_split_noalloc 2020-08-26 04:22:18 +02:00
twinaphex 0c5611d10e Clean up more string variables on heap; move to stack 2020-08-18 13:17:28 +02:00
twinaphex b9e471d22a Revert "Video context driver cleanups - less functions to go through with"
This reverts commit cd1d760a38.
2020-07-26 23:12:05 +02:00
twinaphex cd1d760a38 Video context driver cleanups - less functions to go through with
public scope
2020-07-26 08:00:49 +02:00
twinaphex 73e63d369c Fix more array subscript has type char warnings 2020-07-23 05:20:23 +02:00
twinaphex 021625fd4a Revert "Move static functions to top of files"
This reverts commit 02b542e2a5.
2020-06-26 18:40:26 +02:00
twinaphex 02b542e2a5 Move static functions to top of files 2020-06-26 18:15:38 +02:00
twinaphex 6fce0435a1 Update more logs 2020-06-08 18:04:29 +02:00
twinaphex 9059b4962e Cleanups 2020-06-07 00:05:41 +02:00
twinaphex a5ca6c24de Add more TODO/FIXMEs for globals 2020-05-29 06:17:39 +02:00
jdgleaver 9eb8472805 Only write config files to disk when parameters change 2020-04-27 17:06:35 +01:00
twinaphex cec672a71d Buildfix 2020-02-17 12:27:08 +01:00
twinaphex a0f3010159 Cleanup 2020-02-17 03:59:12 +01:00
twinaphex 1105d1019d Reduce some configuration dependencies 2020-02-12 16:13:28 +01:00
twinaphex 35b8c4cb05 Cleanup 2020-02-01 02:02:50 +01:00
twinaphex 6d0286efbd Turn video_shader_parse_type into macro 2020-01-22 14:30:55 +01:00
twinaphex 7175c3ec22 FIx another 'may be used uninitialized' warning 2019-10-05 18:43:25 +02:00
twinaphex 221df13250 Cleanups/warning fixes - compilation fix for OSX PPC 2019-10-05 18:38:17 +02:00
twinaphex b94b9e2adb Go back to plain strlcpy/strlcat - probably best to look at
opportunities to reduce these calls vs. replacing them with
unsafe macros
2019-09-23 00:19:01 +02:00
twinaphex 3b057d9605 Start using STRLCAT_CONST_INCR and STRLCPY_CONST 2019-09-20 23:33:17 +02:00
twinaphex db624a7c99 Start cleaning up the rather messy manual assignment 2019-09-20 02:03:26 +02:00
twinaphex ab515daa0c Try to get rid of file_path_str 2019-09-18 18:12:57 +02:00
twinaphex c186747edc (video_shader_parse) avoid some more snprintfs 2019-09-18 09:11:32 +02:00
Twinaphex 714e3ddc2a (SBT font driver) Check first if font files exist before
we try to open them
2019-08-24 03:30:32 +02: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
twinaphex d52c573e13 Merge slang_preprocess.cpp into slang_process.cpp 2019-08-18 18:55:22 +02:00
LazyBumHorse 719555bae1 Overhaul shader loading logic, add --set-shader CLI option 2019-08-17 15:20:51 +02:00
twinaphex b282125107 Revert "Refactor code for glslang shader presets - buffer entire file"
This reverts commit 0fee6a9ef4.
2019-08-08 16:36:34 +02:00
twinaphex 83c113cb59 Cleanups 2019-08-08 14:57:28 +02:00
twinaphex 0fee6a9ef4 Refactor code for glslang shader presets - buffer entire file
into memory before passing it on
2019-08-08 04:55:22 +02:00
jdgleaver bcfc5db7d8 (video_shader_parse) Optimise parsing of (non-slang) shader parameters 2019-08-07 17:19:18 +01:00
LazyBumHorse 6285c05948 add resolve_symlinks parameter to path_resolve_realpath() and cleanup playlist_resolve_path() 2019-07-22 13:44:35 +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 b7a85d392f Silence warnings 2019-07-12 16:31:16 +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 7b6444d911 temporary workaround for d3d10-12, gx2 not being able to poll flags during init 2019-06-19 19:10:40 +02:00
twinaphex 5d91af629e Set SHADERS_SLANG flag for D3D10/11/12 and query the video driver poke
interface's 'get flags' function before querying the video context
driver's 'get flags' function (D3D10/11/12/WiiU don't have a context
driver at all)
2019-06-19 03:18:28 +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 ee3208ac39 Integrate video_driver.c into retroarch.c 2019-06-17 15:10:22 +02:00
LazyBumHorse 6514b80ff2 Revert "allow saving and properly loading 0 pass shader presets"
This reverts commit b54a360ab8.
2019-06-16 23:05:41 +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 b54a360ab8 allow saving and properly loading 0 pass shader presets 2019-06-09 21:34:00 +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 4c5f9ee65b Cleanups 2019-05-31 17:34:32 +02:00
twinaphex 3e350afe93 video_shader_parse_pass - free pointer earlier 2019-05-11 08:56:41 +02:00
twinaphex 74388d8490 Remove string_concat 2019-05-10 18:05:58 +02:00
twinaphex 39eadbab6f Use string_concat in more performance critical areas 2019-04-30 21:17:51 +02:00
twinaphex 4c3e0d44b8 Revert "Start using string_is_equal_memcmp and"
This reverts commit 26d6aee1eb.
2019-04-29 04:04:33 +02:00
twinaphex 26d6aee1eb Start using string_is_equal_memcmp and
string_is_equal_memcmp_fast
2019-04-28 17:23:11 +02:00
twinaphex 2c47d571aa Use path_is_valid instead of filestream_exists when we only
need to know if a file exists on the filesystem
2019-04-27 14:01:50 +02:00
twinaphex 643cd1923e CXX_BUILD / C89_BUILD buildfixes 2019-03-14 14:14:44 +01:00
twinaphex d744ed4666 Reimplement video_shader_is_supported 2019-03-13 20:39:36 +01:00
twinaphex 57e11a10e7 Reimplement video_shader_get_type_from_ext 2019-03-13 20:32:19 +01:00
Themaister 3029f96511 Add a new "glcore" driver with slang support.
This driver should sunset the old gl2 driver, but that driver will
likely live on to support really ancient and terrible GL stacks.
All the worst legacy cruft has been ripped out, and it's almost a decent
backend now.

Requirements for slang are GL 3.2+ or GLES3.
Some shaders require features which are not directly compatible with
GLES2 or legacy GL.

This driver shares a lot of concepts from the Vulkan driver.
The slang shader stack and SPIRV-Cross are used to implement the shader
spec, and the menu shaders are also shared with Vulkan.
2019-03-09 12:30:49 +01:00
orbea 088860e499 Silence -Wformat-truncation warnings with DEBUG=1. 2019-01-24 10:59:53 -08:00
twinaphex 3ac631c7a3 (MSVC) Some more static code analysis warning fixes 2019-01-10 22:49:23 +01:00
twinaphex b9ff2e4de1 Fix some static code analysis warnings from MSVC 2017 2019-01-10 21:47:15 +01:00
Brad Parker 4d09ddde1c Qt: limit shader preset/pass selection to the appropriate extensions 2018-08-20 20:26:50 -04:00
Brad Parker e4834250b9 Qt: set shader dialog title to current preset/shader name 2018-08-18 12:39:17 -04:00
Brad Parker 16459bfa91 Qt: add filter/scale to shader window 2018-08-18 00:33:59 -04:00
Brad Parker 341cf63399 Qt: show shader pass in parameters window, reload shader params when shader is reloaded 2018-08-14 21:38:52 -04:00
Brad Parker 560149857b shaders: track the pass for each parameter 2018-08-14 18:46:32 -04:00
Brad Parker 4a86d29810 shaders: fix memory leak 2018-08-14 18:44:19 -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 8848b2837b Add D3D10 to slang supported checks 2018-04-21 05:11:24 +02:00
twinaphex 3cd2018cc1 Update video_shader_parse.c 2018-03-02 01:41:05 +01:00
twinaphex df7f47d00a Create string_is_equal_case_insensitive 2018-03-01 23:16:34 +01:00
twinaphex 2f457af8bf Buildfix 2018-03-01 22:51:43 +01:00
twinaphex 25b7e54bdb Fix mistake 2018-03-01 22:44:27 +01:00
twinaphex 7a7902c4ac string_is_equal_noncase has issues in video_shader_get_type_from_ext 2018-03-01 22:42:03 +01:00
twinaphex ba0e6bcdea Get rid of warning that is inaccurate 2018-03-01 18:17:04 +01:00
twinaphex 8b8b08aefd - Simplify video_shader_parse_type
- Fix welcome screen
2018-03-01 15:58:06 +01:00
twinaphex 7e8b9135c3 (Cg) If GL context is GLES2/3/Core context, Cg shaders are unavailable 2018-02-26 19:39:42 +01:00
twinaphex 826ca302ca video_shader_get_type_from_ext - the switch now covers the APIs
that support the shader type, not the ones that don't
2018-02-26 19:04:01 +01:00
twinaphex f2e80fd8e8 hide cg and glsl for D3D10/11/12 drivers 2018-02-26 18:36:10 +01:00
twinaphex a34c066e07 Hide glsl/cg shaders from Vulkan driver 2018-02-26 18:35:16 +01:00
twinaphex d45189b853 Prevent crashes from occurring if we have the GL video driver
in use and we try to skip to a slang shader through next/previous
hotkeys
2018-02-26 18:15:38 +01:00
twinaphex 5665e27324 Nits 2018-02-26 15:12:19 +01:00
twinaphex 826a5009b0 Cleanups 2018-02-25 23:54:46 +01:00
twinaphex d8498d0de7 Cleanups 2018-02-25 23:49:00 +01:00
twinaphex 8dbe653e9f Cleanup 2018-02-25 23:24:21 +01: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
twinaphex f00d194ae3 Get rid of more hashes 2018-02-25 16:32:54 +01:00
twinaphex 016e24e5a5 (video_shader_parse) Get rid of hashes 2018-02-25 01:07:14 +01:00
aliaspider 37bebb5b65 (D3D12) slang shaders support. 2018-02-11 00:00:20 +01:00
twinaphex d950794659 (video_shader_parse.c) Be safer with memory allocations 2018-02-05 13:55:04 +01:00
twinaphex df632814e6 Add appropriate HAVE_SPIRV_CROSS ifdefs 2018-02-03 17:13:36 +01:00
aliaspider 5bc78d3ad5 (D3D11) Implement slang shader specification using Spirv-Cross.
(incomplete)
2018-01-31 01:08:36 +01:00
Brad Parker 9ef75473e0 fix coverity warnings 2018-01-26 00:14:59 -05:00
Brad Parker 9e347ec71f detect shader file changes on move and delete as well, and wait a few frames before re-applying changes 2018-01-25 19:09:55 -05: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
twinaphex 61ff51be2f Start using string_is_equal predominantly 2018-01-16 22:53:38 +01:00
twinaphex 0be4d7d178 Add free(file) 2018-01-07 13:13:21 +01:00
aliaspider 55d262f5d8 (WIIU) add preliminary multi-pass shader support.
can load *.slangp and *.slang files. since there is no runtime compiler,
precompiled shaders (*.gsh) need to be present next to each *.slang
source file.
2018-01-06 03:39:53 +01:00
twinaphex e0b59c40ea Cleanups 2018-01-04 14:52:35 +01:00
Alcaro bfeb9ff5c2 that's an interesting double free 2017-12-18 22:29:27 +01:00
twinaphex 1932513edb Update libretro-common 2017-12-15 00:31:37 +01:00
twinaphex c7c4b723d6 Move path_file_exists to filestream and do away with filestream
dependencies in file/file_path
2017-12-14 20:05:46 +01:00
gblues 6904101c44 Clean up trailing whitespace
== DETAILS

Really simple code cleanup, because my editor flags trailing whitespaces
and it's pretty annoying.
2017-12-12 00:24:18 -08:00
twinaphex 57b730ab61 Start implementing VFS layer ; first split up VFS libretro functionality
to separate header until things are finalized
2017-12-11 21:24:14 +01:00
twinaphex c4d8a8c800 Free after intfstream_close 2017-12-11 20:24:00 +01:00
twinaphex 12e6f38999 (gfx/video_shader_parse) Use intfstream instead of file_stream 2017-12-11 13:01:17 +01:00
twinaphex 61d3f90cae Add hint defines to libretro.h 2017-12-11 12:53:47 +01:00
twinaphex 318f17c4cb Start using VFS API constant defines 2017-12-11 12:15:00 +01:00
twinaphex 2e979ec537 Replace function signatures of file_stream file functions 2017-12-10 22:25:38 +01:00
twinaphex 40f82c26f7 use RFILE_MODE_READ for video_shader_parse 2017-12-10 22:01:48 +01:00
twinaphex 8072dab6fe Clean this up 2017-10-22 05:24:57 +02:00
twinaphex d203e4dc9c video_shader_driver_resolve_parameters - fix crash at startup with
MSVC
2017-10-22 05:21:31 +02:00
Brad Parker 38c30667c5 fix include paths 2017-10-14 23:08:43 -04:00
r5 d5321c2001 Fix missing include 2017-09-19 13:49:51 +01:00
r5 cc5adc56ac (shaders) Change RARCH_WARN message, add missing newline 2017-09-18 18:12:00 +01:00