Follow up from the previous commit which is bypassing the texture cache
when the frame buffer is sampled.
Crc hacks are no longer needed on opengl.
Note: it requires at least Basic blending support.
Proof of concept. It should provide a huge speedup when accurate
blending is enabled for tri-ace / Jak / R&C (shadow rendering).
See #2894
Need PR#2892
v2: Add const + comment to explain that code isn't ideal.
Single triangle draw can now hit the tex_is_fb path.
Primitive Overlap will return no overlap for single primitive (triangle).
Ratchet and Clank, Jak, tri-Ace games.
It should improve shadow rendering.
Idea by Gregory.
Depth and channel shuffle rendered correctly on all renderers.
Also add some missing crc ids for Tales of Abyss.
PS: I'm ninjaing 3000 builds on the buildbot 😄
Don't set DATE true when Accurate Date is off, DATE is true anyway so
no need to set it again.
Don't call full barrier for DATE 45 at the date selection, do it
at the shader call check. It's the same, plus we avoid extra checks.
This will allow to save hotkey option toggling to the ini which
should fix gui updating with hotkey toggles.
Note: Render hw/sw switch doesn't work.
Also update some options that didn't have hotkey nametag.
1. Allow hrd colclip to also run on the unsupported
cases which should be pretty rare.
2. Remove colclip from high sw blending.
3. Disable the hdr colclip shader which may not be
actually required to run.
Idea by Gregory
* Use GLExtension::Has in cold path
* Throw error at first error
* Remove aniso check, all hardware support it. Bonus add GL4.6 extension support
* Remove viewport array check. We replace the function pointer anyway
Allow to compile on distribution that still ship an older file
The file is only a patchup of the missing 4.3/4.4/4.5/4.6 define
v2: rename the file and add khronos copyright
There are 2 extensions GL_ARB_debug_output (promoted from amd extension)
and GL_KHR_debug (the core extension, promoted from GL_ARB_debug_output)
As we use the callback we could drop the manual query of errors.
And save us the load of the GL_ARB_debug_output extension function pointer.
I used glcorearb.h as input file
Code is limited to core gl + KHR/ARB extension
GL1.X must be handled manually (need only 3 functions)
I think the solution would be to migrate gl.h/glext.h to the
single glcorearb.h. However we might need to update the code to fetch
pointer accordingly
Note: we don't check the null ptr anymore on GSwnd. It isn't important
as we check the extension.
v2: update copyright
v3: update copyright space
v4: update copyright of script
fix copyright
Upscaling issue with texture shuffle on dx and gl. Also removes shadows
on gl.
Bbox issue on dx.
Dumps from Sly 2 and 3 look fine after the merge.
Also add a crc id BF1739E2 for a prototype Sly2. I don't remember who
game me the dump or if it's official.
Improved handling of frame buffer copy by accounting for fb read on all slots.
- implement before/after draw functions
- defer setting of resources on the api to just before the draw
- use a bitfield to keep track of set/copied resources
- recycle copies after draw
Fixes: RE4 and Tales of Abyss
Assume that driver support is good when GL_ARB_texture_barrier and
GL_ARB_direct_state_access are both supported, disable the log in that
case.
Kaby Lake and above already support the required extensions (windows) so
the log is useless. It should be the same case for Skylake. Mesa driver
should already be good.
Note: SSO is still broken even on latest igpu.
Use a function to check UserHacks for all variables in GSState.cpp
instead of checking each variable individually.
Get rid of UserHacks_HPO local variables in GSRendererOGL/DX and use the
member variable m_userHacks_HPO instead, we don't need duplicates that
do the same thing.
Add ResetStates call at the beginning of GSRendererDX to match gl
behavior.
Use value of 1 when upscale multiplier is 0 for ScalingFactor, this is
to avoid doing math with 0 in shader.
It helps custom res be less broken. Still not recommended to use custom
res ofc.
Game reads framebuffer depth as alpha of texture.
However, this is a problem for d3d11 as a shader read on the fb is not allowed.
So let's handle it in a similar fasion to channel shuffle:
- Set depth to slot 4
- Detect when slot 4 matches depth rt
- Copy and send the copy to the shader
Don't enable hack on native res if crc(ntsc only) is below aggressive.
Note for future so I don't forget: This hack can be disabled if depth
hack is also disabled.
GSC_GodOfWar moved to aggressive state.
GSC_GodOfWar2 some value swere corrected (should fix some regressions)
and hack was moved to partial state because we have an upscaling hack.
Idea is to disable multiple features in 1 option to avoid gui clutter.
Unscale Point and Line:
This partially reverts PR #2710 restoring Unscale Point and Line but as a disable option.
It can help Xenosaga games.
GS Memory clearning:
This disables GS memory clearing to be done on the CPU, by default both gpu and cpu do memory clearing
which is more accurate.
It can help Kingdom Hearts games.
Hack removed depth effects which are rendered properly. I wasn't able to
trigger a skip on the other hack draw calls, they need to be
investigated further what they actually did.
It ensures the code cases are hit properly for all DATE selection cases.
Texture shuffle case with Slow DATE is not yet supported so keep using
the old DATE method.
Remove GSCrc.h include in GSRendererHW and GSRendererDX11, file is
already included in GSState.h.
Remove GSRenderer.h include from renderers except Null and CL, file already
included in TextureCache hw/sw.
Remove resource.h include from GSRendererDX11, already included in GSDevice11.
Remove GSOsdManager.h from GSDeviceOGL, already included in GSDevice
Game has upscaling issues so let's only add the hack for upscaling,
also merge the two regions together.
Hack will be disabled on native res if crc is below aggressive, upscaled
is set to partial level.
Purge dbz bt3 crc hack that removed outlines, I don't want to mix it
with the depth effect hack that I also moved to aggressive.
Move depth hacks for ntsc region to aggressive state.
The hack was used when depth emulation was not supported or when depth
is disabled.
It causes graphical glitches with the faces when depth is disabled.
Update CopyOffscreen to accept the ps_shader value when doing StretchRect.
This fixes an issue where it was selecting the wrong PS for depth cache read.
Should (hopefully) fix SMT.
Switch to using opacity since this is how most software works.
Transparency is simply confusing to the average user.
Linux/Windows GUI to be updated in later commits.
Remove DATE shader macro and bit.
Remove useless HasStencil case. If DATE is enabled stencil is also
enabled, this check is useless.
Remove leftover rt and rtCopy code case from d3d9.
Remove traces of rtCopy and sampler in slot 2.
rtcopy
Remove one crc hack for GSC_HauntingGround. It skipped some depth
effects. Correctly rendered now
Remove all crc hacks for GSC_FrontMission5.
Texture shuffle, depth emulation and enabling Preload Frame Data
emulates the effects correctly.
Add a note for GSC_Tenchu for future testing.
And the time has come to say good bye (good riddance?), this build removes Direct3D9 entirely from GSdx. D3D9 is/was holding us back in some D3D11 fixes that we want to further implement.
The last build that supports D3D9 is v1.5.0-dev-2779-g1a61148b0 for anyone still interested.
"Press F to pay respect.
Dfmt in texture shuffle function already picks the 16 format on slot 2
so it's better to let it call the shader instead of aout.
We can keep old aout code until FbMask emulation is added on d3d11. We
can purge aout along with alpha hack then.
Added fixme note.
Fixes recent regression on Soul Calibur.
It helps isolate psm.depth when it should and shouldn't run even if
sampling isn't supported yet.
Finding Nemo depth issue remains.
People can use the option to disable depth for now on that game.
I'm seeing better results with this skip not included.
So far DBZBT, God of War, Haunting Ground seem better.
Depth sampling is still not yet added.
Also fixes a regression in GT4 when depth was enabled because the skip
function was misplaced. Other games might've been affected as well.
Move texture shuffle (shadows) hack to aggressive state.
Adjust water/hell effect crc hack - don't enable hack on native res if
crc is below aggressive, enable if resolution is higher on dx and gl
state.