Commit graph

1636 commits

Author SHA1 Message Date
Wunkolo
aebd108328 Formatting fixes 2024-02-26 09:27:14 -08:00
Wunkolo
cc7d2f6576 rasterizer_cache: Remove MSAA from fill-surfaces and display-transfers 2024-02-26 09:27:14 -08:00
Wunkolo
2653528d28 vk_texture_runtime: Use renderpass-clears for MSAA surfaces
Fixes lots of bugs where we're looking at "stale data" because the MSAA
and non-MSAA texture were not updated at the same time
2024-02-26 09:27:14 -08:00
Wunkolo
64a116b254 vk_texture_runtime: Add explicit "sub-image" index to View accessors
This needs a new pattern, the current one introduces lots of bugs
when we're trying to access the MSAA image.
2024-02-26 09:27:14 -08:00
Wunkolo
8356700ef7 surface_params: Add sample count to surface debug name 2024-02-26 09:27:14 -08:00
Wunkolo
ee7588230b vk_renderpass_cache: Implement depth+stencil render pass resolve 2024-02-26 09:27:14 -08:00
Wunkolo
c4fcd93ff9 vk_instance: Detect MSAA features
The MSAA _requires_ `sampleRateShading`, and also requires
`VK_KHR_create_renderpass2` and `VK_KHR_depth_stencil_resolve` for the
depth-stencil MSAA resolves.
2024-02-26 09:27:14 -08:00
Wunkolo
55c74f54d5 rasterizer_cache: Propagate sample_count to SurfaceParams 2024-02-26 09:27:14 -08:00
Wunkolo
149ef4d900 vk_texture_runtime: Fix CopyTextures MSAA support 2024-02-26 09:27:14 -08:00
Wunkolo
7388e4e32d vk_texture_runtime: Add MSAA support to ClearTextureWithRenderpass 2024-02-26 09:27:14 -08:00
Wunkolo
4e8db844f2 vk_blit_helper: Add d24s8->rgba8 multi-sample blit 2024-02-26 09:27:14 -08:00
Wunkolo
dba83f4898 rasterizer_cache: Unregister all surfaces when sample_count changes
Allows the run-time changing of sample-count.
2024-02-26 09:27:13 -08:00
Wunkolo
3c2f825c84 config: Make sample_count a pow/log-2 index
Sample counts increment in powers of two(1,2,4,8). Rather than storing a direct integer of the number of samples, just store the pow2 index.
2024-02-26 09:27:13 -08:00
Wunkolo
90ad4e1a19 renderer_vk: Fix sample-shading enablement 2024-02-26 09:27:13 -08:00
Wunkolo
369a2314c2 renderer_vk: Create MSAA graphics pipelines
Forced on for now, needs some additional detection and masking for when this feature should be used.
2024-02-26 09:27:13 -08:00
Wunkolo
c091457984 rasterizer: Add multi-sampled surfaces
Vulkan implementation only
2024-02-26 09:27:10 -08:00
Wunkolo
82e9f4ca03 rasterizer: Add multi-sampled framebuffers
Vulkan implementation only
2024-02-26 09:26:10 -08:00
Wunkolo
89ffff3426 vk_renderpass_cache: Add support for multi-sample renderpasses
A multi-sample render-pass will simply append additional attachments to
the end of the attachment list to use as primary color+depth attachments
and will resolve back into the original non-msaa attachments.
Framebuffers must be sure to structure their attachments the same way.
2024-02-26 09:25:20 -08:00
Wunkolo
85a2304b42 vk_graphics_pipeline: Add sample_count to AttachmentInfo
Controls the actual Multisample pipeline-state
2024-02-26 09:25:20 -08:00
Wunkolo
a85dbaded9 rasterizer_cache: Add sample_count 2024-02-26 09:25:20 -08:00
Wunkolo
42b04b048c renderer_base: Add GetSampleCount
Only enables sample counts higher than 1 on vulkan
2024-02-26 09:25:20 -08:00
GPUCode
d857743075
Downgrade blend factor crash to warning (#7459)
* pica_to_vk: Downgrade assert to warning

* pica_to_gl: Downgrade unreachable to warning
2024-02-22 15:43:44 -08:00
Wunk
e524542a40
vk_texture_runtime: Use boost-static_vector (#7455)
* vk_texture_runtime: Use boost-`static_vector` for image init-barriers

Uses `static_vector` rather than `std::array`+`u32` when passing input
parameters into the initialization barriers.

* vk_texture_runtime: Use boost-`static_vector` for framebuffer attachments

* vk_texture_runtime: Use boost-`static_vector` for surface uploads
2024-02-22 02:35:57 +02:00
Steveice10
aa6809e2a8
renderer_vulkan: Use no more than target supported version. (#7439) 2024-02-15 19:38:32 -08:00
Steveice10
5e02be75a3
renderer_vulkan: Use getToolPropertiesEXT instead of getToolProperties (#7434)
getToolProperties is not available until Vulkan 1.3; we need to use the EXT version.
2024-02-13 21:43:09 -08:00
GPUCode
106364e01e
video_core: Use source3 when GPU_PREVIOUS is used in first stage (#7411) 2024-02-05 09:53:54 -08:00
GPUCode
d5a1bd07f3
glsl_shader_gen: Increase z=0 epsillon (#7408) 2024-02-05 09:53:41 -08:00
GPUCode
480604ec72
glsl_shader_fs_gen: Apply shadow before ambient light (#7404) 2024-01-31 23:29:39 +02:00
merry
63feac6bb3
externals: Update dynarmic to 6.6.1, Update oaknut to 2.0.1 (#7398) 2024-01-30 19:50:39 -08:00
SachinVin
7a4854c519
shader_setup.h: Initialise program_code (#7396) 2024-01-28 06:02:40 -08:00
Steveice10
41fe75acb7
renderer_vulkan: Pass physical device API version to VMA instead of instance version. (#7390) 2024-01-26 16:34:12 +02:00
GPUCode
bea863efff
general: Fixes for Tales of the Abyss (#7381)
* geometry_pipeline: Remove unneeded assert

* Has been hw-tested that gs works correctly even when not in exclusive mode

* pica_core: Propagate output_mask to gs

* Has been hw-tested to occur under the same conditions that other uniforms are shared

* regs_shader: Intialize GPUREG_SH_INPUTBUFFER_CONFIG to default value

* Default value verified on hw. Tales of Abyss does not update the number of vertex attributes for the geometry unit and expects it to be 2

* texture_codec: Align buffer sizes to bpp

* Prevents out of bounds texture reads when launching TOA from the HOME menu

* pica_core: Make default value more clear
2024-01-24 19:22:10 +02:00
GPUCode
549fdd0736
pica_core: Propogate vertex uniforms to geometry setup when not in exclusive mode (#7367) 2024-01-24 04:47:08 +02:00
Steveice10
82294425e3
build: Add flags to toggle specific renderer backends. (#7375) 2024-01-21 23:29:46 -08:00
GPUCode
8d82adb3d3
glsl_shader_gen: Remove invariant qualifier (#7376)
* glsl_shader_gen: Remove invariant qualifier

* Causes visual regressions in Pokemon with RADV

* rasterizer_cache: Clear null surface to transparent
2024-01-21 13:39:35 +02:00
GPUCode
ca3b2306d5
shader_unit: Intialize temporaries on shader invocation (#7366) 2024-01-20 22:13:31 +02:00
GPUCode
8e87bd606c
glsl_shader_gen: Use epsilon for both ends of NDC range (#7355) 2024-01-20 22:13:16 +02:00
Steveice10
37f0a7484f
renderer_vulkan: Revert vkGetInstanceProcAddr symbol change for MoltenVK. (#7341) 2024-01-12 09:16:04 -08:00
Steveice10
2ce0a9e899
renderer_vulkan: Update to support MoltenVK 1.2.7 (#7335) 2024-01-09 11:33:47 -08:00
Vitor K
c8c2beaeff
misc: fix issues pointed out by msvc (#7316)
* do not move constant variables

* applet_manager: avoid possible use after move

* use constant references where pointed out by msvc

* extra_hid: initialize response

* ValidateSaveState: passing slot separately is not necessary

* common: mark HashCombine as nodiscard

* cityhash: remove use of using namespace std

* Prefix all size_t with std::

done automatically by executing regex replace `([^:0-9a-zA-Z_])size_t([^0-9a-zA-Z_])` -> `$1std::size_t$2`
based on 7d8f115

* shared_memory.cpp: fix log error format

* fix compiling with pch off
2024-01-07 12:37:42 -08:00
Steveice10
6069fac76d
video_core: Fix crash when no debug context is provided. (#7324) 2024-01-07 10:29:43 -08:00
Steveice10
f2ee9baec7
core: Eliminate more uses of Core::System::GetInstance(). (#7313) 2024-01-05 12:07:28 -08:00
GPUCode
2bb7f89c30
video_core: Refactor GPU interface (#7272)
* video_core: Refactor GPU interface

* citra_qt: Better debug widget lifetime
2023-12-28 11:46:57 +01:00
Wunk
4d9eedd0d8
video_core/vulkan: Add debug object names (#7233)
* vk_platform: Add `SetObjectName`

Creates a name-info struct and automatically deduces the object handle type using vulkan-hpp's handle trait data.
Supports `string_view` and `fmt` arguments.

* vk_texture_runtime: Use `SetObjectName` for surface handles

Names both the image handle and the image-view.

* vk_stream_buffer: Add debug object names

Names the buffer and its device memory based on its size and type.

* vk_swapchain: Set swapchain handle debug names

Identifies the swapchain images themselves as well as the semaphores

* vk_present_window: Set handle debug names

* vk_resource_pool: Set debug handle names

* vk_blit_helper: Set debug handle names

* vk_platform: Use `VulkanHandleType` concept

Use a new `concept`-type rather than `enable_if`-patterns to restrict
this function to Vulkan handle-types only.
2023-12-08 06:58:47 +02:00
Wunk
ea9f522c0c
shader_jit_a64: Use LDP/STP for address registers (#7225)
Move `address_registers` to be earlier in the `UnitState` structure to allow LDP/STP's 7-bit offset to reach these members.

Follow-up of https://github.com/citra-emu/citra/pull/7002#discussion_r1367270804
2023-12-03 05:07:21 -08:00
Wunk
83b329f6e1
video_core/shader: Refactor JIT-Engines into JitEngine type (#7210) 2023-11-26 15:15:36 -08:00
Wunk
68e6a2185d
Fix missing u32 and LOG_TRACE includes (#7207)
This fixes a compile-error with gcc I was getting from
`LOG_TRACE`(`error: ‘LOG_TRACE’ was not declared in this scope`) and
`u32`(`error: ‘u32’ was not declared in this scope`) being used without
their header-files being included.

Not sure how `romfs_reader.cpp` is even compiling when nothing in its
include-tree is refers to those macros.
2023-11-23 15:39:17 -08:00
GPUCode
1dc0fa7bb5
vk_pipeline_cache: Make pipeline cache reads more robust (#7194) 2023-11-22 23:09:12 -08:00
GPUCode
85bd1be852
code: Add texture sampling option (#7118)
* This replaces the nearest neighbour filter that shouldn't have existed in the first place
2023-11-23 02:04:47 +02:00
GPUCode
5733c8681e
vk_pipeline_cache: Move SPIRV emittion to a worker thread (#7170)
* vk_scheduler: Remove RenderpassCache dependency

* vk_pipeline_cache: Move spirv emittion to worker thread
2023-11-20 20:05:35 -08:00