31 Commits

Author SHA1 Message Date
LibretroAdmin
75757d7d02 Remove unused DXGI inline functions 2022-09-11 23:15:25 +02:00
LibretroAdmin
5739c537a2 Some CXX_BUILD fixes 2022-08-05 17:40:06 +02:00
Autechre
4c3a4d66df
Cxx buildfixes (#13803)
* CXX_BUILD buildfixes
* (D3D11) Buildfixes for CXX_BUILD
* (Linux/qb) Disable KMS for Linux when building for C89, headers use inline which is not
available for C89
2022-03-30 17:30:20 +02:00
MajorPainTheCactus
9151326b73
Added support for HDR shaders - if we detect a shader that uses SLANG_FORMAT_A2B10G10R10_UNORM_PACK32 or SLANG_FORMAT_R16G16B16A16_SFLOAT as the format for the last render target in the shader chain AND hdr is switched on then this disables the internal HDR shader and allows the shader chain to define an inverse tonemapper and hdr10 shader. The first use of this is for my hdr shader crt\crt-sony-pvm-4k-hdr.slangp - submitted seperately (#13390) 2021-12-22 02:17:17 +01:00
twinaphex
e4ccc2508e Move code over from retroarch.c to video_driver.c 2021-11-05 02:33:22 +01:00
MajorPainTheCactus
3c6bdfd0d8
Fixed numerous issues with HDR (#12979)
* Fix for warning and fix for incorrect comment

* Fixed contrast to be more correct - now scales from 0-10 linearly and behaves more the way you'd expect it to - changed name to ditch legacy settings users may have
Added ability to skip inverse tonemapper to the shader via the constant buffer using 'inverse_tonemap' - set to 0.0f to skip
Fixed potential bug when swapping between hdr and sdr and the bit depth not being set correctly
Fixed dx11's blend, rasterizer and topology states not being set to the sames when using hdr and leaving the menu - caused issues with PCSX2's Shadow of the Colossus
Added numerous helper functions to help create the correct values to colour the UI - normally the white UI elements should be rendered at paper white not max brightness for various reasons

* Fix stylistic issues - * Don't use camelcase for variables and function names * Use '(void)' for function declarations instead of () in C code * Declare variables at the top of a function or code block * Make sure functions that return a value always have a default return path that is not encapsulated by an else block * Use more unique names for retro_math functions which are less likely to overlap with other libraries' function symbols

Co-authored-by: twinaphex <libretro@gmail.com>
2021-09-13 16:54:50 +02:00
twinaphex
b05a0d5aed * Enable HDR for WinRT/UWP (only works on PC UWP for now, won't work on Xbox yet swapchain
issues with both D3D11/12)
* Add sublabel for Expand Gamut
*
2021-09-04 21:36:48 +02:00
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
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
6b3fcf79f0 (DXGI) Turn these into macros 2020-08-24 00:04:12 +02:00
twinaphex
332bcc7f9e Remove dxgi_update_title 2020-08-03 15:48:08 +02: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
Dwedit
81b6703912 Fix wrong reference count for D3D12 adapters (crash at close due to a destroyed adapter being released again) 2019-07-03 15:35:06 -05:00
twinaphex
ee3208ac39 Integrate video_driver.c into retroarch.c 2019-06-17 15:10:22 +02:00
krzys-h
4fb06703b3 Port d3d12 driver for UWP 2018-12-28 22:10:26 +01:00
krzys-h
b201d669b5 First iteration of UWP support
Enough to kind of run

Working drivers: xinput, d3d11
Still missing: input driver with keyboard support, audio driver
2018-12-28 22:09:22 +01:00
twinaphex
a1d5b0fd03 Update MSVC 2012 solution 2018-08-16 20:49:31 +02:00
twinaphex
714f7b7b13 Cleanups 2018-04-27 23:21:44 +02:00
aliaspider
37bebb5b65 (D3D12) slang shaders support. 2018-02-11 00:00:20 +01:00
twinaphex
2b4890220a (D3D) Silence CXX_BUILD warnings 2018-02-04 20:40:28 +01:00
aliaspider
700fce3bd2 various fixes for CXX_BUILD. 2018-02-04 20:03:27 +01:00
aliaspider
3865856aa2 (D3D11) add support for #pragma format in slang shaders. 2018-02-01 15:07:12 +01:00
aliaspider
b228775b0d (D3D10/11/12) allow building without HAVE_D3D9 2018-01-30 21:33:25 +01:00
aliaspider
4a3e4fc7de (mingw) include all of the sal.h defines in dxgi_common.h 2018-01-30 20:02:40 +01:00
aliaspider
13f18afcd9 (D3D10/11/12) cleanups / fixes. 2018-01-30 19:34:53 +01:00
twinaphex
aeab2e5bd1 enable d3d10/11/12 again for mingw build 2018-01-30 16:04:45 +01:00
twinaphex
03e800c1c8 Add HAVE_D3D11 to MSVC 2013 - we need non-HAVE_DYNAMIC codepaths
for D3D11
2018-01-29 14:05:44 +01:00
aliaspider
840bd459df (D3D11) add a font driver. 2018-01-24 20:51:19 +01:00
aliaspider
a5bf9d8dc6 (D3D10/11/12)
.add a d3d10 driver.
.add more utility functions to d3d*_common files.
.add an image transfer/convert function to dxgi_common.
.various refactors / style nits.
2018-01-23 18:04:55 +01:00
aliaspider
094196220d (D3D11/D3D12) initial video driver implementation.
- some headers from the windows 10 sdk need to be added to the include
path when targeting mingw :
   d3d11.h
   d3d11sdklayers.h
   d3d12.h
   d3d12sdklayers.h
   d3d12shader.h
   d3dcommon.h
   d3dcompiler.h
2018-01-21 04:10:45 +01:00