summaryrefslogtreecommitdiff
path: root/src/video_core (follow)
Commit message (Collapse)AuthorAgeFilesLines
* vk_resource_pool: Load GPU tick once and compare with itGravatar ReinUsesLisp2021-02-132-8/+8
| | | | | Other minor style improvements. Rename free_iterator to hint_iterator, to describe better what it does.
* gl_texture_cache: Lazily create non-sRGB texture views for sRGB formatsGravatar ameerj2021-02-133-7/+41
| | | | | | This creates non-sRGB texture views for sRGB texture formats to allow for interfacing with these views in compute shaders using imageLoad and imageStore. Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
* Merge pull request #5919 from ReinUsesLisp/stream-buffer-tragicGravatar Morph2021-02-133-6/+12
|\ | | | | gl_stream_buffer/vk_staging_buffer_pool: Fix size check
| * vk_master_semaphore: Mark gpu_tick atomic operations with relaxed orderGravatar ReinUsesLisp2021-02-131-4/+4
| |
| * vk_staging_buffer_pool: Inline tick testsGravatar ReinUsesLisp2021-02-132-1/+7
| | | | | | | | | | | | 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.
| * gl_stream_buffer/vk_staging_buffer_pool: Fix size checkGravatar ReinUsesLisp2021-02-132-2/+2
| | | | | | | | | | | | 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.
* | Merge pull request #5916 from ameerj/maxwell-gl-unusedGravatar LC2021-02-132-36/+3
|\ \ | | | | | | maxwell_to_gl: Remove unused code
| * | maxwell_to_gl: Remove unused codeGravatar ameerj2021-02-122-36/+3
| | | | | | | | | | | | Removes unused declarations in maxwell_to_gl.h
* | | vulkan_device: Require VK_EXT_robustness2Gravatar ReinUsesLisp2021-02-132-37/+14
| |/ |/| | | | | | | | | | | 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.
* | video_core: Fix clang build issuesGravatar ReinUsesLisp2021-02-132-8/+5
| |
* | vk_staging_buffer_pool: Fix softlock when stream buffer overflowsGravatar ReinUsesLisp2021-02-132-19/+20
| | | | | | | | | | | | | | 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.
* | vk_buffer_cache: Add support for null index buffersGravatar ReinUsesLisp2021-02-132-4/+40
| | | | | | | | | | | | | | | | | | | | | | 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.
* | buffer_cache: Add extra bytes to guest SSBOsGravatar ReinUsesLisp2021-02-131-1/+7
| | | | | | | | | | | | | | 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.
* | Merge branch 'bytes-to-map-end' into new-bufcache-wipGravatar ReinUsesLisp2021-02-131-0/+2
| |
* | vk_staging_buffer_pool: Get a staging buffer instead of waitingGravatar ReinUsesLisp2021-02-132-9/+18
| | | | | | | | | | | | 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.
* | renderer_opengl: Remove interopGravatar ReinUsesLisp2021-02-138-122/+10
| | | | | | | | Remove unused interop code from the OpenGL backend.
* | gl_buffer_cache: Drop interop based parameter buffer workaroundsGravatar ReinUsesLisp2021-02-133-65/+45
| | | | | | | | | | Sacrify runtime performance to avoid generating kernel exceptions on Windows due to our abusive aliasing of interop buffer objects.
* | buffer_cache: Heuristically detect stream buffersGravatar ReinUsesLisp2021-02-132-6/+33
| | | | | | | | | | | | | | 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.
* | buffer_cache: Split CreateBuffer in separate functionsGravatar ReinUsesLisp2021-02-131-29/+52
| | | | | | | | | | Allow adding functionality to each function without making CreateBuffer more complex.
* | buffer_cache: Skip cache on small uploads on VulkanGravatar ReinUsesLisp2021-02-133-9/+18
| | | | | | | | | | | | | | | | 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.
* | vk_staging_buffer_pool: Add stream buffer for small uploadsGravatar ReinUsesLisp2021-02-1315-127/+298
| | | | | | | | | | | | | | | | 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.
* | vulkan_device: Enable robustBufferAccessGravatar ReinUsesLisp2021-02-131-1/+2
| | | | | | | | | | Fix regression on Pascal on Animal Crossing: New Horizons, fixing a validation error.
* | video_core: Reimplement the buffer cacheGravatar ReinUsesLisp2021-02-1367-2607/+2514
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | vulkan_common: Expose interop and headless devicesGravatar ReinUsesLisp2021-02-134-21/+100
| |
* | vulkan_common: Make interop extensions mandatoryGravatar ReinUsesLisp2021-02-131-0/+6
| |
* | vulkan_device: Enable robust buffersGravatar ReinUsesLisp2021-02-131-2/+4
| |
* | vulkan_device: Use designated initializers for featuresGravatar ReinUsesLisp2021-02-131-60/+59
| |
* | vulkan_wrapper: Add memory barrier pipeline barrier helperGravatar ReinUsesLisp2021-02-131-0/+6
| |
* | vulkan_device: Fix formatting of constantsGravatar ReinUsesLisp2021-02-131-10/+6
| |
* | vulkan_wrapper: Add interop functionsGravatar ReinUsesLisp2021-02-132-1/+41
| |
* | vulkan_instance: Initialize Vulkan instance in a separate threadGravatar ReinUsesLisp2021-02-131-1/+5
| | | | | | | | | | | | | | 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.
* | vulkan_wrapper: Pull Windows symbolsGravatar ReinUsesLisp2021-02-131-0/+11
| |
* | gpu: Report renderer errors with exceptionsGravatar ReinUsesLisp2021-02-1324-227/+158
| | | | | | | | | | | | 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.
* | buffer_base: Add support for cached CPU writesGravatar ReinUsesLisp2021-02-131-61/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #5900 from lioncash/unused-funcGravatar bunnei2021-02-092-37/+0
|\ \ | |/ |/| video_core: Remove unused functions and variables
| * gl_rasterizer: Remove unused variablesGravatar Lioncash2021-02-091-3/+0
| | | | | | | | Resolves warnings on clang 12
| * texture_cache/util: Remove unused functionsGravatar Lioncash2021-02-091-34/+0
| | | | | | | | Silences a few warnings on clang 12.
* | Merge pull request #5880 from lat9nq/ffmpeg-externalGravatar Ameer J2021-02-081-6/+5
|\ \ | |/ |/| cmake: FFmpeg linking rework
| * Address reviewer commentsGravatar lat9nq2021-02-051-1/+1
| |
| * CMake: Port citra-emu/citra FindFFmpeg.cmakeGravatar lat9nq2021-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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.
| * CMake: Implement YUZU_USE_BUNDLED_FFMPEGGravatar lat9nq2021-02-052-7/+6
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #5888 from Morph1984/ogl-4.6Gravatar Rodrigo Locatti2021-02-071-1/+1
|\ \ | | | | | | renderer_opengl: Update OpenGL backend version requirement to 4.6
| * | renderer_opengl: Update OpenGL backend version requirement to 4.6Gravatar Morph2021-02-071-1/+1
| |/
* / video_core: Delete mortonGravatar Chloe Marcec2021-02-083-2/+0
|/ | | | moron.h & morton.cpp are not used anywhere and are just empty files
* video_core: host_shaders: Don't pass --quiet to glslangValidator if unavailableGravatar lat9nq2021-02-011-1/+19
| | | | | Prevents CMake from calling `glslangValidator` with `--quiet` when it is not available, i.e. on older downstream versions from Ubuntu.
* Merge pull request #5795 from ReinUsesLisp/bytes-to-map-endGravatar bunnei2021-01-292-2/+27
|\ | | | | video_core/memory_manager: Add BytesToMapEnd
| * video_core/memory_manager: Add BytesToMapEndGravatar ReinUsesLisp2021-01-222-2/+27
| | | | | | | | | | Track map address sizes in a flat ordered map and add a method to query the number of bytes until the end of a map in a given address.
* | Merge pull request #5836 from ReinUsesLisp/unaligned-constr-schedGravatar LC2021-01-281-6/+6
|\ \ | | | | | | vk_scheduler: Fix unaligned placement new expressions
| * | vk_scheduler: Fix unaligned placement new expressionsGravatar ReinUsesLisp2021-01-271-6/+6
| | | | | | | | | | | | | | | We were accidentaly creating an object in an unaligned memory address. Fix this by manually aligning the offset.
* | | Merge pull request #5786 from ReinUsesLisp/glsl-cbufGravatar bunnei2021-01-271-1/+2
|\ \ \ | | | | | | | | gl_shader_decompiler: Fix constant buffer size calculation