Commit graph

1571 commits

Author SHA1 Message Date
Wunk 3218af38d0
renderer_vulkan: Add scissor and viewport to dynamic pipeline state (#7114)
Adds the current viewport and scissor to the dynamic pipeline state to
reduce redundant viewport/scissor assignments in the command buffer.
This greatly reduces the amount of API calls to `vkCmdSetViewport` and
`vkCmdSetScissor` by only emitting the API call when the state actually
changes.
2023-11-05 12:26:09 -08:00
Wunk 1cf64ffaef
vk_stream_buf: Allow dedicated allocations (#7103)
* vk_stream_buf: Avoid protected memory heaps

* Add an "Exclude" argument when finding a memory-type that avoids
  `VK_MEMORY_PROPERTY_PROTECTED_BIT` by default

* vk_stream_buf: Utilize dedicated allocations when preferred by driver

`VK_KHR_dedicated_allocation` is part of the core Vulkan 1.1
specification and should be utilized when `prefersDedicatedAllocation`
is set.
2023-11-05 12:25:59 -08:00
Wunk b10f3d96f5
command_processor: Fix out-of-bounds float-uniform access (#7111)
Addresses:
https://github.com/citra-emu/citra/issues/6696
https://github.com/citra-emu/citra/issues/6871
2023-11-03 03:35:52 -07:00
Wunk ac9d72a95c
vk_texture_runtime: Fix debug scope label lambda-capture (#7102)
`DebugScope` was capturing a `string_view` in a lambda which is only
valid during the scope of this ctor. When the lambda gets invoked at a
later time, it will read undefined garbage. The lambda needs to make a
deep copy of this `string_view` into a `string` so that it is valid by
the time the scheduler invokes this lambda.
2023-11-01 21:30:54 +01:00
GPUCode 36146459f8
renderer_vulkan: Fix screenshots under NVIDIA vulkan (#7082) 2023-10-22 22:53:14 +03:00
GPUCode ef43776c7b
shader: Fix address register offset behavior in x64 Jit (#6942)
* shader: Fix address register offset behavior in x64 Jit

* shader: Remove redundant jump

* tests: Add address register tests

* shader: Remove additional pre-multiplications by 16

* tests: Add catch-stringifier for vec4f

* tests: Format
2023-10-18 19:41:36 +03:00
Steveice10 4c59443ed2
common: Add more robust ZSTD handling. (#7071) 2023-10-15 14:08:29 -07:00
GPUCode 40ba5226c6
vk_instance: Perform vulkan logging as early as possible (#7058) 2023-10-11 15:11:43 -07:00
Steveice10 4220f69c06
renderer/opengl: Deduce GLES from actual driver in use. (#7056) 2023-10-10 12:52:47 -07:00
SachinVin 053b3618dc
Android: gl_shader_decompiler.cpp: get rid of the not-so-accurate multiplication (#7011) 2023-10-05 10:28:26 -07:00
Steveice10 50f22d1f59
video_core: Abstract shader generators. (#6990)
* video_core: Abstract shader generators.

* shader: Extract common generator structures and move generators to specific namespaces.

* shader: Minor fixes and clean-up.
2023-09-30 02:06:06 -07:00
Vitor K a35f8cbb78
fix include/namespace related compilation errors (#7019)
a user on discord reported compilation errors when trying to compile
on Linux with GCC 13 and Clang 16.
2023-09-28 18:36:50 +05:30
Vitor K 6cfb8e02a8
clang format (#7017) 2023-09-27 13:42:19 -03:00
Steveice10 327a00b4d5
externals: Update fmt. (#7015) 2023-09-27 03:29:13 -07:00
GPUCode 542209c993
video_core: Initialize unrefered attributes to 1.f (#6966) 2023-09-16 14:46:44 -07:00
GPUCode d2d37411bc
vk_platform: Check if vkEnumerateInstanceVersion exists before calling it (#6982)
Co-authored-by: Vitor K <vitor-kiguchi@hotmail.com>
2023-09-15 16:00:10 -07:00
GPUCode 30fcdc5474
renderer_vulkan: Misc fixes (#6974)
* vk_platform: Check if library was loaded

* pica_to_vk: Dont crash on unknow blend equation
2023-09-15 00:21:12 +03:00
GPUCode dfa2fd0e0d
Add vulkan backend (#6512)
* code: Prepare frontend for vulkan support

* citra_qt: Add vulkan options to the GUI

* vk_instance: Collect tooling info

* renderer_vulkan: Add vulkan backend

* qt: Fix fullscreen and resize issues on macOS. (#47)

* qt: Fix bugged macOS full screen transition.

* renderer/vulkan: Fix swapchain recreation destroying in-use semaphore.

* renderer/vulkan: Make gl_Position invariant. (#48)

This fixes an issue with black artifacts in Pokemon games on Apple GPUs.
If the vertex calculations differ slightly between render passes, it can
cause parts of model faces to fail depth test.

* vk_renderpass_cache: Bump pixel format count

* android: Custom driver code

* vk_instance: Set moltenvk configuration

* rasterizer_cache: Proper surface unregister

* citra_qt: Fix invalid characters

* vk_rasterizer: Correct special unbind

* android: Allow async presentation toggle

* vk_graphics_pipeline: Fix async shader compilation

* We were actually waiting for the pipelines regardless of the setting, oops

* vk_rasterizer: More robust attribute loading

* android: Move PollEvents to OpenGL window

* Vulkan does not need this and it causes problems

* vk_instance: Enable robust buffer access

* Improves stability on mali devices

* vk_renderpass_cache: Bring back renderpass flushing

* externals: Update vulkan-headers

* gl_rasterizer: Separable shaders for everyone

* vk_blit_helper: Corect depth to color convertion

* renderer_vulkan: Implement reinterpretation with copy

* Allows reinterpreteration with simply copy on AMD

* vk_graphics_pipeline: Only fast compile if no shaders are pending

* With this shaders weren't being compiled in parallel

* vk_swapchain: Ensure vsync doesn't lock framerate

* vk_present_window: Match guest swapchain size to vulkan image count

* Less latency and fixes crashes that were caused by images being deleted before free

* vk_instance: Blacklist VK_EXT_pipeline_creation_cache_control with nvidia gpus

* Resolves crashes when async shader compilation is enabled

* vk_rasterizer: Bump async threshold to 6

* Many games have fullscreen quads with 6 vertices. Fixes pokemon textures missing with async shaders

* android: More robust surface recreation

* renderer_vulkan: Fix dynamic state being lost

* vk_pipeline_cache: Skip cache save when no pipeline cache exists

* This is the cache when loading a save state

* sdl: Fix surface initialization on macOS. (#49)

* sdl: Fix surface initialization on macOS.

* sdl: Fix render window events not being handled under Vulkan.

* renderer/vulkan: Fix binding/unbinding of shadow rendering buffer.

* vk_stream_buffer: Respect non coherent access alignment

* Required by nvidia GPUs on MacOS

* renderer/vulkan: Support VK_EXT_fragment_shader_interlock for shadow rendering. (#51)

* renderer_vulkan: Port some recent shader fixes

* vk_pipeline_cache: Improve shadow detection

* vk_swapchain: Add missing check

* renderer_vulkan: Fix hybrid screen

* Revert "gl_rasterizer: Separable shaders for everyone"

Causes crashes on mali GPUs, will need separate PR

This reverts commit d22d556d30.

* renderer_vulkan: Fix flipped screenshot

---------

Co-authored-by: Steveice10 <1269164+Steveice10@users.noreply.github.com>
2023-09-13 01:28:50 +03:00
GPUCode 9be4fd8b91
gl_rasterizer: Bind null surface when unit is disabled (#6967) 2023-09-11 19:34:41 +03:00
Vitor K bbb47cd753
gles: fix crashing on mali gpus (#6956)
* gles: reorder framebuffer fetch extension directives

* Address review comments
2023-09-11 00:30:30 +03:00
GPUCode 0b0d3a4ac3
gpu: Correct display transfer output with vertical flip+crop lines (#6952) 2023-09-11 00:30:06 +03:00
GPUCode 6aa31d6ec2
video_core: Use epsilons for clip planes (#6945)
* video_core: Use epsilons for clip planes

* video_core: Add comments
2023-09-11 00:29:55 +03:00
GPUCode 928f352c94
renderer_gl: Use explicit bindings (#6940)
* renderer_gl: Use explicit bindings

* gl_state: Match shadow order with vulkan
2023-09-07 21:42:22 +03:00
GPUCode cab0ad50f0
gl_shader_decompiler: Fix min/max NaN edge case (#6935) 2023-08-31 13:37:53 -07:00
Steveice10 5ad58e0605
shader: Fix shadow_texture_orthographic not being set correctly. (#6937) 2023-08-31 13:37:39 -07:00
GPUCode 1159e4d928
video_core: Take factors into account with min/max blending functions (#6925)
* sw_framebuffer: Take factors into account for min/max blending

* renderer_gl: Take factors into account for min/max blending

* Address review comments

* gl_shader_gen: Fix frambuffer fetch on qcom and mali

* renderer_opengl: Add fallback path for mesa

* gl_shader_gen: Avoid emitting blend emulation if minmax_factor is present
2023-08-30 21:26:28 +03:00
Steveice10 81a5e2355a
shader: Fix address register offset behavior in GLSL. (#6920) 2023-08-28 13:23:59 -07:00
GPUCode d1f600601d
renderer_software: Multi-thread processing (#6698)
* renderer_software: Multi-thread processing

* Doubles the performance in most cases

* renderer_software: Move memory access out of the raster loop

* Profiling shows this has a significant impact
2023-08-28 01:09:23 -07:00
GPUCode 8b218e1b7d
tev: Use primary color for previous source in first stage (#6921) 2023-08-27 23:59:32 -07:00
Steveice10 df57012c50
video_core: Correct shader interpeter address register handling. (#6910) 2023-08-27 01:49:31 +03:00
GPUCode 61cf550d0c
video_core: Avoid setting alpha tev with Dot3_RGBA8 color op (#6907)
* Further reduces unnecessary shader regenerations
2023-08-27 01:48:45 +03:00
Steveice10 f2e0748a22
build: Enable link time optimization in release builds. (#6887) 2023-08-26 11:15:13 -07:00
GPUCode a94297922b
shader_interpreter: Fix control flow edge cases and implement break/breakc (#6844) 2023-08-21 18:12:46 -07:00
m4xw e129f07047
[ShaderGen] Avoid setting lighting states if components aren't enabled (#6895)
* [ShaderGen] Avoid setting lighting states if components aren't enabled

* [Squash] clang-format
2023-08-20 21:12:38 -07:00
Steveice10 6ddf4b241f
renderer/vulkan: Emulate custom border colors in shaders when unavailable. (#6878) 2023-08-17 22:22:25 +02:00
Vitor K f3d92dd3b8
Fix post processing shaders crashing on Intel GPUs (#6890) 2023-08-17 22:17:24 +02:00
Vitor K 1a6860f35c
opengl: disable ClearTexture on Intel drivers (#6879) 2023-08-17 22:16:51 +02:00
GPUCode bc0bf4d3d2
(gl/vk)_shader_gen: Use floor instead of int cast (#6885) 2023-08-17 22:16:28 +02:00
Steveice10 6a1fd38063
build: Use new glslang tool name. (#6889) 2023-08-13 15:45:22 -07:00
GPUCode f76165d848
frame_dumper: Use jthread (#6855) 2023-08-07 18:21:28 -07:00
GPUCode ac78b74c45
gl_texture_runtime: Implement ARB_clear_texture (#6850) 2023-08-08 01:10:28 +03:00
GPUCode a478bedb12
rasterizer_cache: Bring back custom format parameter (#6873) 2023-08-08 01:10:11 +03:00
GPUCode 5b52849f90
rasterizer_cache: Allow custom recycle (#6851)
* surface_params: Allow custom surface recycling

* rasterizer_cache: Cleanup
2023-08-06 22:59:54 +03:00
GPUCode ebac2e4978
custom_tex_manager: Allow old hash in more cases (#6843) 2023-08-03 00:51:10 +03:00
GPUCode 6f7612f73d
Res cache fixes (#6838)
* rasterizer_cache: Dont consider res_scale during recycle

* rasterizer_cache: Switch to plain erase loop

* rasterizer_cache: Fix crash due to memory corruption
2023-08-02 21:38:45 +03:00
GPUCode 88ea66053e
Miscallenious fixes to gl backend and qt frontend (#6834)
* renderer_gl: Make rasterizer normal class member

* It doesn't need to be heap allocated anymore

* gl_rasterizer: Remove default_texture

* It's unused

* gl_rasterizer: General cleanup

* gl_rasterizer: Lower case lambdas

* Match style with review comments from vulkan backend

* rasterizer_cache: Prevent memory leak

* Since the switch from shared_ptr these surfaces were no longer being destroyed properly. Use our garbage collector for that purpose to destroy it safely for both backends

* rasterizer_cache: Make temp copy of old surface

* The custom surface would override the memory region of the old region resulting in garbage data, this ensures the custom surface is constructed correctly

* citra_qt: Manually create dialog tabs

* Allows for custom constructors which is very useful. While at it, global state is now eliminated from configuration

* citra_qt: Eliminate global system usage

* core: Remove global system usage in memory and HIO

* citra_qt: Use qOverload

* tests: Run clang format

* gl_texture_runtime: Fix surface scaling
2023-08-02 01:40:39 +03:00
GPUCode baf3ea4beb
custom_tex_manager: Allow old hash in the dumper (#6832) 2023-08-01 20:38:51 +03:00
GPUCode f8b8b6e53c
core: De-globalize movie (#6659) 2023-08-01 02:57:38 +02:00
GPUCode a955f02771
rasterizer_cache: Remove runtime allocation caching (#6705)
* rasterizer_cache: Sentence surfaces

* gl_texture_runtime: Remove runtime side allocation cache

* rasterizer_cache: Adjust surface scale during reinterpreration

* Fixes pixelated outlines. Also allows to remove the d24s8 specific hack and is more generic in general

* rasterizer_cache: Remove Expand flag

* Begone!

* rasterizer_cache: Cache framebuffers with surface id

* rasterizer_cache: Sentence texture cubes

* renderer_opengl: Move texture mailbox to separate file

* Makes renderer_opengl cleaner overall and allows to report removal threshold from runtime instead of hardcoding. Vulkan requires this

* rasterizer_cache: Dont flush cache on layout change

* rasterizer_cache: Overhaul framebuffer management

* video_core: Remove duplicate

* rasterizer_cache: Sentence custom surfaces

* Vulkan cannot destroy images immediately so this ensures we use our garbage collector for that purpose
2023-08-01 03:35:41 +03:00
GPUCode b5e1a27a7e
rasterizer_cache: Handle texture cubes with duplicate faces (#6710) 2023-07-21 01:55:19 +03:00