Commit graph

152 commits

Author SHA1 Message Date
Morph
db07ca6c7f
Merge pull request #6767 from ReinUsesLisp/fold-float-pack
shader: Fold UnpackFloat2x16 and PackFloat2x16
2021-07-30 02:07:52 -04:00
bunnei
a98f14e9b0
Merge pull request #6722 from ReinUsesLisp/xmad-opts
shader: Fold integer FMA from Nvidia's pattern
2021-07-29 18:45:37 -07:00
ReinUsesLisp
8c9febe8f7 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
1bb46b7d64 shader: Mark ConvertF16F32 and ConvertF32F16 as fp16 instructions
Fixes instances where fp16 types are not declared on SPIR-V but they are
used. This shouldn't happen on master, as it's been uncovered by an
additional optimization pass.
2021-07-27 21:33:05 -03:00
ReinUsesLisp
66a0cedba3 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
09fb41dc63 shader: Use TryInstRecursive on XMAD multiply folding
Simplify a bit the logic.
2021-07-26 04:15:27 -03:00
ReinUsesLisp
bf2956d77a shader: Avoid usage of C++20 ranges to build in clang 2021-07-22 21:51:40 -04:00
lat9nq
49946cf780 shader_recompiler, video_core: Resolve clang errors
Silences the following warnings-turned-errors:
-Wsign-conversion
-Wunused-private-field
-Wbraced-scalar-init
-Wunused-variable

And some other errors
2021-07-22 21:51:40 -04:00
ameerj
41c6cb70f9 glsl: Fix tracking of info.uses_shadow_lod 2021-07-22 21:51:40 -04:00
ameerj
57f222c56e dual_vertex_pass: Clang format 2021-07-22 21:51:40 -04:00
ReinUsesLisp
7dafa96ab5 shader: Rework varyings and implement passthrough geometry shaders
Put all varyings into a single std::bitset with helpers to access it.

Implement passthrough geometry shaders using host's.
2021-07-22 21:51:39 -04:00
lat9nq
257d2aab74 lower_int64_to_int32: Add missing include 2021-07-22 21:51:39 -04:00
ReinUsesLisp
d8d5501459 shader: Add int64 to int32 lowering pass 2021-07-22 21:51:39 -04:00
ReinUsesLisp
04ef2160f9 shader: Teach global memory base tracker to follow vectors 2021-07-22 21:51:39 -04:00
ReinUsesLisp
97e80dda55 shader: Add constant propagation to integer vectors 2021-07-22 21:51:39 -04:00
ReinUsesLisp
808ef97a08 shader: Move loop safety tests to code emission 2021-07-22 21:51:39 -04:00
ameerj
a0365217f5 texture_pass: Fix is_read image qualification
Atomic operations are considered to have both read and write access. This was not  being accounted for.
2021-07-22 21:51:38 -04:00
ReinUsesLisp
0cd08b3e72 shader: Align constant buffer sizes to 16 bytes
WAR for AMD reading zeroes on uniform buffers of size 2.
2021-07-22 21:51:38 -04:00
ReinUsesLisp
374eeda1a3 shader: Properly manage attributes not written from previous stages 2021-07-22 21:51:38 -04:00
ameerj
d36f667bc0 glsl: Address rest of feedback 2021-07-22 21:51:38 -04:00
ameerj
a0d0704aff glsl: Conditionally add EXT_texture_shadow_lod 2021-07-22 21:51:38 -04:00
ameerj
6aa1bf7b6f glsl: Implement legacy varyings 2021-07-22 21:51:38 -04:00
ameerj
9ccbd74991 glsl: Fix ATOM and implement ATOMS 2021-07-22 21:51:37 -04:00
ameerj
5399906c26 glsl: Track S32 atomics 2021-07-22 21:51:36 -04:00
ameerj
11ba190462 glsl: Revert ssbo aliasing. Storage Atomics impl 2021-07-22 21:51:36 -04:00
ameerj
3d9ecbe998 glsl: Wip storage atomic ops 2021-07-22 21:51:36 -04:00
ReinUsesLisp
7ac55c2a75 shader: Fix loop safety to SSA pass 2021-07-22 21:51:35 -04:00
lat9nq
373f75d944 shader: Add shader loop safety check settings
Also add a setting for enable Nsight Aftermath.
2021-07-22 21:51:35 -04:00
FernandoS27
562af30181 shader: Fix VertexA Shaders. 2021-07-22 21:51:34 -04:00
ReinUsesLisp
4a2361a1e2 buffer_cache: Reduce uniform buffer size from shader usage
Increases performance significantly on certain titles.
2021-07-22 21:51:34 -04:00
ReinUsesLisp
5539b13c5a shader,glasm: Implement legacy texcoord loads 2021-07-22 21:51:34 -04:00
ReinUsesLisp
ac0f5d2ab6 shader: Track legacy varyings 2021-07-22 21:51:34 -04:00
ReinUsesLisp
457dda69cc shader: Clang-format secondary textures 2021-07-22 21:51:34 -04:00
ReinUsesLisp
627161c38e shader: Fix secondary textures 2021-07-22 21:51:34 -04:00
ReinUsesLisp
fbf5cdcba0 shader: Fix FSwizzleAdd folding when going through phi nodes 2021-07-22 21:51:34 -04:00
ReinUsesLisp
77ee733c3a glasm: Remove unintentionally committed fmt::prints 2021-07-22 21:51:33 -04:00
ReinUsesLisp
bf5e48ffe4 glasm: Initial implementation of phi nodes on GLASM 2021-07-22 21:51:31 -04:00
ReinUsesLisp
d54d7de40e 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
ReinUsesLisp
c4fd6b55bc glasm: Implement shuffle and vote instructions on GLASM 2021-07-22 21:51:31 -04:00
FernandoS27
ee61ec2c39 shader: Optimize NVN Fallthrough 2021-07-22 21:51:30 -04:00
ameerj
7ecc6de56a shader: Implement Int32 SUATOM/SURED 2021-07-22 21:51:30 -04:00
FernandoS27
c49d56c931 shader: Address feedback 2021-07-22 21:51:29 -04:00
FernandoS27
b541f5e5e3 shader: Implement VertexA stage 2021-07-22 21:51:29 -04:00
ameerj
20e86fd615 shader: Fix BFE s32 undefined check
Our unit tests were hitting this exception.
2021-07-22 21:51:29 -04:00
ReinUsesLisp
50eb03382e shader: Fix error checking in bitfieldExtract and implement bitfieldInsert folding 2021-07-22 21:51:29 -04:00
ReinUsesLisp
0c7230a606 shader: Add more strict validation the pass 2021-07-22 21:51:29 -04:00
ReinUsesLisp
25949b864c shader: Fix forward referencing identity instructions when inserting phi 2021-07-22 21:51:29 -04:00
ReinUsesLisp
92a01984e6 shader: Remove invalidated blocks in dead code elimination pass 2021-07-22 21:51:29 -04:00
ReinUsesLisp
d10cf55353 shader: Implement indexed textures 2021-07-22 21:51:28 -04:00
ReinUsesLisp
23182fa59c shader: Intrusively store in a block if it's sealed or not 2021-07-22 21:51:28 -04:00