summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/decode/memory.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-07-23shader: Remove old shader managementReinUsesLisp1-493/+0
2021-02-15Implement texture offset support for TexelFetch and TextureGather and add offsets for TldsKelebek11-0/+1
Formatting
2020-12-07video_core: Remove unnecessary enum class casting in logging messagesLioncash1-13/+12
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-08-14shader/memory: Amend UNIMPLEMENTED_IF_MSG without a messageLioncash1-1/+2
We need to provide a message for this variant of the macro, so we can simply log out the type being used.
2020-08-13General: Tidy up clang-format warnings part 2Lioncash1-3/+3
2020-05-22shader/memory: Implement non-addition operations in REDReinUsesLisp1-2/+1
Trivially implement these instructions. They are used in Astral Chain.
2020-04-17decode/memory: Resolve unused variable warningLioncash1-1/+1
Only the first element of the returned pair is ever used.
2020-04-06shader/memory: Implement RED.E.ADDReinUsesLisp1-1/+15
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-04-06shader/memory: Add "using std::move"ReinUsesLisp1-11/+13
2020-04-06shader/memory: Minor fixes in ATOMReinUsesLisp1-32/+30
2020-04-02shader/memory: Silence no return value warningReinUsesLisp1-0/+3
Silences a warning about control paths not all returning a value.
2020-03-31clang-formatNguyen Dac Nam1-2/+1
2020-03-31shader_decode: fix by suggestionNguyen Dac Nam1-27/+22
2020-03-30clang-formatnamkazy1-3/+3
2020-03-30shader_decode: ATOM/ATOMS: add function to avoid code repetitionnamkazy1-70/+39
2020-03-30shader_decode: implement ATOM operation for S32 and U32Nguyen Dac Nam1-6/+39
2020-03-30clang-formatnamkazy1-3/+3
2020-03-30shader_decode: implement ATOMS instr partial.Nguyen Dac Nam1-10/+42
2020-01-26shader/memory: Implement ATOM.ADDReinUsesLisp1-1/+21
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-25shader/memory: Implement STL.S16 and STS.S16ReinUsesLisp1-3/+10
2020-01-25shader/memory: Implement unaligned LDL.S16 and LDS.S16ReinUsesLisp1-5/+3
2020-01-25shader/memory: Move unaligned load/store to functionsReinUsesLisp1-18/+27
2020-01-25shader/memory: Implement LDL.S16 and LDS.S16ReinUsesLisp1-12/+23
2020-01-16shader/memory: Implement ATOMS.ADD.U32ReinUsesLisp1-0/+19
2020-01-09shader_ir/memory: Implement u16 and u8 for STG and LDGReinUsesLisp1-33/+51
Using the same technique we used for u8 on LDG, implement u16. In the case of STG, load memory and insert the value we want to set into it with bitfieldInsert. Then set that value.
2019-12-18shader/memory: Implement LDG.U8 and unaligned U8 loadsReinUsesLisp1-6/+32
LDG can load single bytes instead of full integers or packs of integers. These have the advantage of loading bytes that are not aligned to 4 bytes. To emulate these this commit gets the byte being referenced (by doing "address & 3" and then using that to extract the byte from the loaded integer: result = bitfieldExtract(loaded_integer, (address % 4) * 8, 8)
2019-12-10shader_ir/memory: Implement patch storesReinUsesLisp1-16/+18
2019-10-22shader_ir/memory: Ignore global memory when tracking failsReinUsesLisp1-16/+23
Ignore global memory operations instead of invoking undefined behaviour when constant buffer tracking fails and we are blasting through asserts, ignore the operation. In the case of LDG this means filling the destination registers with zeroes; for STG this means ignore the instruction as a whole. The default behaviour is still to abort execution on failure.
2019-09-05shader_ir: Implement LD_SReinUsesLisp1-10/+13
Loads from shared memory.
2019-09-05shader_ir: Implement ST_SReinUsesLisp1-9/+16
This instruction writes to a memory buffer shared with threads within the same work group. It is known as "shared" memory in GLSL.
2019-07-17shader_ir: Rename Get/SetTemporal to Get/SetTemporaryLioncash1-11/+11
This is more accurate in terms of describing what the functions are actually doing. Temporal relates to time, not the setting of a temporary itself.
2019-07-15shader: Allow tracking of indirect buffers without variable offsetReinUsesLisp1-12/+7
While changing this code, simplify tracking code to allow returning the base address node, this way callers don't have to manually rebuild it on each invocation.
2019-06-06shader: Use shared_ptr to store nodes and move initialization to fileReinUsesLisp1-4/+5
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-22shader/decode/memory: Remove left in debug pragmaLioncash1-2/+0
2019-05-21shader/memory: Implement ST (generic memory)ReinUsesLisp1-21/+35
2019-05-21shader/memory: Implement LD (generic memory)ReinUsesLisp1-7/+21
2019-05-03shader_ir/memory: Assert on non-32 bits ALD.PHYSReinUsesLisp1-0/+3
2019-05-03shader: Add physical attributes commentariesReinUsesLisp1-1/+1
2019-05-03shader_ir/memory: Implement physical input attributesReinUsesLisp1-3/+6
2019-05-03shader: Remove unused AbufNode Ipa modeReinUsesLisp1-5/+2
2019-05-03shader_ir/memory: Emit AL2P IRReinUsesLisp1-0/+17
2019-04-14shader_ir: Implement STG, keep track of global memory usage and flushReinUsesLisp1-35/+74
2019-04-03shader_ir/memory: Reduce severity of LD_L cache management and log itReinUsesLisp1-2/+2
2019-04-03shader_ir/memory: Reduce severity of ST_L cache management and log itReinUsesLisp1-2/+3
2019-02-26shader/decode: Split memory and texture instructions decodingReinUsesLisp1-493/+0
2019-02-14shader_decompiler: Improve Accuracy of Attribute Interpolation.Fernando Sahmkow1-1/+1
2019-02-12gl_shader_decompiler: Re-implement TLDS lodReinUsesLisp1-1/+1
2019-02-07shader_ir: Remove F4 prefix to texture operationsReinUsesLisp1-8/+7
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-07shader_ir: Clean texture management codeReinUsesLisp1-96/+58
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-03Fix TXQ not using the component mask.Fernando Sahmkow1-6/+9
2019-02-03shader_ir/memory: Add ST_L 64 and 128 bits storesReinUsesLisp1-3/+11
2019-02-03shader_ir: Rename BasicBlock to NodeBlockReinUsesLisp1-5/+4
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 blocksReinUsesLisp1-2/+3
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-02-03shader_ir/memory: Add LD_L 128 bits loadsReinUsesLisp1-7/+19
2019-02-03shader_bytecode: Rename BytesN enums to BitsNReinUsesLisp1-4/+4
2019-02-03shader_ir/memory: Add LD_L 64 bits loadsReinUsesLisp1-6/+17
2019-01-30shader_ir: Unify constant buffer offset valuesReinUsesLisp1-3/+3
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-30shader_decode: Implement LDG and basic cbuf trackingReinUsesLisp1-0/+49
2019-01-15shader_ir: Pass to decoder functions basic block's codeReinUsesLisp1-1/+1
2019-01-15shader_ir: Remove composite primitives and use temporals insteadReinUsesLisp1-145/+149
2019-01-15shader_decode: Use proper primitive namesReinUsesLisp1-2/+2
2019-01-15shader_ir: Remove RZ and use Register::ZeroIndex insteadReinUsesLisp1-6/+11
2019-01-15shader_decode: Implement TEXS.F16ReinUsesLisp1-13/+25
2019-01-15shader_decode: Implement TLDS (untested)ReinUsesLisp1-8/+61
2019-01-15shader_decode: Update TLD4 reflecting #1862 changesReinUsesLisp1-52/+49
2019-01-15shader_ir: Fixup TEX and TEXS and partially fix TLD4 decompilingReinUsesLisp1-50/+49
2019-01-15shader_decode: Implement ST_LReinUsesLisp1-0/+17
2019-01-15shader_decode: Implement LD_LReinUsesLisp1-0/+18
2019-01-15shader_decode: Implement LD_CReinUsesLisp1-0/+31
2019-01-15shader_decode: Implement TMMLReinUsesLisp1-3/+45
2019-01-15shader_decode: Implement TEX and TXQReinUsesLisp1-0/+219
2019-01-15shader_decode: Implement TEXS (F32)ReinUsesLisp1-0/+199
2019-01-15shader_decode: Implement ST_AReinUsesLisp1-0/+30
2019-01-15shader_decode: Implement LD_AReinUsesLisp1-1/+39
2019-01-15shader_ir: Initial implementationReinUsesLisp1-0/+24