ameerj
6091af472a
dead_code_elimination_pass: Remove unreachable Phi arguments
5 years ago
ameerj
09128c9106
shader_recompiler/dead_code_elimination: Add DeadBranchElimination pass
This adds a pass to eliminate if(false) branches within the shader code
5 years ago
ameerj
0df188787a
shader_recompiler: Reduce unused includes
5 years ago
Liam
83b1c9de37
Address review comments
5 years ago
Liam
95b9f62686
shader_recompiler: Use functions for indirect const buffer accesses
5 years ago
Liam
8515dba789
shader: add support for const buffer indirect addressing
5 years ago
Fernando Sahmkow
fc8251e043
Shader decompiler: Fix storage tracking in deko3d.
5 years ago
ameerj
1888b552e3
rescaling_pass: Fix rescaling Color2DArray ImageFetch offsets
ImageFetch offsets for 2D array coordinates have a different composite size than the coordinates. The rescaling pass was not taking this into account.
Fixes broken shaders when scaling is enabled in Astral Chain, and likely other titles.
5 years ago
ameerj
94b86a8ada
lower_int64_to_int32: Add 64-bit atomic fallbacks
5 years ago
ameerj
0c5e641757
shaders: Add U64->U32x2 Atomic fallback functions
5 years ago
ameerj
c3d768426c
spirv_atomic: Define U32x2 storage buffers for 64-bit storage atomics
Some drivers do not support 64-bit atomics, and fallback to atomically modifying U32x2 vectors. This change ensures that U32x2 storage vectors are defined in the spir-v shader when 64-bit atomics are used.
Fixes a hang on some devices, notably Intel GPUs, when booting Pokemon Legends Arceus
5 years ago
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.
5 years ago
Fernando Sahmkow
04b8e6c834
ShaderCache: Better fix for Shuffling gl_FragCoord
5 years ago
FernandoS27
b3494533e5
Texture Cahe/Shader decompiler: Resize PointSize on rescaling, refactor and make reaper more agressive on 4Gb GPUs.
5 years ago
ameerj
1ce6cd119d
rescaling_pass: Fix IR errors when unscalable texture types are encountered
5 years ago
ameerj
63465c24e1
rescaling_pass: Logic simplification and minor style cleanup
5 years ago
ameerj
746d27372f
rescaling_pass: Scale ImageFetch offset if it exists
Plus some code deduplication
5 years ago
ameerj
b5ba8bec0e
rescaling_pass: Enable PatchImageQueryDimensions on fragment stages
5 years ago
ameerj
e2f0f51295
gl_texture_cache/rescaling_pass: minor cleanup
5 years ago
ameerj
54ecf7c8c1
rescaling_pass: Fix and simplify shuffle/fragcoord pass
5 years ago
Fernando Sahmkow
4535feac87
Shader: Don't rescale FragCoord if used by Shuffle
5 years ago
Fernando Sahmkow
2549ee33ee
RescalingPass: Agregate pixels on texelFetch while on Fragment Shader
5 years ago
Fernando Sahmkow
dc6f13060b
shader: Fix TextureSize check on rescaling.
5 years ago
ReinUsesLisp
d04e2dac6c
shader: Properly scale image reads and add GL SPIR-V support
Thanks for everything!
5 years ago
ReinUsesLisp
928ff21aae
shader: Properly blacklist and scale image loads
5 years ago
ReinUsesLisp
403633afcc
shader/rescaling_pass: Patch more instructions
5 years ago
ReinUsesLisp
7f88938d72
shader: Add IsTextureScaled opcode
5 years ago
ReinUsesLisp
952c65ae54
shader: Fix rescaling pass
5 years ago
ReinUsesLisp
14fb648246
shader: Fix resolution scaling pass
5 years ago
Fernando Sahmkow
a638ce0388
ShaderDecompiler: Add initial support for rescaling.
5 years ago
Fernando Sahmkow
6f94c9a9fe
ShaderCache: Fix Phi Nodes Type on OGL.
5 years ago
Fernando Sahmkow
c9bee9e96e
ShaderCache: Order Phi Arguments from farthest away to nearest.
5 years ago
Fernando Sahmkow
6e19b9f5ff
TexturePass: Fix clamping of images as this allowed negative indices.
5 years ago
Fernando Sahmkow
1a0006ef55
Shader Compiler: avoid overflowed indices on indixed samplers.
5 years ago
ReinUsesLisp
ecc05bdcb6
shader: Fold UnpackFloat2x16 and PackFloat2x16
Simplifies the code a bit when possible. These instructions should be
no-ops codegen wise.
5 years ago
ReinUsesLisp
d84b81fdfb
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.
5 years ago
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
```
5 years ago
ReinUsesLisp
c6e1483e17
shader: Use TryInstRecursive on XMAD multiply folding
Simplify a bit the logic.
5 years ago
ReinUsesLisp
2321666580
shader: Avoid usage of C++20 ranges to build in clang
5 years ago
lat9nq
b557314001
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
5 years ago
ameerj
f2f16e3a1d
glsl: Fix tracking of info.uses_shadow_lod
5 years ago
ameerj
d54c4880d1
dual_vertex_pass: Clang format
5 years ago
ReinUsesLisp
b1df436cef
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.
5 years ago
lat9nq
0f092f17af
lower_int64_to_int32: Add missing include
5 years ago
ReinUsesLisp
e3df2285ca
shader: Add int64 to int32 lowering pass
5 years ago
ReinUsesLisp
ba211323ab
shader: Teach global memory base tracker to follow vectors
5 years ago
ReinUsesLisp
f54fa4a1f5
shader: Add constant propagation to integer vectors
5 years ago
ReinUsesLisp
04c1dca457
shader: Move loop safety tests to code emission
5 years ago
ameerj
633c54a202
texture_pass: Fix is_read image qualification
Atomic operations are considered to have both read and write access. This was not being accounted for.
5 years ago
ReinUsesLisp
9c387a270b
shader: Align constant buffer sizes to 16 bytes
WAR for AMD reading zeroes on uniform buffers of size 2.
5 years ago