Commit Graph

9379 Commits

Author SHA1 Message Date
2da4c9ca90 citra_qt: Add physical device selection dialog 2022-10-14 21:03:11 +03:00
20ccb995b1 code: Resolve unused variable warnings 2022-10-14 21:03:11 +03:00
601aac2a26 renderer_opengl: Unbind unused framebuffer targets
* Fixes graphical glitches in many games for some reason
2022-10-14 21:03:11 +03:00
924257b2cc renderer_opengl: Emulate texture copy with blit for now 2022-10-14 21:03:11 +03:00
9e34ff40ed renderer_opengl: Address buffer overflow 2022-10-14 21:03:11 +03:00
ba3c84168a video_core: Small code improvements 2022-10-14 21:03:11 +03:00
77d6be6bde renderer_vulkan: Don't sample from mipmaps when using texture cubes
* Mipmaps for texture cubes are unimplemented in the rasterizer cache, so sampling from mipmaps will return nothing
2022-10-14 21:03:11 +03:00
a6e2bcd986 citra_qt: Switch all strings to multiarg 2022-10-14 21:03:11 +03:00
2c30889fdc code: Address more compiler warnings 2022-10-14 21:03:11 +03:00
67a76bec5c citra_qt: Fix more warnings/deprecated functions 2022-10-14 21:03:11 +03:00
98b7c33f62 input_common: Small fix 2022-10-14 21:03:11 +03:00
dbfa06c6b1 citra_qt: Improve graphics API intergration
* Add renderer debug option which toggles debug output in OpenGL/validation layers in Vulkan

* Fix many warnings and replace deprecated Qt functionailty with newer alternatives
2022-10-14 21:03:11 +03:00
88d0b7de13 rasterizer_cache: Code cleanup
* Merge utils and types to a single header
2022-10-14 21:03:11 +03:00
de149e3ee9 texture_decode: Prefer std::memcpy where possible 2022-10-14 21:03:11 +03:00
99877f9465 renderer_vulkan: Rework format handling
* This is a pretty large commit that aims to solve some issues with the current format system
* The instance now builds at application initialization an array of format traits for each pixel format
  that includes information such as blit/attachment/storage support and fallback formats
* The runtime doesn't ask the instance for formats but receives these traits and can dedice on its own what to build
  For now we do the same as before, we require both blit and attachment support

* Morton swizzling also sees many bug fixes. The previous code was very hacky and didn't work for partial
  texture updates. It was also inconsistent, as it would take a tiled_buffer and write to the middle of linear
* Now the functions have been greatly simplified and adjusted to work better with std::span. This fixes out of bounds
  errors and texture glitches (like the display in Mario Kart 7)
2022-10-14 21:03:11 +03:00
075090569f renderer_vulkan: Handle scheduler switches properly 2022-10-14 21:03:10 +03:00
f6af97fc16 vk_platform: Fix wayland build 2022-10-14 21:03:10 +03:00
5fa4a32cf6 renderer_vulkan: Rewrite stream buffer + other fixes
* Emulate blend color and clip planes correctly

* Don't hack the depth in the vertex shader, use VK_EXT_depth_clip_control for now to set the range to -1, 1

* Rewrite the stream buffer to remove flickering problems. The new implementation doesn't try to be smart about holding memory. It divides the allocation in SCHEDULER_COMMAND_COUNT buckets and automatically switches between them based on the current slot index
2022-10-14 21:03:10 +03:00
fd77483a5f vk_rasterizer: Bump vertex buffer size
* Helps with the stuttering, indicating the issue is with the vertex buffer somehow
2022-10-14 21:03:10 +03:00
1bf1217a18 pica_to_vk: Set cull mode correctly 2022-10-14 21:03:10 +03:00
40db7b90fa renderer_vulkan: Minimize state changes
* Store current renderpass/pipelines and only rebind when they change

