aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader/decode/other.cpp
AgeCommit message (Collapse)Author
2021-07-22shader: Remove old shader managementReinUsesLisp
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.
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-05video_core: Resolve more variable shadowing scenarios pt.2Lioncash
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
2020-07-16decode/other: Implement S2R.LaneIdReinUsesLisp
This maps to host's thread id. - Fixes graphical issues on Paper Mario.
2020-06-02Merge pull request #4016 from ReinUsesLisp/invocation-infoLC
shader/other: Fix hardcoded value in S2R INVOCATION_INFO
2020-05-30shader/other: Fix hardcoded value in S2R INVOCATION_INFOReinUsesLisp
Geometry shaders built from Nvidia's compiler check for bits[16:23] to be less than or equal to 0 with VSETP to default to a "safe" value of 0x8000'0000 (safe from hardware's perspective). To avoid hitting this path in the shader, return 0x00ff'0000 from S2R INVOCATION_INFO. This seems to be the maximum number of vertices a geometry shader can emit in a primitive.
2020-05-27shader/other: Implement MEMBAR.CTSReinUsesLisp
This silences an assertion we were hitting and uses workgroup memory barriers when the game requests it.
2020-05-26Merge pull request #3981 from ReinUsesLisp/barbunnei
shader/other: Implement BAR.SYNC 0x0
2020-05-21shader/other: Implement BAR.SYNC 0x0ReinUsesLisp
Trivially implement this particular case of BAR. Unless games use OpenCL or CUDA barriers, we shouldn't hit any other case here.
2020-05-21shader/other: Implement thread comparisons (NV_shader_thread_group)ReinUsesLisp
Hardware S2R special registers match gl_Thread*MaskNV. We can trivially implement these using Nvidia's extension on OpenGL or naively stubbing them with the ARB instructions to match. This might cause issues if the host device warp size doesn't match Nvidia's. That said, this is unlikely on proper shaders. Refer to the attached url for more documentation about these flags. https://www.khronos.org/registry/OpenGL/extensions/NV/NV_shader_thread_group.txt
2020-04-09Merge pull request #3601 from ReinUsesLisp/some-shader-encodingsbunnei
video_core/shader: Add some instruction and S2R encodings
2020-04-04shader/other: Add error message for some S2R registersReinUsesLisp
2020-04-04shader_bytecode: Rename MOV_SYS to S2RReinUsesLisp
2020-04-01shader_decompiler: Remove FragCoord.w hack and change IPA implementationReinUsesLisp
Credits go to gdkchan and Ryujinx. The pull request used for this can be found here: https://github.com/Ryujinx/Ryujinx/pull/1082 yuzu was already using the header for interpolation, but it was missing the FragCoord.w multiplication described in the linked pull request. This commit finally removes the FragCoord.w == 1.0f hack from the shader decompiler. While we are at it, this commit renames some enumerations to match Nvidia's documentation (linked below) and fixes component declaration order in the shader program header (z and w were swapped). https://github.com/NVIDIA/open-gpu-doc/blob/master/Shader-Program-Header/Shader-Program-Header.html
2020-01-29shader/other: Fix skips for SYNC and BRKReinUsesLisp
2020-01-29shader/other: Stub S2R LaneIdReinUsesLisp
2019-12-10shader: Implement MEMBAR.GLReinUsesLisp
Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V.
2019-12-09shader_ir/other: Implement S2R InvocationIdReinUsesLisp
2019-11-19shader/other: Reduce DEPBAR log severityReinUsesLisp
While DEPBAR is stubbed it doesn't change anything from our end. Shading languages handle what this instruction does implicitly. We are not getting anything out fo this log except noise.
2019-10-23video_core/shader: Resolve instances of variable shadowingLioncash
Silences a few -Wshadow warnings.
2019-08-29Merge pull request #2758 from ReinUsesLisp/packed-tidbunnei
shader/decode: Implement S2R Tic
2019-08-04shader_ir: Implement NOPReinUsesLisp
2019-07-22shader/decode: Implement S2R TicReinUsesLisp
2019-07-16shader/decode/other: Correct branch indirect argument within BRA handlingLioncash
This appears to have been a copy/paste error introduced within 8a6fc529a968e007f01464abadd32f9b5eb0a26c
2019-07-09shader_ir: Unify blocks in decompiled shaders.Fernando Sahmkow
2019-07-09shader_ir: Implement BRX & BRA.CCFernando Sahmkow
2019-06-07shader: Split SSY and PBK stackReinUsesLisp
Hardware testing revealed that SSY and PBK push to a different stack, allowing code like this: SSY label1; PBK label2; SYNC; label1: PBK; label2: EXIT;
2019-06-05shader: Use shared_ptr to store nodes and move initialization to fileReinUsesLisp
Instead of having a vector of unique_ptr stored in a vector and returning star pointers to this, use shared_ptr. While changing initialization code, move it to a separate file when possible. This is a first step to allow code analysis and node generation beyond the ShaderIR class.
2019-05-29Merge pull request #2446 from ReinUsesLisp/tidbunnei
shader: Implement S2R Tid{XYZ} and CtaId{XYZ}
2019-05-23shader/decode/*: Eliminate indirect inclusionsLioncash
Amends cases where we were using things that were indirectly being satisfied through other headers. This way, if those headers change and eliminate dependencies on other headers in the future, we don't have cascading compilation errors.
2019-05-20shader: Implement S2R Tid{XYZ} and CtaId{XYZ}ReinUsesLisp
2019-05-02shader_ir/other: Implement IPA.IDXReinUsesLisp
2019-05-02shader: Remove unused AbufNode Ipa modeReinUsesLisp
2019-02-14shader_decompiler: Improve Accuracy of Attribute Interpolation.Fernando Sahmkow
2019-02-03shader_ir: Rename BasicBlock to NodeBlockReinUsesLisp
It's not always used as a basic block. Rename it for consistency.
2019-02-03shader_ir: Pass decoded nodes as a whole instead of per basic blocksReinUsesLisp
Some games call LDG at the top of a basic block, making the tracking heuristic to fail. This commit lets the heuristic the decoded nodes as a whole instead of per basic blocks. This may lead to some false positives but allows it the heuristic to track cases it previously couldn't.
2019-01-15shader_ir: Pass to decoder functions basic block's codeReinUsesLisp
2019-01-15shader_decode: Use proper primitive namesReinUsesLisp
2019-01-15shader_ir: Remove Ipa primitiveReinUsesLisp
2019-01-15video_core: Implement IR based geometry shadersReinUsesLisp
2019-01-15shader_ir: Fixup file inclusions and clang-formatReinUsesLisp
2019-01-15shader_decode: Implement MOV_SYSReinUsesLisp
2019-01-15shader_decode: Implement BRA internal flagReinUsesLisp
2019-01-15shader_decode: Implement PBK and BRKReinUsesLisp
2019-01-15shader_decode: Stub DEPBARReinUsesLisp
2019-01-15shader_decode: Implement SSY and SYNCReinUsesLisp
2019-01-15shader_decode: Partially implement BRAReinUsesLisp
2019-01-15shader_decode: Implement IPAReinUsesLisp
2019-01-15shader_decode: Implement EXITReinUsesLisp