Commit graph

80 commits

Author SHA1 Message Date
Liam e228a40db8 shader_recompiler: Use functions for indirect const buffer accesses 2022-03-17 13:30:21 -04:00
Liam 52895fab67 shader: add support for const buffer indirect addressing 2022-03-14 19:43:32 -04:00
ameerj ad58d7eae7 shaders: Add U64->U32x2 Atomic fallback functions 2022-01-29 19:55:53 -05:00
ameerj 4790ba7839 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
2022-01-28 19:00:04 -05:00
ameerj 14ac0c2923 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
ReinUsesLisp e66d5b88a6 shader: Properly scale image reads and add GL SPIR-V support
Thanks for everything!
2021-11-16 22:11:29 +01:00
ReinUsesLisp c15332c44f shader: Add IsTextureScaled opcode 2021-11-16 22:11:28 +01:00
ReinUsesLisp 1672e9ba09 shader: Fix resolution scaling pass 2021-11-16 22:11:27 +01: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
ameerj 41c6cb70f9 glsl: Fix tracking of info.uses_shadow_lod 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
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 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 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 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
ReinUsesLisp 050e81500c shader: Move microinstruction header to the value header 2021-07-22 21:51:28 -04:00
ReinUsesLisp 7018e524f5 shader: Add NVN storage buffer fallbacks
When we can't track the SSBO origin of a global memory instruction,
leave it as a global memory operation and assume these pointers are in
the NVN storage buffer slots, then apply a linear search in the shader's
runtime.
2021-07-22 21:51:28 -04:00
FernandoS27 f69d0b91ff shader: Address feedback 2021-07-22 21:51:28 -04:00
FernandoS27 080857b60e shader: Add coarse derivatives 2021-07-22 21:51:28 -04:00
FernandoS27 04c459fc8d shader: Implement fine derivates constant propagation 2021-07-22 21:51:28 -04:00
ReinUsesLisp 80940b1706 shader: Implement SampleMask 2021-07-22 21:51:28 -04:00
ReinUsesLisp 95815a3883 shader: Implement PIXLD.MY_INDEX 2021-07-22 21:51:28 -04:00
ReinUsesLisp e3514bcd6b spirv: Implement ViewportMask with NV_viewport_array2 2021-07-22 21:51:28 -04:00
ReinUsesLisp b0f1255c8c shader: Implement PrimitiveId 2021-07-22 21:51:27 -04:00
ReinUsesLisp 183855e396 shader: Implement tessellation shaders, polygon mode and invocation id 2021-07-22 21:51:27 -04:00
ReinUsesLisp d8ec99dada spirv: Implement Layer stores 2021-07-22 21:51:27 -04:00
ReinUsesLisp fa75b9b062 spirv: Rework storage buffers and shader memory 2021-07-22 21:51:27 -04:00
ReinUsesLisp 23b8714732 spirv: Define StorageImageWriteWithoutFormat capability when used 2021-07-22 21:51:27 -04:00
ReinUsesLisp 5c61e860e4 shader: Implement SR_THREAD_KILL 2021-07-22 21:51:27 -04:00
ameerj 3db2b3effa shader: Implement ATOM/S and RED 2021-07-22 21:51:27 -04:00
ReinUsesLisp ab543f1821 spirv: Guard against typeless image reads on unsupported devices 2021-07-22 21:51:27 -04:00
ReinUsesLisp 9280cd649a shader: Move LaneId to the warp emission file and fix AMD 2021-07-22 21:51:27 -04:00
ReinUsesLisp 7cb2ab3585 shader: Implement SULD and SUST 2021-07-22 21:51:26 -04:00
lat9nq 0bb85f6a75 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 dcaf0e9150 shader: Address feedback 2021-07-22 21:51:26 -04:00
FernandoS27 73cb17f41b shader: Implement indexed Position and ClipDistances 2021-07-22 21:51:26 -04:00
FernandoS27 1d51803169 shader: Implement indexed attributes 2021-07-22 21:51:26 -04:00
ReinUsesLisp da6cf2632c shader: Add subgroup masks 2021-07-22 21:51:26 -04:00
ReinUsesLisp 3f594dd86b shader: Reimplement GetCbufU64 as GetCbufU32x2
It may generate better code on some compilers and it's easier to handle.
2021-07-22 21:51:26 -04:00
FernandoS27 45d547af11 shader: Implement SR_LaneId 2021-07-22 21:51:26 -04:00