Commit graph

131 commits

Author SHA1 Message Date
Zephyron
45683a4034 video_core/vulkan: Improve texture format conversion handling
Refactors and improves the texture format conversion system in the Vulkan
renderer:

- Adds proper sRGB to linear conversion for depth formats
- Improves shader accuracy for ABGR8 SRGB to D24S8 conversion
- Adds gamma correction and proper depth range clamping
- Moves GetSupportedFormat implementation to header
- Cleans up format conversion switch statement
- Removes redundant format conversion paths

The changes improve accuracy when converting between color and depth
formats, particularly for sRGB sources. The shader improvements ensure
proper gamma correction and depth range handling.

Technical changes:
- Improves sRGB to linear conversion in fragment shader
- Adds proper depth value clamping
- Consolidates format conversion logic
- Removes duplicate GetSupportedFormat implementation
2025-04-11 17:05:41 -03:00
Zephyron
3e835ac3aa video_core: Add new shader format conversion pipelines
Adds several new shader-based format conversion pipelines to support additional
texture formats and operations:

- RGBA8 to BGRA8 conversion
- YUV420/RGB conversions
- BC7 to RGBA8 decompression
- ASTC HDR to RGBA16F decompression
- RGBA16F to RGBA8 conversion
- Temporal dithering
- Dynamic resolution scaling

Updates the texture cache runtime to handle these new conversion paths and adds
helper functions to check format compatibility for dithering and scaling
operations.

The changes include:
- New shader files and CMake entries
- Additional conversion pipeline setup in BlitImageHelper
- Extended format conversion logic in TextureCacheRuntime
- New format compatibility check helpers
2025-04-11 17:05:30 -03:00
Zephyron
5cb3153f15 video_core: Add sRGB to D24S8 depth-stencil conversion support
Implements conversion from sRGB color formats to D24S8 depth-stencil format
in the Vulkan renderer. This change includes:

- New fragment shader convert_abgr8_srgb_to_d24s8.frag that handles proper
  sRGB to linear conversion before depth calculation
- Added shader to CMake build system
- Extended BlitImageHelper with new conversion pipeline and methods
- Updated texture cache to handle sRGB to D24S8 format conversion paths

