Commit Graph

32 Commits

Author SHA1 Message Date
Liam 5a712bb51a general: fix compile for Apple Clang 2022-11-22 22:22:28 -05:00
Fernando Sahmkow 335b4b81cd Shader Decompiler: Fix dangerous behavior of invalid iterator insertion. 2022-10-06 21:00:52 +02:00
lat9nq e8fc40baa1 structured_control_flow: Remove constexpr Flow::Block
This seems to be unsupported in newer libstdc++ versions due to
Flow::Block's base class being a non-literal type. It's not clear to me
why this was permitted in earlier versions.
2022-06-13 19:18:20 -04: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 8485bb3dcb structured_control_flow: Skip reordering nested demote branches.
Nested demote branches add complexity with combining the condition if it has not been initialized yet. Skip them for the time being.
2021-08-30 11:46:25 -04:00
ameerj e9a8e011f6 structured_control_flow: Conditionally invoke demote reorder pass
This is only needed on select drivers when a fragment shader discards/demotes.
2021-08-30 11:46:24 -04:00
ameerj 8c687b3a91 structured_control_flow: Add DemoteCombinationPass
Some drivers misread data when demotes are interleaved in the program. This moves demote branches to be checked at the end of the program.
Fixes "wireframe" issue in Pokemon SwSh on some drivers
2021-08-28 11:35:25 -04:00
ReinUsesLisp 2321666580 shader: Avoid usage of C++20 ranges to build in clang 2021-07-22 21:51:40 -04:00
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
2021-07-22 21:51:40 -04:00
lat9nq c969f6e678 shader: GCC fmt 8.0.0 fixes 2021-07-22 21:51:40 -04:00
ReinUsesLisp 04c1dca457 shader: Move loop safety tests to code emission 2021-07-22 21:51:39 -04:00
ReinUsesLisp d633ec4ecc shader: Calibrate loop safety threshold 2021-07-22 21:51:38 -04:00
ReinUsesLisp 574a99b9b3 shader: Fix loop safety to SSA pass 2021-07-22 21:51:35 -04:00
lat9nq 3a70b6c79b shader: Add shader loop safety check settings
Also add a setting for enable Nsight Aftermath.
2021-07-22 21:51:35 -04:00
ReinUsesLisp 142d4f3f6e shader: Always initialize up reference in structure control flow
Fixes ubsan issue.
2021-07-22 21:51:34 -04:00
ReinUsesLisp 5c6dc51c69 shader: Read branch conditions from an instruction
Fixes the identity removal pass.
2021-07-22 21:51:32 -04:00
lat9nq 69210028b4 shader_recompiler: GCC fixes
Fixes members of unnamed union not being accessible, and one function
without a declaration.
2021-07-22 21:51:31 -04:00
ReinUsesLisp f2ae32fa76 glasm: Initial implementation of phi nodes on GLASM 2021-07-22 21:51:31 -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
ReinUsesLisp 172942911a shader: Fix gcc warnings 2021-07-22 21:51:28 -04:00
ReinUsesLisp 3c1229a7c5 shader: Improve goto removal algorithm complexity
Find sibling node containing a nephew searching from the nephew itself
instead of the uncle.
2021-07-22 21:51:28 -04:00
ReinUsesLisp 7769517fc0 shader: Move siblings check to a separate function and comment them out 2021-07-22 21:51:28 -04:00
ReinUsesLisp 31835567f2 shader: Mark blocks with no end branch as unreachable 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
ReinUsesLisp 876dd94b57 shader: Fix indirect branches to scheduler instructions 2021-07-22 21:51:25 -04:00
FernandoS27 bf9d512e17 shader: Implement BRX 2021-07-22 21:51:25 -04:00
ReinUsesLisp 0b338e3102 shader: Fix structured control flow on KIL instructions
This could potentially leave unvisited blocks, leading to illegal phi
nodes.
2021-07-22 21:51:24 -04:00
ReinUsesLisp 1688302a0d shader: Properly insert Prologue instruction 2021-07-22 21:51:24 -04:00
ReinUsesLisp 24bc872af3 shader: Implement NDC [-1, 1], attribute types and default varying initialization 2021-07-22 21:51:24 -04:00
ReinUsesLisp 33090a74dd shader: Add partial rasterizer integration 2021-07-22 21:51:23 -04:00
ReinUsesLisp db2e9d64aa shader: Implement CAL inlining function calls 2021-07-22 21:51:23 -04:00