280 Commits

Author SHA1 Message Date
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 b54a360ab8b584a5350a125c00e605960a26297b.
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 26d6aee1eb064a533534dbc158a2085a887658aa.
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