The conversion properly handles sRGB color space by first converting to
linear space before calculating luminance values for the depth component,
while preserving alpha channel data for the stencil component.
2025-04-11 17:05:20 -03:00
Narr the Reg
e29b241a5a Merge pull request #12756 from liamwhite/applet-multiprocess-hwc
general: applet multiprocess
2024-02-11 20:58:28 -06:00
Liam
47eeb0008b host_shaders: add vendor workaround for adreno drivers 2024-02-10 12:02:37 -05:00
Liam
1c32e4157c nvnflinger/gpu: implement blending 2024-02-09 09:20:53 -05:00
Liam
f727f13cb9 renderer_vulkan: implement layer stack composition 2024-01-31 11:27:21 -05:00
Liam
cc8493ea2e renderer_vulkan: convert FSR to graphics pipeline 2024-01-31 11:27:21 -05:00
Liam
bd9c228844 renderer_opengl: split out FXAA 2024-01-31 11:27:20 -05:00
Viktor Szépe
e895ebb546 Fix typos in video_core 2024-01-07 22:44:55 +00:00
liamwhite
67c3d2abb5 Merge pull request #11795 from Squall-Leonhart/D32FToOther
[Vulkan]Implement missing copy formats for D32, ARGB8_SRGB and BGRA8_Unorm/SRGB
2023-10-18 09:22:14 -04:00
liamwhite
97c9b2eda6 Merge pull request #11349 from vonchenplus/buffer_cache_crash
video_core: Fix moltenvk crash on macos
2023-10-17 11:48:44 -04:00
Squall-Leonhart
3785a469c0 Changes based on hardware tests
Removes unnecessary d32f to bgra shader and blit functions,
update vk_texture_cache to use abgr shader for d32f to BGRA formats
updates  abgr to d32f shader to comply with hardware tests
2023-10-17 02:42:40 +11:00
Squall Leonhart
0fff99d0eb added missing trailing line. 2023-10-16 06:07:26 +11:00
Squall-Leonhart
9e0b778d11 use texelfetch instead of texturelod 2023-10-16 04:20:45 +11:00
Squall-Leonhart
69ab83ae87 Another missing copy connected to Bravely Default II
adds blit_image_helper.ConvertABGR8ToD32F and fragment shader for performing ABGR and BGRA to D32F copies
2023-10-16 03:17:53 +11:00
Squall-Leonhart
e84147e2fa Implement missing formats for Bravely Default 2 2023-10-15 20:43:48 +11:00
Squall Leonhart
c3658018b1 update shader to confirmed format copy 2023-10-07 18:28:09 +11:00
Squall-Leonhart
15a624a6df lets not convert depth to greyscale since this makes the exhaust and tire smoke light gray/white
tiresmoke should be a darker gray.
2023-10-05 03:14:53 +11:00
Squall-Leonhart
ec6ba091cf Implements D32_Float to A8B8G8R8_UNORM format copy
Corrects some visual issues in games such as Disney SpeedStorm
2023-10-04 19:07:05 +11:00
GPUCode
30c67e5bb0 host_shaders: More proper handling of x2 MSAA copies 2023-09-25 09:20:32 -04:00
Fernando Sahmkow
e0477e40bd Query Cache: Fix Prefix Sums 2023-09-23 23:05:30 +02:00
Fernando Sahmkow
6b0a777d19 Query Cache: Simplify Prefix Sum compute shader 2023-09-23 23:05:30 +02:00
Fernando Sahmkow
c2880497ce Query Cache: Implement host side sample counting. 2023-09-23 23:05:30 +02:00
Fernando Sahmkow
5ea12207f3 Query Cachge: Fully rework Vulkan's query cache 2023-09-23 23:05:29 +02:00
Feng Chen
666bdc1125 video_core: Fix d24r8/s8d24 convert shader build error in moltenvk 2023-09-07 18:01:36 +08:00
liamwhite
62fbba8575 Merge pull request #11149 from ameerj/astc-perf-prod
host_shaders: ASTC compute shader optimizations
2023-08-21 16:08:51 -04:00
Kelebek1
5d1961ad67 Masked depthstencil clears 2023-08-19 03:29:46 +01:00
Ameer J
4c1cf94f3a flatten color_values 2023-08-09 18:45:52 -04:00
Ameer J
18328533d0 flatten encoding_values 2023-08-09 18:38:37 -04:00
Ameer J
6077bac118 flatten result vector 2023-08-09 18:34:57 -04:00
Ameer J
433d7cbd52 GetUnquantizedWeightVector 2023-08-09 17:45:39 -04:00
Ameer J
3f114d8e5e Compute Replicate 2023-08-06 14:54:58 -04:00
Ameer J
166a17f4ba minor 2023-08-06 14:54:58 -04:00
Ameer J
4c40c8be29 undo uint 2023-08-06 14:54:58 -04:00
Ameer J
b57854fb5f Revert "vulkan dims specialization"
This reverts commit e6243058f2269bd79ac8479d58e55feec2611e9d.
2023-08-06 14:54:58 -04:00
ameerj
9c5c5cbf06 vulkan dims specialization 2023-08-06 14:54:58 -04:00
Ameer J
790010da61 small_block opt 2023-08-06 14:54:58 -04:00
Ameer J
cc6abe21ea remove TexelWeightParams 2023-08-06 14:54:57 -04:00
Ameer J
9085d26036 error/void extent funcs 2023-08-06 14:54:57 -04:00
Ameer J
827cb40765 more packing 2023-08-06 14:54:57 -04:00
Ameer J
20b7b4c2b7 Revert "uint result index"
This reverts commit 0e978786b5a8e7382005d8b1e16cfa12f3eeb775.
2023-08-06 14:54:57 -04:00
Ameer J
aa28865ff7 Revert "bfe instead of mod"
This reverts commit 86006a3b09e8a8c17d2ade61be76736a79e3f58a.
2023-08-06 14:54:57 -04:00
Ameer J
74d905d5cd Revert "global endpoints"
This reverts commit d8f5bfd1df2b7469ef6abcee182aa110602d1751.
2023-08-06 14:54:57 -04:00
Ameer J
97810e725b global endpoints 2023-08-06 14:54:57 -04:00
Ameer J
a08e31d053 bfe instead of mod 2023-08-06 14:54:57 -04:00
Ameer J
48862223ae uint result index 2023-08-06 14:54:57 -04:00
Ameer J
d14b1929bc amd opts 2023-08-06 14:54:57 -04:00
Ameer J
950680f29f const, pack result_vector and replicate tables,
undo amd opts
2023-08-06 14:54:57 -04:00
Ameer J
dc851097e6 minor redundancy cleanup 2023-08-06 14:54:57 -04:00