Commit Graph

27 Commits

Author SHA1 Message Date
907dfbea71 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
4fda7f1c82 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
862dc2b2b3 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
bf2956d77a shader: Avoid usage of C++20 ranges to build in clang 2021-07-22 21:51:40 -04:00
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
2e5af95541 shader: GCC fmt 8.0.0 fixes 2021-07-22 21:51:40 -04:00
808ef97a08 shader: Move loop safety tests to code emission 2021-07-22 21:51:39 -04:00
1d182fc0f5 shader: Calibrate loop safety threshold 2021-07-22 21:51:38 -04:00
7ac55c2a75 shader: Fix loop safety to SSA pass 2021-07-22 21:51:35 -04:00
373f75d944 shader: Add shader loop safety check settings
Also add a setting for enable Nsight Aftermath.
2021-07-22 21:51:35 -04:00
329dea217d shader: Always initialize up reference in structure control flow
Fixes ubsan issue.
2021-07-22 21:51:34 -04:00
9bb3e008c9 shader: Read branch conditions from an instruction
Fixes the identity removal pass.
2021-07-22 21:51:32 -04:00
f7a2340205 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
bf5e48ffe4 glasm: Initial implementation of phi nodes on GLASM 2021-07-22 21:51:31 -04:00
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
c8f9772d65 shader: Fix gcc warnings 2021-07-22 21:51:28 -04:00
cc0fcd1b8d 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
e4d1122082 shader: Move siblings check to a separate function and comment them out 2021-07-22 21:51:28 -04:00
dfd5341d71 shader: Mark blocks with no end branch as unreachable 2021-07-22 21:51:27 -04:00
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
b0d5572abf shader: Fix indirect branches to scheduler instructions 2021-07-22 21:51:25 -04:00
34aba9627a shader: Implement BRX 2021-07-22 21:51:25 -04:00
a806b29cb9 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
d3dad6b632 shader: Properly insert Prologue instruction 2021-07-22 21:51:24 -04:00
68a9505d8a shader: Implement NDC [-1, 1], attribute types and default varying initialization 2021-07-22 21:51:24 -04:00
260743f371 shader: Add partial rasterizer integration 2021-07-22 21:51:23 -04:00
71f96fa636 shader: Implement CAL inlining function calls 2021-07-22 21:51:23 -04:00