aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/engines
AgeCommit message (Collapse)Author
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-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-01-24maxwell_3d: Silence array bounds warningsReinUsesLisp
2021-01-15common/common_funcs: Rename INSERT_UNION_PADDING_{BYTES,WORDS} to _NOINITReinUsesLisp
INSERT_PADDING_BYTES_NOINIT is more descriptive of the underlying behavior.
2020-12-30video_core: Rewrite the texture cacheReinUsesLisp
The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage.The current texture cache has several points that hurt maintainability and performance. It's easy to break unrelated parts of the cache when doing minor changes. The cache can easily forget valuable information about the cached textures by CPU writes or simply by its normal usage. This commit aims to address those issues.
2020-12-15Merge pull request #5157 from lioncash/array-dirtybunnei
maxwell_3d: Remove unused dirty_pointer array
2020-12-07video_core: Remove unnecessary enum class casting in logging messagesLioncash
fmt now automatically prints the numeric value of an enum class member by default, so we don't need to use casts any more. Reduces the line noise a bit.
2020-12-06maxwell_3d: Move member variables to end of classLioncash
Follows our established coding style.
2020-12-06maxwell_3d: Resolve -Wdocumentation warningLioncash
Removes a documentation comment for a non-existent member.
2020-12-06maxwell_3d: Remove unused dirty_pointer arrayLioncash
This is unused and removing it shrinks the structure by 3584 bytes.
2020-12-05maxwell_dma: Rename RenderEnable::Mode::FALSE and TRUE to avoid name conflictcomex
On Apple platforms, FALSE and TRUE are defined as macros by <mach/boolean.h>, which is included by various system headers. Note that there appear to be no actual users of the names to fix up.
2020-12-04video_core: Resolve more variable shadowing scenariosLioncash
Resolves variable shadowing scenarios up to the end of the OpenGL code to make it nicer to review. The rest will be resolved in a following commit.
2020-11-26vk_shader_decompiler: Implement force early fragment testsReinUsesLisp
Force early fragment tests when the 3D method is enabled. The established pipeline cache takes care of recompiling if needed. This is implemented only on Vulkan to avoid invalidating the shader cache on OpenGL.
2020-11-20Merge pull request #4953 from lioncash/shader-shadowbunnei
shader_bytecode: Eliminate variable shadowing
2020-11-20shader_bytecode: Make use of [[nodiscard]] where applicableLioncash
Ensures that all queried values are made use of.
2020-11-20shader_bytecode: Eliminate variable shadowingLioncash
2020-11-11maxwell_3d: Use insert instead of loop push_backReinUsesLisp
This reduces the overhead of bounds checking on each element. It won't reduce the cost of allocation because usually this vector's capacity is usually large enough to hold whatever we push to it.
2020-11-11maxwell_3d: Move code to separate functionsReinUsesLisp
Deduplicate some code and put it in separate functions so it's easier to understand and profile.
2020-10-28shader/arithmetic: Implement FCMP immediate + register variantReinUsesLisp
Trivially add the encoding for this.
2020-10-09video_core: Enforce -Wclass-memaccessReinUsesLisp
2020-10-02video_core: Enforce -Wunused-variable and -Wunused-but-set-variableReinUsesLisp
2020-09-22General: Make use of std::nullopt where applicableLioncash
Allows some implementations to avoid completely zeroing out the internal buffer of the optional, and instead only set the validity byte within the structure. This also makes it consistent how we return empty optionals.
2020-09-18fermi_2d: Make use of designated initializersLioncash
Same behavior, less repetition. We can also ensure all members of Config are initialized.
2020-08-22video_core: Initialize renderer with a GPUReinUsesLisp
Add an extra step in GPU initialization to be able to initialize render backends with a valid GPU instance.
2020-08-16Merge pull request #4519 from lioncash/semibunnei
maxwell_3d: Resolve -Wextra-semi warning
2020-08-14maxwell_3d: Resolve -Wextra-semi warningLioncash
Semicolons after a function definition aren't necessary.
2020-08-10textures/decoders: Fix block linear to pitch copiesReinUsesLisp
There were two issues with block linear copies. First the swizzling was wrong and this commit reimplements them. The other issue was that these copies are generally used to download render targets from the GPU and yuzu was not downloading them from host GPU memory unless the extreme GPU accuracy setting was selected. This commit enables cached memory reads for all accuracy levels. - Fixes level thumbnails in Super Mario Maker 2.
2020-07-10video_core/textures: Add and use SwizzleSliceToVoxel, and minor style changesReinUsesLisp
Change GOB sizes from free-functions to constexpr constants. Add SwizzleSliceToVoxel, a function that swizzles a 2D array of pixels into a 3D texture and use it for 3D copies.
2020-07-07maxwell_dma: Rename registers to match official docs and reorderReinUsesLisp
Rename registers in the MaxwellDMA class to match Nvidia's official documentation. This one can be found here: https://github.com/NVIDIA/open-gpu-doc/blob/master/classes/dma-copy/clb0b5.h While we are at it, reorganize the code in MaxwellDMA to be separated in different functions.
2020-06-26Merge pull request #4147 from ReinUsesLisp/hset2-immbunnei
shader/half_set: Implement HSET2_IMM
2020-06-24Addressed issuesDavid Marcec
2020-06-24Macro HLE supportDavid Marcec
2020-06-22shader/half_set: Implement HSET2_IMMReinUsesLisp
Add HSET2_IMM. Due to the complexity of the encoding avoid using BitField unions and read the relevant bits from the code itself. This is less error prone.
2020-06-13Merge pull request #4049 from ReinUsesLisp/separate-samplersbunnei
shader/texture: Join separate image and sampler pairs offline
2020-06-08texture_cache: Implement rendering to 3D texturesReinUsesLisp
This allows rendering to 3D textures with more than one slice. Applications are allowed to render to more than one slice of a texture using gl_Layer from a VTG shader. This also requires reworking how 3D texture collisions are handled, for now, this commit allows rendering to slices but not to miplevels. When a render target attempts to write to a mipmap, we fallback to the previous implementation (copying or flushing as needed). - Fixes color correction 3D textures on UE4 games (rainbow effects). - Allows Xenoblade games to render to 3D textures directly.
2020-06-05shader/texture: Join separate image and sampler pairs offlineReinUsesLisp
Games using D3D idioms can join images and samplers when a shader executes, instead of baking them into a combined sampler image. This is also possible on Vulkan. One approach to this solution would be to use separate samplers on Vulkan and leave this unimplemented on OpenGL, but we can't do this because there's no consistent way of determining which constant buffer holds a sampler and which one an image. We could in theory find the first bit and if it's in the TIC area, it's an image; but this falls apart when an image or sampler handle use an index of zero. The used approach is to track for a LOP.OR operation (this is done at an IR level, not at an ISA level), track again the constant buffers used as source and store this pair. Then, outside of shader execution, join the sample and image pair with a bitwise or operation. This approach won't work on games that truly use separate samplers in a meaningful way. For example, pooling textures in a 2D array and determining at runtime what sampler to use. This invalidates OpenGL's disk shader cache :) - Used mostly by D3D ports to Switch
2020-06-04Merge pull request #4009 from ogniK5377/macro-jit-prodbunnei
video_core: Implement Macro JIT
2020-06-04Default init labels and use initializer list for macro engineDavid Marcec
2020-06-03Mark parameters as constDavid Marcec
2020-06-02Pass by reference instead of copying parametersDavid Marcec
2020-06-01Merge pull request #3998 from ReinUsesLisp/init-3dbunnei
maxwell_3d: Initialize more registers to their expected value
2020-05-30Implement macro JITDavid Marcec
2020-05-28maxwell_3d: Reduce severity of logs that can be spammedReinUsesLisp
These logs were killing performance on some games when they were spammed. Reduce them to Debug severity.
2020-05-27maxwell_3d: Initialize line widthsReinUsesLisp
Initialize line widths to avoid setting a line width of zero.
2020-05-27maxwell_3d: Initialize polygon modesReinUsesLisp
NVN expects this to be initialized as Fill, otherwise games that never bind a rasterizer state will log an invalid polygon mode.
2020-05-13Merge pull request #3899 from ReinUsesLisp/float-comparisonsbunnei
shader_ir: Add separate instructions for ordered and unordered comparisons and fix NE on GLSL
2020-05-09shader_ir: Separate float-point comparisons in ordered and unorderedReinUsesLisp
This allows us to use native SPIR-V instructions without having to manually check for NAN.
2020-05-08Merge pull request #3885 from ReinUsesLisp/viewport-swizzlesbunnei
video_core: Implement viewport swizzles with NV_viewport_swizzle
2020-05-05Merge pull request #3815 from FernandoS27/command-list-2bunnei
GPU: More optimizations to GPU Command List Processing and DMA Copy Optimizations
2020-05-04vk_graphics_pipeline: Implement viewport swizzles with NV_viewport_swizzleReinUsesLisp