mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-18 23:07:07 -05:00
perf(shader): judge first-lane and constant reads by what they read
MayEvaluate took ReadFirstLane and ReadConst as evaluable without looking at their sources, so plans kept conditions behind per-lane values.
This commit is contained in:
1 parent
47a266cf97
commit
745cdb5bf7
4 files changed
+56
-11
No files matched your search
@@ -155,7 +155,7 @@ The comparison runs again when any of them changes. A CPU store into unwatched m
|
||||
|
||||
A cached shader keeps an `IrResourcePlan` (`ResourceMaterializer::ExtractPlan` in [`ResourceMaterializer.cpp`](../../core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp)) for as long as it is registered: a copy of the IR values its descriptor sources, SRT reads, uniform fill and control-flow conditions depend on, which every capture walks to read the shader's resources from guest memory. The copy is sized to what the walk can use:
|
||||
|
||||
- A control-flow condition is kept only when `Detail::Evaluator::MayEvaluate` finds a runtime it could be evaluated for. A condition that depends on a vector register, or on an opcode the evaluator does not evaluate, takes both successors whatever the runtime holds, so the plan stores it as no condition and does not copy its operands. Such conditions are most of a shader's IR when the masked-lane code feeds its branches.
|
||||
- A control-flow condition is kept only when `Detail::Evaluator::MayEvaluate` finds a runtime it could be evaluated for. A condition that depends on a vector register, or on an opcode the evaluator does not evaluate, takes both successors whatever the runtime holds, so the plan stores it as no condition and does not copy its operands. A first-lane read is judged by its source under the read's active mask, and a constant read by the SRT read it names, as the evaluator reads them. Such conditions are most of a shader's IR when the masked-lane code feeds its branches.
|
||||
- The copied values are allocated in one `IrValueArena` and hold no use lists: the walk only follows arguments.
|
||||
|
||||
### Shader MODE register access
|
||||
|
||||
Reference in new issue
Block a user