Commit message (Collapse) | Author | Files | Lines | ||
---|---|---|---|---|---|
2020-12-30 | video_core: Rewrite the texture cache | ReinUsesLisp | 1 | -17/+16 | |
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-05 | video_core: Resolve more variable shadowing scenarios pt.3 | Lioncash | 1 | -8/+8 | |
Cleans out the rest of the occurrences of variable shadowing and makes any further occurrences of shadowing compiler errors. | |||||
2020-12-03 | node: Mark member functions as [[nodiscard]] where applicable | Lioncash | 1 | -29/+29 | |
Prevents logic bugs from accidentally ignoring the return value. | |||||
2020-12-03 | node: Eliminate variable shadowing | Lioncash | 1 | -47/+49 | |
2020-06-05 | shader/texture: Join separate image and sampler pairs offline | ReinUsesLisp | 1 | -43/+32 | |
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-05-27 | shader/other: Implement MEMBAR.CTS | ReinUsesLisp | 1 | -2/+3 | |
This silences an assertion we were hitting and uses workgroup memory barriers when the game requests it. | |||||
2020-05-22 | shader/other: Implement BAR.SYNC 0x0 | ReinUsesLisp | 1 | -0/+1 | |
Trivially implement this particular case of BAR. Unless games use OpenCL or CUDA barriers, we shouldn't hit any other case here. | |||||
2020-05-22 | shader/other: Implement thread comparisons (NV_shader_thread_group) | ReinUsesLisp | 1 | -0/+5 | |
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-05-09 | shader_ir: Separate float-point comparisons in ordered and unordered | ReinUsesLisp | 1 | -7/+14 | |
This allows us to use native SPIR-V instructions without having to manually check for NAN. | |||||
2020-04-26 | shader/arithmetic_integer: Implement CC for IADD | ReinUsesLisp | 1 | -0/+2 | |
2020-04-23 | shader_ir: Turn classes into data structures | ReinUsesLisp | 1 | -104/+25 | |
2020-04-06 | shader/memory: Implement RED.E.ADD | ReinUsesLisp | 1 | -0/+14 | |
Implements a reduction operation. It's an atomic operation that doesn't return a value. This commit introduces another primitive because some shading languages might have a primitive for reduction operations. | |||||
2020-03-30 | shader: node - update correct comment | Nguyen Dac Nam | 1 | -15/+15 | |
2020-03-30 | shader_decode: add Atomic op for common usage | Nguyen Dac Nam | 1 | -1/+15 | |
2020-02-24 | shader: Simplify indexed sampler usages | ReinUsesLisp | 1 | -1/+1 | |
2020-02-02 | shader: Remove curly braces initializers on shared pointers | ReinUsesLisp | 1 | -2/+2 | |
2020-01-26 | shader/memory: Implement ATOM.ADD | ReinUsesLisp | 1 | -1/+1 | |
ATOM operates atomically on global memory. For now only add ATOM.ADD since that's what was found in commercial games. This asserts for ATOM.ADD.S32 (handling the others as unimplemented), although ATOM.ADD.U32 shouldn't be any different. This change forces us to change the default type on SPIR-V storage buffers from float to uint. We could also alias the buffers, but it's simpler for now to just use uint. While we are at it, abstract the code to avoid repetition. | |||||
2020-01-25 | Shader_IR: Address feedback. | Fernando Sahmkow | 1 | -7/+7 | |
2020-01-24 | Shader_IR: Propagate bindless index into the GL compiler. | Fernando Sahmkow | 1 | -1/+1 | |
2020-01-24 | Shader_IR: Implement Injectable Custom Variables to the IR. | Fernando Sahmkow | 1 | -1/+16 | |
2020-01-24 | Shader_IR: deduce size of indexed samplers | Fernando Sahmkow | 1 | -4/+18 | |
2020-01-24 | Shader_IR: Implement initial code for tracking indexed samplers. | Fernando Sahmkow | 1 | -0/+48 | |
2020-01-16 | shader/memory: Implement ATOMS.ADD.U32 | ReinUsesLisp | 1 | -0/+2 | |
2020-01-04 | Shader_IR: Address Feedback | Fernando Sahmkow | 1 | -5/+5 | |
2019-12-30 | Shader_IR: add the ability to amend code in the shader ir. | Fernando Sahmkow | 1 | -3/+25 | |
This commit introduces a mechanism by which shader IR code can be amended and extended. This useful for track algorithms where certain information can derived from before the track such as indexes to array samplers. | |||||
2019-12-16 | shader/texture: Implement TLD4.PTP | ReinUsesLisp | 1 | -0/+1 | |
2019-12-10 | shader: Implement MEMBAR.GL | ReinUsesLisp | 1 | -0/+2 | |
Implement using memoryBarrier in GLSL and OpMemoryBarrier on SPIR-V. | |||||
2019-12-10 | shader_ir/other: Implement S2R InvocationId | ReinUsesLisp | 1 | -0/+1 | |
2019-12-10 | shader_ir/memory: Implement patch stores | ReinUsesLisp | 1 | -3/+17 | |
2019-11-23 | shader/texture: Deduce texture buffers from locker | ReinUsesLisp | 1 | -4/+10 | |
Instead of specializing shaders to separate texture buffers from 1D textures, use the locker to deduce them while they are being decoded. | |||||
2019-11-14 | Shader_IR: Implement TXD instruction. | Fernando Sahmkow | 1 | -0/+2 | |
2019-11-14 | Shader_IR: Implement FLO instruction. | Fernando Sahmkow | 1 | -0/+2 | |
2019-11-08 | shader_ir/warp: Implement FSWZADD | ReinUsesLisp | 1 | -0/+1 | |
2019-11-08 | gl_shader_decompiler: Reimplement shuffles with platform agnostic intrinsics | ReinUsesLisp | 1 | -9/+2 | |
2019-10-30 | shader/node: Unpack bindless texture encoding | ReinUsesLisp | 1 | -61/+40 | |
Bindless textures were using u64 to pack the buffer and offset from where they come from. Drop this in favor of separated entries in the struct. Remove the usage of std::set in favor of std::list (it's not std::vector to avoid reference invalidations) for samplers and images. | |||||
2019-10-16 | shader/node: std::move Meta instance within OperationNode constructor | Lioncash | 1 | -1/+1 | |
Allows usages of the constructor to avoid an unnecessary copy. | |||||
2019-09-21 | gl_shader_decompiler: Use uint for images and fix SUATOM | ReinUsesLisp | 1 | -26/+20 | |
In the process remove implementation of SUATOM.MIN and SUATOM.MAX as these require a distinction between U32 and S32. These have to be implemented with imageCompSwap loop. | |||||
2019-09-21 | shader/image: Implement SULD and remove irrelevant code | ReinUsesLisp | 1 | -1/+3 | |
* Implement SULD as float. * Remove conditional declaration of GL_ARB_shader_viewport_layer_array. | |||||
2019-09-17 | shader_ir/warp: Implement SHFL | ReinUsesLisp | 1 | -0/+10 | |
2019-09-11 | shader/image: Implement SUATOM and fix SUST | ReinUsesLisp | 1 | -14/+43 | |
2019-09-06 | gl_shader_decompiler: Keep track of written images and mark them as modified | ReinUsesLisp | 1 | -17/+31 | |
2019-09-06 | kepler_compute: Implement texture queries | ReinUsesLisp | 1 | -0/+4 | |
2019-09-05 | shader_ir: Implement ST_S | ReinUsesLisp | 1 | -1/+15 | |
This instruction writes to a memory buffer shared with threads within the same work group. It is known as "shared" memory in GLSL. | |||||
2019-08-21 | shader_ir: Implement VOTE | ReinUsesLisp | 1 | -0/+5 | |
Implement VOTE using Nvidia's intrinsics. Documentation about these can be found here https://developer.nvidia.com/reading-between-threads-shader-intrinsics Instead of using portable ARB instructions I opted to use Nvidia intrinsics because these are the closest we have to how Tegra X1 hardware renders. To stub VOTE on non-Nvidia drivers (including nouveau) this commit simulates a GPU with a warp size of one, returning what is meaningful for the instruction being emulated: * anyThreadNV(value) -> value * allThreadsNV(value) -> value * allThreadsEqualNV(value) -> true ballotARB, also known as "uint64_t(activeThreadsNV())", emits VOTE.ANY Rd, PT, PT; on nouveau's compiler. This doesn't match exactly to Nvidia's code VOTE.ALL Rd, PT, PT; Which is emulated with activeThreadsNV() by this commit. In theory this shouldn't really matter since .ANY, .ALL and .EQ affect the predicates (set to PT on those cases) and not the registers. | |||||
2019-07-20 | Shader_Ir: Implement F16 Variants of F2F, F2I, I2F. | Fernando Sahmkow | 1 | -11/+14 | |
This commit takes care of implementing the F16 Variants of the conversion instructions and makes sure conversions are done. | |||||
2019-07-20 | shader/half_set_predicate: Fix HSETP2 implementation | ReinUsesLisp | 1 | -2/+1 | |
2019-07-09 | shader_ir: Unify blocks in decompiled shaders. | Fernando Sahmkow | 1 | -6/+6 | |
2019-07-09 | shader_ir: Implement BRX & BRA.CC | Fernando Sahmkow | 1 | -0/+1 | |
2019-06-21 | texture_cache: Style and Corrections | Fernando Sahmkow | 1 | -1/+2 | |
2019-06-21 | shader: Implement bindless images | ReinUsesLisp | 1 | -0/+9 | |
2019-06-21 | shader: Decode SUST and implement backing image functionality | ReinUsesLisp | 1 | -1/+41 | |
2019-06-07 | shader: Split SSY and PBK stack | ReinUsesLisp | 1 | -1/+6 | |
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-07 | shader/node: Minor changes | ReinUsesLisp | 1 | -50/+54 | |
Reflect std::shared_ptr nature of Node on initializers and remove constant members in nodes. Add some commentaries. | |||||
2019-06-07 | shader: Move Node declarations out of the shader IR header | ReinUsesLisp | 1 | -322/+4 | |
Analysis passes do not have a good reason to depend on shader_ir.h to work on top of nodes. This splits node-related declarations to their own file and leaves the IR in shader_ir.h | |||||
2019-06-06 | shader: Use shared_ptr to store nodes and move initialization to file | ReinUsesLisp | 1 | -83/+25 | |
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-23 | shader/shader_ir: Make Comment() take a std::string by value | Lioncash | 1 | -1/+1 | |
This allows for forming comment nodes without making unnecessary copies of the std::string instance. e.g. previously: Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", cbuf->GetIndex(), cbuf_offset)); Would result in a copy of the string being created, as CommentNode() takes a std::string by value (a const ref passed to a value parameter results in a copy). Now, only one instance of the string is ever moved around. (fmt::format returns a std::string, and since it's returned from a function by value, this is a prvalue (which can be treated like an rvalue), so it's moved into Comment's string parameter), we then move it into the CommentNode constructor, which then moves the string into its member variable). | |||||
2019-05-21 | shader/memory: Implement LD (generic memory) | ReinUsesLisp | 1 | -4/+2 | |
2019-05-20 | shader: Implement S2R Tid{XYZ} and CtaId{XYZ} | ReinUsesLisp | 1 | -1/+7 | |
2019-05-19 | shader/shader_ir: Remove unnecessary inline specifiers | Lioncash | 1 | -2/+2 | |
constexpr internally links by default, so the inline specifier is unnecessary. | |||||
2019-05-19 | shader/shader_ir: Simplify constructors for OperationNode | Lioncash | 1 | -15/+6 | |
Many of these constructors don't even need to be templated. The only ones that need to be templated are the ones that actually make use of the parameter pack. Even then, since std::vector accepts an initializer list, we can supply the parameter pack directly to it instead of creating our own copy of the list, then copying it again into the std::vector. | |||||
2019-05-19 | shader/shader_ir: Remove unnecessary template parameter packs from Operation() overloads where applicable | Lioncash | 1 | -2/+0 | |
These overloads don't actually make use of the parameter pack, so they can be turned into regular non-template function overloads. | |||||
2019-05-19 | shader/shader_ir: Mark tracking functions as const member functions | Lioncash | 1 | -3/+4 | |
These don't actually modify instance state, so they can be marked as const member functions | |||||
2019-05-19 | shader/shader_ir: Place implementations of constructor and destructor in cpp file | Lioncash | 1 | -5/+2 | |
Given the class contains quite a lot of non-trivial types, place the constructor and destructor within the cpp file to avoid inlining construction and destruction code everywhere the class is used. | |||||
2019-05-03 | shader: Add physical attributes commentaries | ReinUsesLisp | 1 | -2/+4 | |
2019-05-03 | gl_shader_decompiler: Implement GLSL physical attributes | ReinUsesLisp | 1 | -1/+1 | |
2019-05-03 | shader_ir/memory: Implement physical input attributes | ReinUsesLisp | 1 | -3/+17 | |
2019-05-03 | shader: Remove unused AbufNode Ipa mode | ReinUsesLisp | 1 | -16/+4 | |
2019-05-03 | shader_ir/memory: Emit AL2P IR | ReinUsesLisp | 1 | -0/+5 | |
2019-04-26 | shader_ir: Move Sampler index entry in operand< to sort declarations | ReinUsesLisp | 1 | -2/+2 | |
2019-04-26 | shader_ir: Add missing entry to Sampler operand< comparison | ReinUsesLisp | 1 | -2/+3 | |
2019-04-16 | shader_ir/decode: Fix half float pre-operations and remove MetaHalfArithmetic | ReinUsesLisp | 1 | -16/+10 | |
Operations done before the main half float operation (like HAdd) were managing a packed value instead of the unpacked one. Adding an unpacked operation allows us to drop the per-operand MetaHalfArithmetic entry, simplifying the code overall. | |||||
2019-04-16 | shader_ir/decode: Implement half float saturation | ReinUsesLisp | 1 | -0/+3 | |
2019-04-16 | renderer_opengl: Implement half float NaN comparisons | ReinUsesLisp | 1 | -6/+12 | |
2019-04-14 | shader_ir: Implement STG, keep track of global memory usage and flush | ReinUsesLisp | 1 | -3/+13 | |
2019-04-08 | Move ConstBufferAccessor to Maxwell3d, correct mistakes and clang format. | Fernando Sahmkow | 1 | -2/+2 | |
2019-04-08 | Refactor GetTextureCode and GetTexCode to use an optional instead of optional parameters | Fernando Sahmkow | 1 | -11/+9 | |
2019-04-08 | Implement Bindless Handling on SetupTexture | Fernando Sahmkow | 1 | -4/+3 | |
2019-04-08 | Unify both sampler types. | Fernando Sahmkow | 1 | -8/+28 | |
2019-04-08 | Implement Bindless Samplers and TEX_B in the IR. | Fernando Sahmkow | 1 | -9/+22 | |
2019-03-30 | shader_ir/decode: Implement AOFFI for TEX and TLD4 | ReinUsesLisp | 1 | -3/+6 | |
2019-03-30 | shader_ir: Implement immediate register tracking | ReinUsesLisp | 1 | -0/+3 | |
2019-02-26 | shader/decode: Remove extras from MetaTexture | ReinUsesLisp | 1 | -1/+3 | |
2019-02-26 | shader/decode: Split memory and texture instructions decoding | ReinUsesLisp | 1 | -0/+1 | |
2019-02-07 | shader_ir: Remove F4 prefix to texture operations | ReinUsesLisp | 1 | -6/+6 | |
This was originally included because texture operations returned a vec4. These operations now return a single float and the F4 prefix doesn't mean anything. | |||||
2019-02-07 | shader_ir: Clean texture management code | ReinUsesLisp | 1 | -5/+5 | |
Previous code relied on GLSL parameter order (something that's always ill-formed on an IR design). This approach passes spatial coordiantes through operation nodes and array and depth compare values in the the texture metadata. It still contains an "extra" vector containing generic nodes for bias and component index (for example) which is still a bit ill-formed but it should be better than the previous approach. | |||||
2019-02-07 | gl_shader_disk_cache: Save GLSL and entries into the precompiled file | ReinUsesLisp | 1 | -0/+9 | |
2019-02-03 | shader_ir: Rename BasicBlock to NodeBlock | ReinUsesLisp | 1 | -46/+46 | |
It's not always used as a basic block. Rename it for consistency. | |||||
2019-02-03 | shader_ir: Pass decoded nodes as a whole instead of per basic blocks | ReinUsesLisp | 1 | -25/+26 | |
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-30 | shader_ir: Unify constant buffer offset values | ReinUsesLisp | 1 | -1/+1 | |
Constant buffer values on the shader IR were using different offsets if the access direct or indirect. cbuf34 has a non-multiplied offset while cbuf36 does. On shader decoding this commit multiplies it by four on cbuf34 queries. | |||||
2019-01-30 | shader_decode: Implement LDG and basic cbuf tracking | ReinUsesLisp | 1 | -4/+34 | |
2019-01-28 | shader/shader_ir: Amend three comment typos | Lioncash | 1 | -3/+3 | |
Given we're in the area, these are three trivial typos that can be corrected. | |||||
2019-01-28 | shader/shader_ir: Amend constructor initializer ordering for AbufNode | Lioncash | 1 | -2/+2 | |
Orders the class members in the same order that they would actually be initialized in. Gets rid of two compiler warnings. | |||||
2019-01-15 | shader_ir: Pass to decoder functions basic block's code | ReinUsesLisp | 1 | -25/+25 | |
2019-01-15 | shader_decode: Improve zero flag implementation | ReinUsesLisp | 1 | -2/+7 | |
2019-01-15 | shader_ir: Remove composite primitives and use temporals instead | ReinUsesLisp | 1 | -30/+30 | |
2019-01-15 | shader_decode: Use proper primitive names | ReinUsesLisp | 1 | -7/+5 | |
2019-01-15 | shader_decode: Use BitfieldExtract instead of shift + and | ReinUsesLisp | 1 | -2/+7 | |
2019-01-15 | shader_ir: Remove Ipa primitive | ReinUsesLisp | 1 | -2/+0 | |
2019-01-15 | shader_ir: Remove RZ and use Register::ZeroIndex instead | ReinUsesLisp | 1 | -2/+0 | |
2019-01-15 | shader_decode: Implement TEXS.F16 | ReinUsesLisp | 1 | -2/+6 | |
2019-01-15 | video_core: Implement IR based geometry shaders | ReinUsesLisp | 1 | -0/+3 | |
2019-01-15 | shader_decode: Implement VMAD and VSETP | ReinUsesLisp | 1 | -0/+4 | |
2019-01-15 | shader_decode: Implement HSET2 | ReinUsesLisp | 1 | -0/+1 | |
2019-01-15 | shader_decode: Rework HSETP2 | ReinUsesLisp | 1 | -7/+8 | |
2019-01-15 | shader_decode: Implement HFMA2 | ReinUsesLisp | 1 | -0/+1 | |
2019-01-15 | shader_decode: Implement POPC | ReinUsesLisp | 1 | -1/+3 | |
2019-01-15 | shader_decode: Implement TLDS (untested) | ReinUsesLisp | 1 | -0/+4 | |
2019-01-15 | shader_decode: Update TLD4 reflecting #1862 changes | ReinUsesLisp | 1 | -0/+3 | |
2019-01-15 | shader_ir: Fixup TEX and TEXS and partially fix TLD4 decompiling | ReinUsesLisp | 1 | -1/+3 | |
2019-01-15 | video_core: Address feedback | ReinUsesLisp | 1 | -11/+10 | |
2019-01-15 | shader_ir: Fixup file inclusions and clang-format | ReinUsesLisp | 1 | -1/+0 | |
2019-01-15 | shader_ir: Move comment node string | Mat M | 1 | -2/+2 | |
Co-Authored-By: ReinUsesLisp <reinuseslisp@airmail.cc> | |||||
2019-01-15 | shader_ir: Address feedback to avoid UB in bit casting | ReinUsesLisp | 1 | -2/+4 | |
2019-01-15 | shader_decode: Implement LOP3 | ReinUsesLisp | 1 | -0/+2 | |
2019-01-15 | shader_decode: Implement LOP32I | ReinUsesLisp | 1 | -0/+5 | |
2019-01-15 | shader_decode: Implement TEX and TXQ | ReinUsesLisp | 1 | -0/+4 | |
2019-01-15 | shader_decode: Implement TEXS (F32) | ReinUsesLisp | 1 | -0/+18 | |
2019-01-15 | shader_ir: Add condition code helper | ReinUsesLisp | 1 | -0/+3 | |
2019-01-15 | shader_ir: Add predicate combiner helper | ReinUsesLisp | 1 | -0/+3 | |
2019-01-15 | shader_ir: Add comparison helpers | ReinUsesLisp | 1 | -0/+9 | |
2019-01-15 | shader_ir: Add half float helpers | ReinUsesLisp | 1 | -0/+7 | |
2019-01-15 | shader_ir: Add integer helpers | ReinUsesLisp | 1 | -0/+5 | |
2019-01-15 | shader_ir: Add float helpers | ReinUsesLisp | 1 | -0/+5 | |
2019-01-15 | shader_ir: Add setters | ReinUsesLisp | 1 | -0/+8 | |
2019-01-15 | shader_ir: Add local memory getters | ReinUsesLisp | 1 | -0/+3 | |
2019-01-15 | shader_ir: Add internal flag getters | ReinUsesLisp | 1 | -0/+2 | |
2019-01-15 | shader_ir: Add attribute getters | ReinUsesLisp | 1 | -0/+5 | |
2019-01-15 | shader_ir: Add constant buffer getters | ReinUsesLisp | 1 | -0/+4 | |
2019-01-15 | shader_ir: Add register getter | ReinUsesLisp | 1 | -0/+2 | |
2019-01-15 | shader_ir: Add immediate node constructors | ReinUsesLisp | 1 | -1/+18 | |
2019-01-15 | shader_ir: Initial implementation | ReinUsesLisp | 1 | -0/+662 | |