When both rt min and max are equal then we know what Ad value is,
if so use Af bit instead and set AFIX value from rt alpha value that we know.
On OpenGL when BLEND C == 1 but reading the rt is disabled, set the value to 0 instead
of reading an undefined value.
- Don't declare texture if it's not read from. Stops Vulkan validation
layers whinging.
- Get rid of OpenGL common_header.glsl, and use name linking instead of
leftovers from separate shader objects.
GS/HW: Only use temporary source for recursive draw
.. and don't insert it into the page map.
GS/HW: Lookup page list for depth sources
GS/HW: Avoid target copies by using shader sampling
GS/HW: Make texture cache a global pointer
GS/HW: Remove GetID() from GSTexture
It only made sense for OpenGL, was always zero in Vulkan.
GS/HW: Rewrite texture sampling hazard detection
Also avoid redundant channel shuffle setup.
GS/HW: Turn Haunting Ground CRC into an OI fix
Change texture scale from vector to scalar
- Independent X and Y scaling is long gone.
- Also separate size and scale in TC lookup
Move clear value for texture to base class
Align heights to page size
- Since FRAME and Z are in page units, we can't have two targets
- overlapping within the same page.
- Stops some small resizes too.
- Test cases: Genji and Spider-Man 2 shadows.
Don't modify target TEX0 on shuffle/clear
Move upscale multiplier to uniform
Make P8 conversion page-aware
Fix incorrect depth preload shader
Improve HLE of texture shuffles
When a texture shuffle is split into two half-screen draws, we skip the
first, and draw the whole thing in the second, taking care of when both
the texture and framebuffer are offset.
Compensate slightly for Cd*(As + 1) - Cs*As.
Try to compensate a bit with substracting 1 (0.00392) * (Alpha + 1) from Cs.
The initial factor we chose is 1 (0.00392) as that is the minimum color Cd can be, then we multiply by alpha to get the minimum blended value it can be.
Replace Cs*As + Cd*(1 - As) with Cs*As - Cd*(As - 1).
Replace Cs*F + Cd*(1 - F) with Cs*F - Cd*(F - 1).
As - 1 or F - 1 subtraction is only done for the dual source output (hw blending part)
since we are changing the equation.
Af will be replaced with As in shader and send it to dual source output.
Also check if A*Alpha in the shader overflows, if it does then adjust the
alpha that is sent for HW blending further to compensate.
Idea is to replace Ad with As when alpha write is masked,
then expand/let blend mix, accumulation blend non recursive blend or hw clr blend to
do the blending with Ad swapped as As.
We are doing this to try to bring some originally higher blending modes to lower levels
where we can do the draws with less texture barriers instead (gl/vk),
as for d3d11 this allows to run blending on the draws since previously the cases weren't handled properly,
it will be slower on d3d11 since we will be reading the frame buffer but it's better than nothing.
D3D11: It is enabled on Medium blending or higher, if draw is fbmask then it will enable
it on basic blending too.
OpenGL/Vulkan:
It is enabled based on the previous blending modes:
accumulation blend -> either minimum or basic level, depending on colclamp.
non recursive blend -> either minimum or basic level, depending on colclamp.
blend mix -> basic and higher level.
hw clr blend -> minimum and higher level.
All:
Prefer full sw blend when primitives don't overlap, sw fbmask or full barrier is used, it is more accurate.