Also, added more notes and code on the PSDef.PSTextureMode field (which lies outside of the render state pixel shader range), and skip the values of the final combiner constants when checking for uniqueness of pixel shader definitions.
Since we've ported over to Direct3D 9, and we're using pixel shader version 1.4, we've got more than enough constants available to remove the need for constant packing.
Also, there was a left-over patch on SetPixelShaderConstant which must no longer be applied, since nowadays we read constant values straight from their corresponding render state slots.
This also implies we no longer need to declare the final combiner constants as part of the shader assembly, because these 2 are also read from their corresponding xbox render state slots, and thus can be transferred to host on each update.
This will likely improve the output of pixel shaders which stay otherwise unchanged but rely on changing constant values.
In the case of 25 to Life, MultiplyTransform calls SetTransform
which corrupted the host's internal state. Introduce a guard variable
to ensure we call to host only once per the patch chain and keep
the internal state pristine
Fixes (not yet visible) rendering in Burnout 3, possibly because to it
having an unpatched LTCG-specific GetTransform or reading from
the D3D state directly.
This should improve numerical stability of the reverse transformation
when D24 depth is used by the game, as this caused viewport.z
to be very large (0xFFFFFF).
* Closes a possible race condition where a child thread uses
ThreadHandle or dwThreadId AND starts before _beginthreadex even returns
* Allows to remove hardcoded sleeps "slowing down" parent thread
execution in favour of more reliable affinity mask changes on the child thread
Test case: The Warriors and its race condition on event creation
(child thread waits on the event parent thread creates AFTER spawning
the child thread)
It doesn't seem to be useful anymore (does not protect any thread-unsafe
initialization), and it was encouraging the OS scheduler to keep executing
the child thread before returning the parent thread from PsCreateSystemThreadEx
Test case: The Warriors and its race condition on event creation
(child thread waits on the event parent thread creates AFTER spawning
the child thread)
NASCAR Heat 2002 (and probably plenty of other titles) submit
an empty buffer to stop audio. Handling this properly fixes
issues with audio samples lingering throughout the session.