aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader/decode
AgeCommit message (Collapse)Author
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-26Merge pull request #3980 from ReinUsesLisp/red-opbunnei
shader/memory: Implement non-addition operations in RED
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/memory: Implement non-addition operations in REDReinUsesLisp
Trivially implement these instructions. They are used in Astral Chain.
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-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-02Merge pull request #3693 from ReinUsesLisp/clean-samplersbunnei
shader/texture: Support multiple unknown sampler properties
2020-04-28shader/arithmetic_integer: Fix tracking issue in temporaryReinUsesLisp
This temporary is not needed as we mark Rd.CC + IADD.X as unimplemented. It caused issues when tracking global buffers.
2020-04-25shader/arithmetic_integer: Fix edge case and mark IADD.X Rd.CC as unimplementedReinUsesLisp
IADD.X Rd.CC requires some extra logic that is not currently implemented. Abort when this is hit.
2020-04-25shader/arithmetic_integer: Change IAdd to UAdd to avoid signed overflowReinUsesLisp
Signed integer addition overflow might be undefined behavior. It's free to change operations to UAdd and use unsigned integers to avoid potential bugs.
2020-04-25shader/arithmetic_integer: Implement IADD.XReinUsesLisp
IADD.X takes the carry flag and adds it to the result. This is generally used to emulate 64-bit operations with 32-bit registers.
2020-04-25shader/arithmetic_integer: Implement CC for IADDReinUsesLisp
2020-04-25decode/register_set_predicate: Implement CCReinUsesLisp
P2R CC takes the state of condition codes and puts them into a register. We already have this implemented for PR (predicates). This commit implements CC over that.
2020-04-25decode/register_set_predicate: Use move for shared pointersReinUsesLisp
Avoid atomic counters used by shared pointers.
2020-04-25Merge pull request #3734 from ReinUsesLisp/half-float-modsbunnei
decode/arithmetic_half: Fix HADD2 and HMUL2 absolute and negation bits
2020-04-24Merge pull request #3749 from ReinUsesLisp/lea-immbunnei
shader/arithmetic_integer: Fix LEA_IMM encoding
2020-04-23decode/arithmetic_half: Fix HADD2 and HMUL2 absolute and negation bitsReinUsesLisp
The encoding for negation and absolute value was wrong. Extracting is now done manually. Similar instructions having different encodings is the rule, not the exception. To keep sanity and readability I preferred to extract the desired bit manually. This is implemented against nxas: https://github.com/ReinUsesLisp/nxas/blob/8dbc38995711cc12206aa370145a3a02665fd989/table.h#L68 That is itself tested against nvdisasm (Nvidia's official disassembler).
2020-04-23shader/texture: Support multiple unknown sampler propertiesReinUsesLisp
This allows deducing some properties from the texture instruction before asking the runtime. By doing this we can handle type mismatches in some instructions from the renderer instead of the shader decoder. Fixes texelFetch issues with games using 2D texture instructions on a 1D sampler.
2020-04-23shader_ir: Turn classes into data structuresReinUsesLisp
2020-04-20shader/arithmetic_integer: Fix LEA_IMM encodingReinUsesLisp
The operand order in LEA_IMM was flipped compared to nvdisasm. Fix that using nxas as reference: https://github.com/ReinUsesLisp/nxas/blob/8dbc38995711cc12206aa370145a3a02665fd989/table.h#L122
2020-04-16decode/memory: Resolve unused variable warningLioncash
Only the first element of the returned pair is ever used.
2020-04-16decode/texture: Resolve unused variable warnings.Lioncash
Some variables aren't used, so we can remove these. Unfortunately, diagnostics are still reported on structured bindings even when annotated with [[maybe_unused]], so we need to unpack the elements that we want to use manually.
2020-04-16decode/texture: Collapse loop down into std::generateLioncash
Same behavior, less code.
2020-04-16decode/texture: Eliminate trivial missing field initializer warningsLioncash
We can just specify the initializers.
2020-04-16Merge pull request #3673 from lioncash/extrabunnei
CMakeLists: Specify -Wextra on linux builds
2020-04-16decode/shift: Remove unused variable within Shift()Lioncash
Removes a redundant variable that is already satisfied by the IsFull() utility function.
2020-04-15CMakeLists: Specify -Wextra on linux buildsLioncash
Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
2020-04-15Merge pull request #3612 from ReinUsesLisp/redFernando Sahmkow
shader/memory: Implement RED.E.ADD and minor changes to ATOM
2020-04-14shader/arithmetic: Add FCMP_CR variantReinUsesLisp
Adds another variant of FCMP.
2020-04-13Merge pull request #3619 from ReinUsesLisp/i2iMat M
shader/conversion: Implement I2I sign extension, saturation and selection
2020-04-13Merge pull request #3633 from ReinUsesLisp/clean-texdecMat M
shader/texture: Remove type mismatches management from shader decoder
2020-04-12Merge pull request #3578 from ReinUsesLisp/vmnmxFernando Sahmkow
shader/video: Partially implement VMNMX
2020-04-12shader/video: Partially implement VMNMXReinUsesLisp
Implements the common usages for VMNMX. Inputs with a different size than 32 bits are not supported and sign mismatches aren't supported either. VMNMX works as follows: It grabs Ra and Rb and applies a maximum/minimum on them (this is defined by .MX), having in mind the input sign. This result can then be saturated. After the intermediate result is calculated, it applies another operation on it using Rc. These operations are merges, accumulations or another min/max pass. This instruction allows to implement with a more flexible approach GCN's min3 and max3 instructions (for instance).
2020-04-10shader/texture: Remove type mismatches management from shader decoderReinUsesLisp
Since commit e22816a5bb we handle type mismatches from the CPU. We don't need to hack our shader decoder due to game bugs anymore. Removed in this commit.
2020-04-09Merge pull request #3601 from ReinUsesLisp/some-shader-encodingsbunnei
video_core/shader: Add some instruction and S2R encodings
2020-04-07Merge pull request #3489 from namkazt/patch-2Rodrigo Locatti
shader: implement SULD.D bits32/64
2020-04-07address nit.Nguyen Dac Nam
2020-04-07shader/conversion: Implement I2I sign extension, saturation and selectionReinUsesLisp
Reimplements I2I adding sign extension, saturation (clamp source value to the destination), selection and destination sizes that are not 32 bits wide. It doesn't implement CC yet.
2020-04-07Apply suggestions from code reviewNguyen Dac Nam
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2020-04-06shader_decode: SULD.D using std::pair instead of out parameternamkazy
2020-04-06shader_decode: SULD.D avoid duplicate code block.namkazy
2020-04-06shader_decode: SULD.D fix conversion error.namkazy
2020-04-06shader_decode: SULD.D implement bits64 and reverse shader ir init method to ↵namkazy
removed shader stage.
2020-04-06shader/memory: Implement RED.E.ADDReinUsesLisp
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"ReinUsesLisp
2020-04-06shader/memory: Minor fixes in ATOMReinUsesLisp
2020-04-05Merge pull request #3592 from ReinUsesLisp/ipaFernando Sahmkow
shader_decompiler: Remove FragCoord.w hack and change IPA implementation
2020-04-05silent warning (conversion error)namkazy
2020-04-05shader_decode: SULD.D -> SINT actually same as UNORM.namkazy