[PATCH vkd3d v2 4/6] vkd3d-shader: Generate the synthetic name for the temp variable instead of the uniform.

Matteo Bruni mbruni at codeweavers.com
Tue Apr 20 03:15:01 CDT 2021


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
I think a better way to handle this is to use a separate temp variable
for each LOAD of the uniform, thus replacing each uniform LOAD with a
STORE to a temp variable and a LOAD from that. That way we get less
register pressure without having to complicate the register allocation
or liveness computation algorithms. That is assuming that register
pressure on the temporary registers is quite problematic for SM2 or
even SM3 shaders since there are so few of them and there is no
spilling to save the day.

Of course there is a complication with that, that is preserving
"writes" to uniforms. That could be taken into account pretty simply
with write tracking, but another option is to do the above
optimization only when legacy mode is not set (AFAIU writing to
uniforms / globals is only allowed on older d3dx9 / d3dcompiler
versions).

Just food for thought. Also, ignore everything if you have something
fancier already queued up.



More information about the wine-devel mailing list