Commit graph

45 commits

Author SHA1 Message Date
Liam
d74d5f8cfd shader_recompiler: ensure derivatives for textureGrad are f32 2023-12-21 19:06:33 -05:00
Ameer J
abd400e04f shader_recompiler: Fix spelling of "derivate" (#12067) 2023-11-18 13:39:47 +01:00
Fernando Sahmkow
01858648d1 Shader Recomnpiler: implement textuzreGrad 3D emulation constant propagation 2023-08-18 22:17:02 -04:00
Fernando Sahmkow
1fdf24a081 Video_core: Address feedback 2023-01-04 14:39:42 -05:00
Fernando Sahmkow
872f2e7de6 ShaderCompiler: Inline driver specific constants. 2023-01-03 16:29:25 -05:00
Fernando Sahmkow
7842543573 MacroHLE: Add HLE replacement for base vertex and base instance. 2023-01-01 16:43:57 -05:00
Morph
2b87305d31 general: Convert source file copyright comments over to SPDX
This formats all copyright comments according to SPDX formatting guidelines.
Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-23 05:55:32 -04:00
ameerj
0df188787a shader_recompiler: Reduce unused includes 2022-03-20 02:25:08 -04:00
ameerj
22a4d26479 shader: Add integer attribute get optimization pass
Works around an nvidia driver bug, where casting the integer attributes to float and back to an integer always returned 0.
2021-12-29 19:03:49 -05:00
Morph
bef5d608a9 Merge pull request #6767 from ReinUsesLisp/fold-float-pack
shader: Fold UnpackFloat2x16 and PackFloat2x16
2021-07-30 02:07:52 -04:00
ReinUsesLisp
ecc05bdcb6 shader: Fold UnpackFloat2x16 and PackFloat2x16
Simplifies the code a bit when possible. These instructions should be
no-ops codegen wise.
2021-07-29 21:22:52 -03:00
ReinUsesLisp
4f19303fe0 shader: Fold integer FMA from Nvidia's pattern
Fold shaders doing "a * b + c" on integers from the pattern generated by
Nvidia's GL compiler.

On a somewhat complex compute shader it reduces the code size by 16
instructions from 2 matches on Turing GPUs.

On Intel as extracted from KHR_pipeline_executable_properties:
Before the optimization:
```
Instruction Count: 2057
Basic Block Count: 45
Scratch Memory Size: 14752
Spill Count: 232
Fill Count: 261
SEND Count: 610
Cycle Count: 11325
```

After the optimization:
```
Instruction Count: 2046
Basic Block Count: 44
Scratch Memory Size: 13728
Spill Count: 219
Fill Count: 268
SEND Count: 604
Cycle Count: 11367
```
2021-07-26 04:58:02 -03:00
ReinUsesLisp
c6e1483e17 shader: Use TryInstRecursive on XMAD multiply folding
Simplify a bit the logic.
2021-07-26 04:15:27 -03:00
ReinUsesLisp
2321666580 shader: Avoid usage of C++20 ranges to build in clang 2021-07-22 21:51:40 -04:00
ReinUsesLisp
f54fa4a1f5 shader: Add constant propagation to integer vectors 2021-07-22 21:51:39 -04:00
ReinUsesLisp
ca3e927e35 shader: Fix FSwizzleAdd folding when going through phi nodes 2021-07-22 21:51:34 -04:00
ReinUsesLisp
03f6d424ce glasm: Rework control flow introducing a syntax list
This commit regresses VertexA shaders, their transformation pass has to
be adapted to the new control flow.
2021-07-22 21:51:31 -04:00
ameerj
90ff800962 shader: Fix BFE s32 undefined check
Our unit tests were hitting this exception.
2021-07-22 21:51:29 -04:00
ReinUsesLisp
1f54f1ff26 shader: Fix error checking in bitfieldExtract and implement bitfieldInsert folding 2021-07-22 21:51:29 -04:00
ReinUsesLisp
6236b611cf shader: Move microinstruction header to the value header 2021-07-22 21:51:28 -04:00
ReinUsesLisp
5c187201ec shader: Add constant propagation for arithmetic right shifts 2021-07-22 21:51:28 -04:00
FernandoS27
2f01c7fb62 shader: Add coarse derivatives 2021-07-22 21:51:28 -04:00
FernandoS27
b1e325f317 shader: Implement fine derivates constant propagation 2021-07-22 21:51:28 -04:00
ReinUsesLisp
deba5c7666 shader: Add constant propagation for *&^| binary operations 2021-07-22 21:51:27 -04:00
lat9nq
a4e7a41e7f shader_recompiler,video_core: Cleanup some GCC and Clang errors
Mostly fixing unused *, implicit conversion, braced scalar init,
fpermissive, and some others.

Some Clang errors likely remain in video_core, and std::ranges is still
a pertinent issue in shader_recompiler

shader_recompiler: cmake: Force bracket depth to 1024 on Clang
Increases the maximum fold expression depth

thread_worker: Include condition_variable

Don't use list initializers in control flow

Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2021-07-22 21:51:26 -04:00
FernandoS27
741b21715a shader: Address Feedback 2021-07-22 21:51:26 -04:00
FernandoS27
82698ecb41 shader: Fold composite extract 2021-07-22 21:51:25 -04:00
FernandoS27
5b74fe36ec shader: Fold comparisons and Pack/Unpack16 2021-07-22 21:51:25 -04:00
ReinUsesLisp
6df3c1a64e shader: Fix constant propagation to use reverse post order 2021-07-22 21:51:25 -04:00
ReinUsesLisp
4cd2c1588b shader: Refactor PTP and other minor changes 2021-07-22 21:51:24 -04:00
FernandoS27
f573d3642e shader: Implement TLD4.PTP 2021-07-22 21:51:24 -04:00
FernandoS27
d4974db16f shader: Implement TLD4 and TLD4_B 2021-07-22 21:51:24 -04:00
ReinUsesLisp
cdbb207953 shader: Fold interpolation multiplications 2021-07-22 21:51:24 -04:00
ameerj
1a8e8498a4 shader: Implement DMNMX, DSET, DSETP 2021-07-22 21:51:24 -04:00
ReinUsesLisp
db2e9d64aa shader: Implement CAL inlining function calls 2021-07-22 21:51:23 -04:00
ReinUsesLisp
83c7592d3d shader: Partial implementation of LDC 2021-07-22 21:51:23 -04:00
ReinUsesLisp
dda21fd317 shader: FMUL, select, RRO, and MUFU fixes 2021-07-22 21:51:22 -04:00
ReinUsesLisp
a2fe90fa60 spirv: Add lower fp16 to fp32 pass 2021-07-22 21:51:22 -04:00
ReinUsesLisp
2bb0069e4e shader: Add XMAD multiplication folding optimization 2021-07-22 21:51:22 -04:00
ReinUsesLisp
605783f828 spirv: Initial bindings support 2021-07-22 21:51:22 -04:00
ReinUsesLisp
76a3a2510f shader: Misc fixes 2021-07-22 21:51:22 -04:00
ReinUsesLisp
c4d75e4b78 shader: Initial implementation of an AST 2021-07-22 21:51:22 -04:00
ReinUsesLisp
8e9207253c shader: Better constant folding 2021-07-22 21:51:22 -04:00
ReinUsesLisp
f5b3324bca shader: Make typed IR 2021-07-22 21:51:21 -04:00
ReinUsesLisp
37fc39de17 shader: Constant propagation and global memory to storage buffer 2021-07-22 21:51:21 -04:00