Commit Graph

255 Commits

Author SHA1 Message Date
MajorPainTheCactus 536d18778b
Fixed up HDR for UWP/WinRT builds (#12936)
Fixed D3D11 validation warnings
Fixed up technically incorrect labels

Co-authored-by: Autechre <libretro@gmail.com>
2021-09-04 21:13:24 +02:00
twinaphex 274638b89e (D3D11) Look at D3D11 feature level - if we are 11.0 or above,
we use Shader Model 5.0 instead of the default SM 4.0 - this fixes
FSR on D3D11 which requires SM5.0
2021-09-03 07:51:44 +02:00
twinaphex b900555494 (D3D11) Add logging after device creation so we can see which
feature level it used
2021-09-03 07:15:53 +02:00
Autechre 7b9cbc08d7
Add HDR support for D3D12 (rebased PR from MajorPainTheCactus) (#12917)
* Add HDR support

* Attempt to fix Mingw build and Metal builds

* (D3D12) Fix relative header includes

* Add missing hdr_sm5.hlsl.h

* (d3d12_common.c) Some C89 build fixes

* Fix MSVC build

* - Attempt to fix build on mingw/msys unix with dirty hack
- Fix shader compilation of hdr_sm5.hlsl.h on MSVC/Visual Studio -
the define was seen as an error and was causing the first pipeline
to error out
- Make sure we manually set handle of backBuffer to NULL

* Moving the release of the texture above the freeing of desc.srv_heap
and desc.rtv_heap solves the hard crashes on teardown/setup in RA -
it was crashing hard in d3d12_release_texture before

* Add HAVE_D3D12_HDR ifdef - needs to be disabled for WinRT for now
because of several things that are Windows desktop-specific right now
(GetWindowRect)

* Add dirty GUID hack - should work for both mingw/msys on Windows/Linux
as well as MSVC/Visual Studio (hopefully)

* Change HAVE_D3D12_HDR to HAVE_DXGI_HDR

* Move away from camelcase named variables

* Fix RARCH_ERR logs - they need a newline at the end

* d3d12_check_display_hdr_support - make it return a bool on return
and set d3d12->hdr.support and d3d12->hdr.enable outside of the
function

* (DXGI) Remove D3D12 dependencies from dxgi_check_display_hdr_support and
move it to dxgi_common.c instead

* (DXGI) move d3d12_swapchain_color_space over to dxgi_common.c and
rename it dxgi_swapchain_color_space

* (DXGI) move d3d12_set_hdr_metadata to dxgi_common.c and
rename it dxgi_set_hdr_metadata

* (DXGI) dxgi_check_display_hdr_support - better error handling?

* Fix typo

* Remove video_force_resolution

* (D3D12) Address TODO/FIXME

* (D3D12) Backport
c1b6c0bff2
- Fixed resource transition for present when HDR is off
Fixed cel shader displaying all black as blending was enabled when the hdr shader was being applied - turned off blending during this shader

* Move d3d12_hdr_uniform_t to dxgi_common.h and
rename it dxgi_hdr_uniform_t

* (D3D11) Add HDR support

* Add TODO/FIXME notes

* Cache hdr_enable in video_frame_info_t

* Update comment
2021-09-03 06:15:25 +02:00
twinaphex ffb59e5261 (UWP) Turn this back on again - seems to work fine on Xbox 2021-08-20 10:07:29 +02:00
twinaphex e596bf7925 Buildfix for previous commit 2021-08-02 16:19:26 +02:00
twinaphex 2af9441d35 Create separate wnd_proc functions for winraw 2021-08-02 16:14:58 +02:00
twinaphex b2c7fae912 desc.Flags should also be commented out for now 2021-06-26 05:46:37 +02:00
twinaphex 13e88ebe74 (D3D11) Disable tear control support for UWP for now 2021-06-26 05:40:41 +02:00
twinaphex 55afe18872 Move D3D11Draw call back for now - should make OSK work again and
shaders
2021-06-23 19:34:06 +02:00
Connor McLaughlin 322aeb4e46 (d3d11) Don't pass ALLOW_TEARING to present when unsupported 2021-06-22 14:04:32 +10:00
Connor McLaughlin ed2d6b1730 (d3d11) Don't draw content without a texture bound 2021-06-22 14:04:32 +10:00
Connor McLaughlin 9afa30af5e (d3d11) Disable DXGI's ALT+ENTER handling 2021-06-22 14:04:31 +10:00
twinaphex a30a86a09c (D3D11) Fixes Xbox again, do tear control checks only for non-UWP
- TODO/FIXME still has to be resolved, see comment at line 1362
2021-06-22 00:41:56 +02:00
twinaphex 8b6e58eebd Buildfix for D3D11 - courtesy of Stenzek 2021-06-16 16:07:38 +02:00
Connor McLaughlin 946d87cf89
(gfx/d3d11) Don't use allow tearing flag with blit swap chains (#12529) 2021-06-16 15:19:27 +02:00
Tony 3647bdef0f
(D3D) Logging + dupe code cleanups (#12501) 2021-06-09 06:33:14 +02:00
JustMeDaFaq f1347829c2
Update d3d11.c 2021-06-07 12:03:58 +02:00
sonninnos 04962e1741 (D3D) Add common window title for D3D9+ 2021-06-06 22:24:47 +03:00
sonninnos 8584b122e1 (D3D11+12) Allow fastforward in fullscreen 2021-06-04 04:31:11 +03:00
LazyFunker 4e0f8bf621 Fix typo 2021-05-16 20:44:31 +02:00
LazyFunker 8ff0430370 Disable mipmap generation for UWP 2021-04-20 10:29:17 +02:00
twinaphex 611efea2bf More CXX_BUILD fixes 2021-03-22 15:20:51 +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
twinaphex 7d313647ae (D3D11) Add flip model support - fallback to blit model for OSes
where flip model is not supported (windows 7 and earlier). Will add
a menu option later allowing the user to switch inbetween the two
2020-12-17 14:39:58 +01:00
twinaphex 38ce3927ae (D3D10/11/12) Increase sprite capacity, we need this so that
the hardware rendered menu drivers don't glitch out
2020-12-17 08:31:06 +01:00
twinaphex 093dc30ffd Refactor d3d11_init_swapchain some more 2020-12-15 22:56:29 +01:00
twinaphex a1fd1d425c (D3D11) Split init swapchain code up into own function 2020-12-15 08:19:04 +01:00
twinaphex ad2502b645 (D3D11) Change this back 2020-12-15 08:09:48 +01:00
twinaphex 625f0d4fc6 Improve conditional 2020-12-05 04:54:22 +01:00
twinaphex 9688554921 (D3D11) Use SWAP_EFFECT_*_DISCARD from now on fallback PC codepath 2020-12-05 04:48:11 +01:00
aliaspider c6b77f6c62 (D3D11) get the hwrender texture format from the view desc
the format set in the texture desc isn't necessarily the same as the
view format.
2020-11-15 15:07:53 +01:00
aliaspider b3134fc05a (D3D11) fix slang shaders 2020-11-15 13:04:24 +01:00
aliaspider b7d3efc503 (D3D11) rename D3D11SetState to D3D11SetRasterizerState. 2020-11-14 04:29:44 +01:00
twinaphex 44b7234756 Move cheat_manager and state_manager to root folder 2020-10-15 05:29:20 +02:00
twinaphex d1dd0e9d60 Not sure why this printf was there 2020-10-05 16:01:40 +02:00
Connor McLaughlin 696df6e916 (video/d3d11) Skip shader/stock blend when we don't have a texture
This happens if the core calls video_cb with the frame set to null on
the first frame, and was causing black screens/driver resets.

The ffmpeg core seems to do this.
2020-10-01 19:19:13 +10:00
Connor McLaughlin 10bbe119a7 (video/d3d11): Fix shaders with scaled framebuffers
The scissor rectangle was left as whatever the core last used.
2020-10-01 16:53:19 +10:00
Connor McLaughlin 30c6f90c93 (video/d3d11) Use cached view as the slang source texture
Fixes shaders in D3D11 driver.
2020-10-01 00:19:11 +10:00
Connor McLaughlin 12382c057a (video/d3d11) Cache view left bound by hw renderers
Fixes garbage/black screen when menu is active.
2020-10-01 00:19:11 +10:00
twinaphex 4d1cfa9c41 Make the 'raw' versions the generic function for the message loop
callback - this way it's reused for SDL2 input driver too
2020-08-28 02:55:39 +02:00
twinaphex 32279c3a70 Split up wnd_proc_common_internal into two - one for dinput,
one for raw
2020-08-28 02:21:13 +02:00
twinaphex 6b3fcf79f0 (DXGI) Turn these into macros 2020-08-24 00:04:12 +02:00
twinaphex 6b978eb057 (D3D11) Cleanups 2020-08-19 11:26:30 +02:00
twinaphex aeeff7f350 (D3D11) Cleanup 2020-08-16 03:11:00 +02:00
twinaphex 2a9915f80d (D3D) Buildfix 2020-08-08 19:12:01 +02:00
twinaphex ade58fc8b6 (UWP) Buildfix 2020-08-08 18:17:40 +02:00
twinaphex 72afa2f932 Cleanups 2020-08-03 16:33:54 +02:00
twinaphex 332bcc7f9e Remove dxgi_update_title 2020-08-03 15:48:08 +02:00
twinaphex db80281b0f (D3D11) Move static global variables to D3D11 state 2020-08-03 12:36:51 +02:00
twinaphex 3e41cbc381 Revert "Add get_metrics to poke interface"
This reverts commit 119689c940.
2020-08-02 23:44:28 +02:00
twinaphex 119689c940 Add get_metrics to poke interface 2020-08-02 19:25:45 +02:00
twinaphex 60f3265017 Cleanups 2020-07-27 13:16:14 +02:00
twinaphex 3d893b7602 Add extra parameter to unload_texture 2020-07-27 10:15:28 +02:00
twinaphex 9f20a48602 (D3D10/11/12) Implement resolution callback functions 2020-07-25 11:47:49 +02:00
twinaphex 7c66f0adbc Simplify win32_check_window 2020-07-18 17:09:07 +02:00
twinaphex 87b9c2a367 Add HAVE_REWIND switch 2020-07-01 21:04:05 +02:00
twinaphex 2660182d52 Get rid of gfx_widgets_ready call inside
gfx_widgets_frame
2020-06-08 05:45:15 +02:00
twinaphex 9ace693ec0 Refactor menu_driver_frame 2020-05-19 16:20:43 +02:00
valadaa48 6e4228b054 Add drm_go2_ctx for odroidgo2
- Revert odroidgo changes to drm_ctx
- Introduce new drm_go2_ctx specifically for odroidgo2 (and libgo2)
- Add hw_scaling option to mitigate builtin gl scaling/filtering and to
use libgo2 and rga's hw scaling and bicubic filtering via librga. The
quality of the image is improved by this and should be a bit faster.

Credits to CrashOverride for the initial libgo2 port and
commit to RA. And to natinusala for the initial cleanup/commit in the original
drm_ctx driver. NOirBRight for finding this setting and testing.
2020-03-28 03:30:28 +00:00
jdgleaver 086c68bca7 Enable widget persistence across drivers_init()/driver_uninit() events 2020-03-11 11:47:13 +00:00
twinaphex f4c5036c3c Get rid of video_frame_info dep for fonts 2020-03-10 03:24:59 +01:00
twinaphex 4e6f26d2e4 (Video drivers) Cleanups 2020-03-09 16:24:20 +01:00
twinaphex c32cb51755 Cleanups 2020-03-08 01:45:29 +01:00
twinaphex f0bf2df92f Get rid of stale PERF_START/PERF_STOP macros in d3d files 2020-03-07 23:16:25 +01:00
twinaphex 68664fdf1d update_title - we don't need video_info 2020-03-06 22:11:44 +01:00
twinaphex 3a94c52426 (gfx drivers) Start reducing settings pointer usage 2020-02-18 14:51:40 +01:00
twinaphex 7c7d0f596a HAVE_MENU_WIDGETS now decoupled from HAVE_MENU 2020-02-17 21:28:42 +01:00
twinaphex b00bf17153 Move menu_widgets to gfx/ and call it gfx_widgets 2020-02-17 01:54:07 +01:00
twinaphex b229f267e4 Rename menu_widgets to gfx_widgets 2020-02-17 01:43:40 +01:00
twinaphex ec302bc4fc video_set_nonblock_state - remove settings dependency 2020-02-16 22:26:07 +01:00
twinaphex 47af95469a (font_driver.c) Remove configuration.h dependency 2020-02-16 21:59:03 +01:00
twinaphex 64c515bac4 Turn while (true) into for (;;) for easier MSVC backwards compatibility 2020-02-01 04:15:22 +01:00
twinaphex f0e889b552 Change prototype of video_driver_set_size 2020-01-31 15:06:50 +01:00
twinaphex f92a507a9b Change function signature of font_driver_render_msg 2020-01-04 16:24:14 +01:00
twinaphex 3e1f56d57f Change function signature of win32_has_focus 2020-01-04 15:49:23 +01:00
twinaphex 91baea201a Change function signature of win32_show_cursor 2020-01-04 15:40:02 +01:00
GH Cao 91ee8c8ee6 D3D11: Block 9_3 devices, implement gl failback 2020-01-03 09:44:24 +08:00
GH Cao a4e810795c D3D: Add get_metrics 2020-01-03 09:40:41 +08: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
twinaphex 6c671faed6 Start preparing for menu_widgets_ready to be moved to retroarch.c 2019-08-15 14:20:51 +02:00
twinaphex 65b4c2595e Update set keyboard mapping code for input driver 2019-07-27 02:21:24 +02:00
Roman Fomin e01095a51b Fix maintaining aspect ratio 2019-07-23 01:33:43 +07: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 c0787accc3 Use config_file_new_from_path_to_string 2019-07-18 12:13:09 +02:00
twinaphex 09f5d2c95d Fix compilation when configuring with --disable-overlay 2019-07-10 05:39:50 +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
Brad Parker d01f04c146 d3d10/11/12: add GPU selection 2019-06-18 16:35:50 -04: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
twinaphex ee3208ac39 Integrate video_driver.c into retroarch.c 2019-06-17 15:10:22 +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 b54ad4d67f implement FrameDirection slang semantic for d3d10,11,12 2019-05-29 18:09:37 +02:00
twinaphex 6aed230930 Reimplement 'Take Screenshot' - if GPU-accelerated viewport screenshots
are not available, resort to raw screenshots instead
2019-05-22 07:08:11 +02:00
Huw Pascoe 2c56011f84 video_layout interface 2019-05-11 09:58:48 +01:00
twinaphex bc2bdd5734 config_file_read not needed anymore 2019-04-30 13:37:10 +02:00
twinaphex 146b4ccc50 Use config_file_read in more places 2019-04-22 02:20:04 +02:00