aboutsummaryrefslogtreecommitdiff
path: root/src/video_core
AgeCommit message (Collapse)Author
2021-02-13 streamline cdma_pusher/command_classesameerj
2021-02-13 streamline cdma_pusher/command_classesameerj
2021-02-13nvdec cleanupameerj
2021-02-13Merge pull request #5919 from ReinUsesLisp/stream-buffer-tragicMorph
gl_stream_buffer/vk_staging_buffer_pool: Fix size check
2021-02-13vk_master_semaphore: Mark gpu_tick atomic operations with relaxed orderReinUsesLisp
2021-02-13vk_staging_buffer_pool: Inline tick testsReinUsesLisp
Load the current tick to a local variable, moving it out of an atomic and allowing us to compare the value without going through a pointer each time. This should make the loop more optimizable.
2021-02-13gl_stream_buffer/vk_staging_buffer_pool: Fix size checkReinUsesLisp
Fix a tragic off-by-one condition that causes Vulkan's stream buffer to think it's always full, using fallback memory. The OpenGL was also affected by this bug to a lesser extent.
2021-02-13Merge pull request #5916 from ameerj/maxwell-gl-unusedLC
maxwell_to_gl: Remove unused code
2021-02-13vulkan_device: Require VK_EXT_robustness2ReinUsesLisp
We are already using robustness2 features without requiring it explicitly, causing potential crashes on drivers without the extension. Requiring this at boot allows better diagnostics for it and formalizes our usage on the extension.
2021-02-13video_core: Fix clang build issuesReinUsesLisp
2021-02-13vk_staging_buffer_pool: Fix softlock when stream buffer overflowsReinUsesLisp
There was still a code path that could wait on a timeline semaphore tick that would never be signalled. While we are at it, make use of more STL algorithms.
2021-02-13vk_buffer_cache: Add support for null index buffersReinUsesLisp
Games can bind a null index buffer (size=0) where all indices are evaluated as zero. VK_EXT_robustness2 doesn't support this and all drivers segfault when a null index buffer is passed to vkCmdBindIndexBuffer. Workaround this by creating a 4 byte buffer and filling it with zeroes. If it's read out of bounds, robustness takes care of returning zeroes as indices.
2021-02-13buffer_cache: Add extra bytes to guest SSBOsReinUsesLisp
Bind extra bytes beyond the guest API's bound range. This is due to some games like Astral Chain operating out of bounds. Binding the whole map range would be technically correct, but games have large maps that make this approach unaffordable for now.
2021-02-13Merge branch 'bytes-to-map-end' into new-bufcache-wipReinUsesLisp
2021-02-13vk_staging_buffer_pool: Get a staging buffer instead of waitingReinUsesLisp
Avoids waiting idle while the GPU finishes to do work, and fixes an issue where we'd wait forever if a single command buffer (logic tick) all the data.
2021-02-13renderer_opengl: Remove interopReinUsesLisp
Remove unused interop code from the OpenGL backend.
2021-02-13gl_buffer_cache: Drop interop based parameter buffer workaroundsReinUsesLisp
Sacrify runtime performance to avoid generating kernel exceptions on Windows due to our abusive aliasing of interop buffer objects.
2021-02-13buffer_cache: Heuristically detect stream buffersReinUsesLisp
Detect when a memory region has been joined several times and increase the size of the created buffer on those instances. The buffer is assumed to be a "stream buffer", increasing its size should stop us from constantly recreating it and fragmenting memory.
2021-02-13buffer_cache: Split CreateBuffer in separate functionsReinUsesLisp
Allow adding functionality to each function without making CreateBuffer more complex.
2021-02-13buffer_cache: Skip cache on small uploads on VulkanReinUsesLisp
Ports from OpenGL the optimization to skip small 3D uniform buffer uploads. This will take advantage of the previously introduced stream buffer. Fixes instances where the staging buffer offset was being ignored.
2021-02-13vk_staging_buffer_pool: Add stream buffer for small uploadsReinUsesLisp
This uses a ring buffer similar to OpenGL's stream buffer for small uploads. This stops us from allocating several small buffers, reducing memory fragmentation and cache locality. It uses dedicated allocations when possible.
2021-02-13vulkan_device: Enable robustBufferAccessReinUsesLisp
Fix regression on Pascal on Animal Crossing: New Horizons, fixing a validation error.
2021-02-13video_core: Reimplement the buffer cacheReinUsesLisp
Reimplement the buffer cache using cached bindings and page level granularity for modification tracking. This also drops the usage of shared pointers and virtual functions from the cache. - Bindings are cached, allowing to skip work when the game changes few bits between draws. - OpenGL Assembly shaders no longer copy when a region has been modified from the GPU to emulate constant buffers, instead GL_EXT_memory_object is used to alias sub-buffers within the same allocation. - OpenGL Assembly shaders stream constant buffer data using glProgramBufferParametersIuivNV, from NV_parameter_buffer_object. In theory this should save one hash table resolve inside the driver compared to glBufferSubData. - A new OpenGL stream buffer is implemented based on fences for drivers that are not Nvidia's proprietary, due to their low performance on partial glBufferSubData calls synchronized with 3D rendering (that some games use a lot). - Most optimizations are shared between APIs now, allowing Vulkan to cache more bindings than before, skipping unnecesarry work. This commit adds the necessary infrastructure to use Vulkan object from OpenGL. Overall, it improves performance and fixes some bugs present on the old cache. There are still some edge cases hit by some games that harm performance on some vendors, this are planned to be fixed in later commits.
2021-02-13vulkan_common: Expose interop and headless devicesReinUsesLisp
2021-02-13vulkan_common: Make interop extensions mandatoryReinUsesLisp
2021-02-13vulkan_device: Enable robust buffersReinUsesLisp
2021-02-13vulkan_device: Use designated initializers for featuresReinUsesLisp
2021-02-13vulkan_wrapper: Add memory barrier pipeline barrier helperReinUsesLisp
2021-02-13vulkan_device: Fix formatting of constantsReinUsesLisp
2021-02-13vulkan_wrapper: Add interop functionsReinUsesLisp
2021-02-13vulkan_instance: Initialize Vulkan instance in a separate threadReinUsesLisp
Workaround an issue on Nvidia where creating a Vulkan instance from an active OpenGL thread disables threaded optimization on the driver. This optimization is important to have good performance on Nvidia OpenGL.
2021-02-13vulkan_wrapper: Pull Windows symbolsReinUsesLisp
2021-02-13gpu: Report renderer errors with exceptionsReinUsesLisp
Instead of using a two step initialization to report errors, initialize the GPU renderer and rasterizer on the constructor and report errors through std::runtime_error.
2021-02-13buffer_base: Add support for cached CPU writesReinUsesLisp
Some games usually write memory pages currently used by the GPU, causing rendering issues (e.g. flashing geometry and shadows on Link's Awakening). To workaround this issue, Guest CPU writes are delayed until the command buffer finishes processing, but the pages are updated immediately. The overall behavior is: - CPU writes are cached until they are flushed, they update the page state, but don't change the modification state. Cached writes stop pages from being flushed, in case games have meaningful data in it. - Command processing writes (e.g. push constants) update the page state and are marked to the command processor as dirty. They don't remove the state of cached writes.
2021-02-12maxwell_to_gl: Remove unused codeameerj
Removes unused declarations in maxwell_to_gl.h
2021-02-09Merge pull request #5900 from lioncash/unused-funcbunnei
video_core: Remove unused functions and variables
2021-02-09gl_rasterizer: Remove unused variablesLioncash
Resolves warnings on clang 12
2021-02-09texture_cache/util: Remove unused functionsLioncash
Silences a few warnings on clang 12.
2021-02-08Merge pull request #5880 from lat9nq/ffmpeg-externalAmeer J
cmake: FFmpeg linking rework
2021-02-07Merge pull request #5888 from Morph1984/ogl-4.6Rodrigo Locatti
renderer_opengl: Update OpenGL backend version requirement to 4.6
2021-02-08video_core: Delete mortonChloe Marcec
moron.h & morton.cpp are not used anywhere and are just empty files
2021-02-07renderer_opengl: Update OpenGL backend version requirement to 4.6Morph
2021-02-05Address reviewer commentslat9nq
2021-02-05CMake: Port citra-emu/citra FindFFmpeg.cmakelat9nq
Also renames related CMake variables to match both the Find*FFmpeg* and variables defined within the file. Fixes odd errors produced by the old FindFFmpeg. Citra's FindFFmpeg is slightly modified here: adds Citra's copyright at the beginning, renames FFmpeg_INCLUDES to FFmpeg_INCLUDE_DIR, disables a few components in _FFmpeg_ALL_COMPONENTS, and adds the missing avutil component to the comment above.
2021-02-05CMake: Implement YUZU_USE_BUNDLED_FFMPEGlat9nq
For Linux, instructs CMake to use the FFmpeg submodule in externals. This is HEAVILY based on our usage of the late Unicorn. Minimal change to MSVC as it uses the yuzu-emu/ext-windows-bin. MinGW now targets the same ext-windows-bin libraries as MSVC for FFmpeg. Adds FFMPEG_LIBRARIES to WIN32 and simplifies video_core/CMakeLists.txt a bit.
2021-02-01video_core: host_shaders: Don't pass --quiet to glslangValidator if unavailablelat9nq
Prevents CMake from calling `glslangValidator` with `--quiet` when it is not available, i.e. on older downstream versions from Ubuntu.
2021-01-29Merge pull request #5795 from ReinUsesLisp/bytes-to-map-endbunnei
video_core/memory_manager: Add BytesToMapEnd
2021-01-28Merge pull request #5836 from ReinUsesLisp/unaligned-constr-schedLC
vk_scheduler: Fix unaligned placement new expressions
2021-01-27vk_scheduler: Fix unaligned placement new expressionsReinUsesLisp
We were accidentaly creating an object in an unaligned memory address. Fix this by manually aligning the offset.
2021-01-27Merge pull request #5786 from ReinUsesLisp/glsl-cbufbunnei
gl_shader_decompiler: Fix constant buffer size calculation