297 Commits

Author SHA1 Message Date
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
bf2e7b93f0 (Vulkan) Fix Vulkan validation layer - fix thanks to flyinghead -
see comments
2021-08-29 20:39:22 +02:00
Autechre
a04fe66032
Merge pull request #12380 from stenzek/vulkan-software-fb
(video/vulkan) Avoid caching stale mapped GPU texture as frame data
2021-05-18 18:01:47 +02:00
jdgleaver
484c4ad51e Add API extension for cores to override frontend fast-forward state 2021-05-13 13:16:37 +01:00
Stenzek
c9aaf598bb (video/vulkan) Avoid caching stale mapped GPU texture as frame data
At best, this results in junk on screen, at worst we could crash.

It's not a perfect fix, there's still a scenario where this breaks: when
fast forwarding is enabled, and we swap from vsync-off to vsync-on when
pausing/rendering the menu, the swap chain (and textures) gets
recreated, and the frame data is completely lost.

There isn't much we can do about this without more intrusive changes,
such as preserving the textures inbetween swap chain reinits.
2021-05-11 09:49:39 -07:00
twinaphex
32a6bd021c Prevent 'may be used uninitialized' warning 2021-03-22 15:46:34 +01:00
sonninnos
6c3c2bea5f Logging cleanups 2021-02-18 18:35:31 +02:00
twinaphex
d55ca599e0 Replace with macros 2020-12-15 07:28:39 +01:00
twinaphex
cdca5d0afc Turn vulkan_copy_staging_to_dynamic into macro 2020-12-15 07:20:33 +01:00
twinaphex
d70420a12d vulkan_copy_staging_to_dynamic - put sync texture to GPU
outside of the function
2020-12-15 07:01:00 +01:00
twinaphex
6b38a7916a (Vulkan) Simplify code 2020-12-15 06:19:48 +01:00
twinaphex
44b7234756 Move cheat_manager and state_manager to root folder 2020-10-15 05:29:20 +02:00
twinaphex
a11a0eae77 (Vulkan) Style nits 2020-10-12 01:36:50 +02:00
twinaphex
5c76ccbe4a Cleanups 2020-10-12 01:26:51 +02:00
Ophidon
05c5bdf587 C89 Compliance
For loop iterators updated for C89 compliance.
2020-09-19 13:28:21 -04:00
Ophidon
2f36c94f3f Variable BFI
BFI support added for 180hz / 240hz / etc. Solves issue with image retention from voltage issues at 120hz BFI. Also disabled BFI while in menu, as if set to an incorrect value for the current refresh rate, could cause severe flickering and difficulty reverting to the correct value.
2020-09-18 11:57:32 -04:00
jdgleaver
55b6d8ba15 Miscellaneous overlay fixes 2020-09-11 17:00:44 +01:00
twinaphex
bb58b0d6e3 (GLSLANG) Move more common code out of shader_gl_core and shader_vulkan
and into glslang_util.h
2020-08-16 02:05:38 +02:00
twinaphex
72afa2f932 Cleanups 2020-08-03 16:33:54 +02:00
twinaphex
85e5c783af Backport getting rid of video_context_driver_input_driver 2020-08-03 00:47:58 +02:00
twinaphex
deee393dfb Backport video_context_driver_free changes 2020-08-03 00:35:07 +02:00
twinaphex
3e41cbc381 Revert "Add get_metrics to poke interface"
This reverts commit 119689c9405b5e4a321fafc340f6f0294b0338c3.
2020-08-02 23:44:28 +02:00
twinaphex
da5806a810 Revert "Cleanups"
This reverts commit a01a2375a18bdabba2ead7de693e94cddb2622db.
2020-08-02 23:43:56 +02:00
twinaphex
2efa8ac80e Revert "Get rid of video_context_driver_input_driver"
This reverts commit 75b1a09184fdf3bc502a7e62cd7137ee2741e5af.
2020-08-02 23:43:19 +02:00
twinaphex
75b1a09184 Get rid of video_context_driver_input_driver 2020-08-02 20:37:21 +02:00
twinaphex
a01a2375a1 Cleanups 2020-08-02 20:19:42 +02:00
twinaphex
119689c940 Add get_metrics to poke interface 2020-08-02 19:25:45 +02:00
twinaphex
416363e9fd Cleanups 2020-08-02 18:49:31 +02:00
twinaphex
7f1cd52d65 Remove video_driver_context_get_size 2020-07-27 14:33:21 +02:00
twinaphex
d6465a1348 Refactor 'focus' function callback 2020-07-27 13:46:55 +02:00
twinaphex
74345f08d6 Refactor video_driver_has_windowed 2020-07-27 13:39:02 +02:00
twinaphex
60f3265017 Cleanups 2020-07-27 13:16:14 +02:00
twinaphex
61b798b789 Get rid of video_context_driver_set_video_mode 2020-07-27 11:08:34 +02:00
twinaphex
3d893b7602 Add extra parameter to unload_texture 2020-07-27 10:15:28 +02:00
twinaphex
dc94356505 Cleanup context driver video output functions 2020-07-27 09:38:20 +02:00
twinaphex
8dc7524e43 Get rid of video_context_driver_translate_aspect wrapper function 2020-07-27 08:15:35 +02:00
twinaphex
4e5037d7e1 Revert "Get rid of these context driver higher level functions"
This reverts commit 27b09229b3478ee4df4ff6e9d88f3a7fd61b2854.
2020-07-26 23:11:24 +02:00
twinaphex
27b09229b3 Get rid of these context driver higher level functions 2020-07-26 11:58:38 +02:00
twinaphex
cb138183ad (Vulkan) Implement video resolution callback functions 2020-07-25 11:35:42 +02:00
twinaphex
6b466c6013 Cleanups 2020-07-09 07:46:40 +02:00
twinaphex
f6c4890063 Get rid of cb_set_resize 2020-07-09 05:36:29 +02:00
twinaphex
276e86a403 (Vulkan) Turn some of these functions into macros 2020-07-03 17:48:46 +02:00
twinaphex
25f682249f (Vulkan) Turn vulkan_image_layout_transition into macro 2020-07-03 08:45:53 +02:00
twinaphex
87b9c2a367 Add HAVE_REWIND switch 2020-07-01 21:04:05 +02:00
twinaphex
120afe5d21 (Vulkan) return early/error out if no context driver is found 2020-06-30 01:33:19 +02:00
twinaphex
1b3826b348 (Vulkan) Avoid some unnecessary memsets 2020-06-29 00:02:45 +02:00
twinaphex
bc73a815b7 Prevent memsets for vk->tracker 2020-06-28 19:18:48 +02:00
twinaphex
c1f90e4c9a (Vulkan) Cleanups 2020-06-28 01:09:33 +02:00
Themaister
cd4f22c275 Vulkan: Add path which uses WSI acquire semaphores.
Fence wait path has some issues on certain platforms. For now, gate this
on whether the GPU is integrated or not.
2020-06-09 00:24:29 +02:00
Themaister
15df55d011 Vulkan: Refactor swapchain index and frame index.
Do not tie these concepts together, it will not work for upcoming
refactor of swapchain logic.
2020-06-09 00:24:29 +02:00