* Enable extended dynamic state support and only apply them when they change
2022-10-14 21:03:10 +03:00
8e1a23d971 rasterizer_cache: Explicitely pass end_offset to swizzle functions
* This addresses overflow issues
2022-10-14 21:03:10 +03:00
9e8c403793 renderer_vulkan: Implement partial color/depth clears 2022-10-14 21:03:10 +03:00
0e047a7a6e renderer_vulkan: Add second screen and remove renderpass breakage 2022-10-14 21:03:10 +03:00
66158841cb renderer_vulkan: Improve task scheduler synchronization
* Use multiple semaphores for swapchain sync and improve the Submit API
2022-10-14 21:03:10 +03:00
634e6427a8 renderer_vulkan: Use timeline semaphores if available 2022-10-14 21:03:10 +03:00
c1f46ed710 renderer_vulkan: Pipeline cache fixes 2022-10-14 21:03:10 +03:00
4776e21dd9 renderer_vulkan: Isolate surface creation to vk_platform.cpp
* Also cleanup the init code somewhat
2022-10-14 21:03:10 +03:00
9e7b3bfa16 renderer_vulkan: Add ABGR -> RGBA byteswap
* Vulkan doesn't support VK_FORMAT_R8G8B8A8_UNORM_PACK32 unfortunately. Fixes graphical issues on the gpusprites demo
2022-10-14 21:03:10 +03:00
62d561c004 externals: Trim down glslang build
* When the install option is turned on, glslang will override the install dir which causes SDL2 to fail
2022-10-14 21:03:10 +03:00
34a0571dc3 common: math_util: Include <compare> 2022-10-14 21:03:10 +03:00
e46970a84a cmake: Lower cmake requirement to 3.14 2022-10-14 21:03:10 +03:00
ccb1872604 renderer_vulkan: Address more validation errors and stop memory leakage
* The transition settings are temporary until I write a proper layout tracking system
2022-10-14 21:03:10 +03:00
1cd0b04399 renderer_vulkan: Fix some validation errors
* Temporarily add glm until I figure out how to fix the alignment
2022-10-14 21:03:10 +03:00
ab3a228e5e renderer_vulkan: Implement renderer and rasterizer classes
* Also WIP. Vulkan crashes when allocating command buffers, need to investigate...
2022-10-14 21:03:10 +03:00
7ae0d0ef27 renderer_vulkan: Add experimental Vulkan renderer
* Stil extremelly WIP and missing the rasterizer/renderer classes
2022-10-14 21:03:10 +03:00
19c82a76a3 externals: Add vulkan headers and vma 2022-10-14 21:03:10 +03:00
366cdc854f rasterizer_cache: Refactor texture cube interface
* Reuse our Surface class instead of having a separate one, to avoid reimplementing stuff in the backend
2022-10-14 21:03:10 +03:00
d2fd8030dd gl_texture_runtime: Clean up texture upload/download code
* Improve readability and code clarity
2022-10-14 21:03:10 +03:00
a932a9f662 rasterizer_cache: Use Common::Rectangle everywhere
* Make a nice alias for it and use it instead of having Rect2D/Region2D. Makes the new design less intrusive to the current cache
2022-10-14 21:03:10 +03:00
ca81c5a5f3 rasterizer_cache: Make into template
* This is the final step, now RasterizerCache is compltely decoupled from OpenGL (technically not yet, but that's talking details). For now texture filtering and some GLES paths have been disabled and will be reimplemented in the following commits
2022-10-14 21:03:10 +03:00
5d62b033df rasterizer_cache: Use PBO staging buffer cache for texture uploads/downloads 2022-10-14 21:03:10 +03:00
36d584cf3c rasterizer_cache: Reorder methods 2022-10-14 21:03:10 +03:00
7eb590153b rasterizer_cache: Remove remnants of cached_pages 2022-10-14 21:03:10 +03:00
e99ef32c6b rasterizer_cache: Fix texture cube blitting
* The target was GL_TEXTURE_2D instead of GL_TEXTURE_CUBE_MAP_*
2022-10-14 21:03:10 +03:00
066bdcfc40 morton_swizzle: Implement texture formats in UNSWIZZLE_TABLE
* I can now remove that loop that has been messing with my OCD
2022-10-14 21:03:10 +03:00
dd1c06a55b morton_swizzle: Use tiled_buffer instead of reading data from g_memory
* It's much safer and removes hardcoded global state usage
2022-10-14 21:03:10 +03:00
fa7edc4a9c rasterizer_accelerated: Zero intialize cached_pages
* Resolves random crashes because count takes random values
2022-10-14 21:03:10 +03:00
994b27ab5b texture_runtime: Add staging buffer lock mechanism 2022-10-14 21:03:10 +03:00
77a99506cb cached_surface: Remove custom texture logic
* Makes things more complicated and is in the way. It's probably already
broken by recent changes, so I'll need to reimplement it anyway
2022-10-14 21:03:10 +03:00