Commit Graph

9414 Commits

Author SHA1 Message Date
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
5f8a884c2c renderer_opengl: Add driver class to report info/bugs 2022-10-14 21:03:10 +03:00
a7cfe99ca1 rasterizer_cache: Add staging buffer cache for uploads/downloads
*  In addition bump context version to 4.4 to enforce ARB_buffer_storage and use EXT_buffer_storage for GLES which is support on many mobile devices
2022-10-14 21:03:10 +03:00
424ed2df04 rasterizer_cache: Improve TextureRuntime API
* This makes every operation more explicit and mimics more the Vulkan API
2022-10-14 21:03:09 +03:00
e22e641736 frame_dumper: Switch to std::jthread 2022-10-14 21:02:45 +03:00
c080ed35c2 renderer_opengl: Encapsulate sync objects in OGLSync 2022-10-14 21:02:45 +03:00
6dacd66f40 code: Use std::numbers::pi 2022-10-14 21:02:45 +03:00
25a6da50ef code: dodge PAGE_SIZE #define
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in citra we're using PAGE_SIZE as a variable

Specific example
`static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;`

PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added CITRA_ prefix
2022-10-14 21:02:45 +03:00
38a5cc634f core: memory: Refactor block functions and general cleanup
* Also drop usage of std::vector in CopyBlock in favour of a plain std::array. Now all block functions use the common WalkBlockImpl the implementation of which is very similar to yuzu
2022-10-14 21:02:45 +03:00
f26d00fbb4 morton_swizzle: Optimize and use std::span 2022-10-14 21:02:45 +03:00
b03c3b0d7d morton_swizzle: Avoid buffer underflow
* Check the y coordinate before decrementing linear_buffer
2022-10-14 21:02:45 +03:00
1f450d6d1d morton_swizzle: Move out of bounds texture check out of the decode loop
* Running relative expensive checks like this on a hot path causes small but measurable performance loss. Tested SMD wit this and it doesn't crash
2022-10-14 21:02:45 +03:00
e464507b7a rasterizer_cache: Use SurfaceType instead of Aspect
* It was doing pointless enum conversions when both enums described the same thing
2022-10-14 21:02:45 +03:00
7158952ae7 rasterizer_cache: Separate texture swizzling to utils 2022-10-14 21:02:45 +03:00
841dee8ed8 rasterizer_cache: Remove OpenGL references from morton_swizzle 2022-10-14 21:02:45 +03:00
01e53fe9d2 rasterizer_cache: microprofile: Rename OpenGL to RasterizerCache 2022-10-14 21:02:45 +03:00