ever implemented for OpenGL2 driver, lots of code debt, best to
instead just keep improving the overlay system instead which is
already available for most video drivers
* 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
This fixes a performance problem introduced in my last commit when
max_swapchain_images == 3.
In my last commit I incorrectly stated the 3rd buffer was not being
used, after doing some additional testing I realized I was mistaken,
it can indeed be used due to the used page tracking.
Reverting that portion of my previous commit.
When max_swapchain_images was originally added it worked properly,
but was subsequently broken by using the value to specify the number
of buffers allocated.
Due to how the dispmanx driver works, only 2 buffers are ever actually
used, so the 3rd buffer in the "swapchain" ended up doing nothing.
Fix this by restoring it to the original intent, that is, if
max_swapchain_images <= 2 wait for vsync after the flip (reducing
lag), otherwise wait at the last possible moment (increasing lag).
Additionally, fix up some unnecessary void* usage where type safety
could be maintained.
It's unlikely it was causing issues, but another race existed in the
dispmanx driver, it incremented the pending page count after sending the
update request.
If a context switch happened between sending the update and incrementing
the page count, the vsync callback would decrement it from 0 and cause
the uint to overflow.
Throw in a minor C89 fix and some whitespace fixups too.
The dispmanx driver had a small race wherein if the vsync completed
between checking for a free page and waiting on the condvar, it would
hang forever waiting for a condition that would never fire.
I'm hoping this is what was causing the triple buffering lockups. In
my testing with it re-enabled and this fix, things are stable (and
much more performant than with triple buffering disabled).