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.
We are removing MSAA for the following reasons:
1. It's broken
2. Fixing it would mean it would perform as well as FSAA, which defeats the purpose of having it
3. It's only supported by DX and Windows
4. Reduction in code complexity
Press F to pay respect
255.0f / 128.0f gives us 1.9921875.
128.0f / 255.0f gives us 0.50196078431.
Which are more accurate.
Fixes regression in dbz bt3 where characters appeared darker.
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.
Comment out unused variable sLogTable in DplIIdecoder.cpp.
Remove DPLII.h from cmake list, it's unused so don't list it.
Some people suggested to keep the source files even if they are unused
so we can do that. Maybe someone will get the code to work properly.
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.
Get rid of GetLinearSrAr code, it wasn't used anywhere so I don't see a
reason why to keep it, other than clogging up the code, if someone wants
to work on it they can re add the function in the future.
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.
Some games don't play nice with the option and have huge amounts of
ram/vram spikes that can even lock up the system so it's better to have
the option disabled by default.
Fixes an issue when the plugin detects an opencl ini value for the
render. It used to throw a "GS plugin failed to load" error when opencl
was disabled but the ini value remained the same. The render will
fallback to D3D11 now.
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
Code was never hit on D3D11. D3D11 uses stencil operations.
Also Remove VS_RTCOPY which was used only by d3d9.
Remove RTCopy Sampler from the shader.
tfx 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.
D3D9 will be broken once #2756 is merged so let's disable it to avoid
any potential crashing if the render is selected.
Complete D3D9 purge will shortly follow afterwards.
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.
Idea is to allot partial support of depth fmt on the new depth convert
format, this way we can utilize channel shuffle on Red, Blue or gXbY
channels with depth shader conversion.
Terminator 3 hits this code path and seems to fix a transparent wall.
Other games will probably benefit from this as well.
Split the code from GSRendererDX to GSRendererDX9 and GSRendererDX11. We
ensure d3d9 doesn't blow up with regressions, add required code to
GSRendererDX11 to properly support channel shuffle.
Note the feature is still not yet complete, copy function needs to be
implemented (suggested by Gregory) but it can be done at a later date,
this still fixes a bunch of issues on various games.
The hack caused glitches to appear on the right side of the screen, the hack was used as a workaround to properly display game ui elements however it is no longer needed on opengl and d3d11. The ui elements are rendered properly with Depth Conversion.
Shadow issues are solved with at least partial level crc hacks.
See https://github.com/PCSX2/pcsx2/issues/2692 for more detailed information.
1) Refactor palette comparison fast path mechanism to avoid using mutable member of Source,
2) Attach palette to texture as soon as needed,
3) Bugfix attach CLUT copy only when pal > 0.
NTSC only.
I don't know what the "impact screen" crc hack did since the dump didn't
show any difference so that may need to be updated as well.
Note: I only tested the JP version.
Add support for dss_write.
Enable writing in depth buffer for dss_write,
when depth conversion is active data will be writen in the depth buffer,
if not then use the old method (don't write).
* spu2-x: Fix warnings regarding initializing with memset/memzero/etc...
* Use fill_n instead, per turtleli's suggestion.
* spu2-x: Comment out StereoOut initialization.
* spu2-x: As requested, remove commented out code.
The game still has a bunch of depth and other issues even on gl and it
doesn't play nice with the blur effect as well. Perhaps the hacks can be
changed to work better but for now enable it on native as well.
Fixes ground corrupt textures caused by the hack on the EU version.
US works fine with skip 5 but not 4. Didn't spot any regressions on both
so far. Might need extra testing by users.
Idea is to allow Alpha Stencil to work with Fast Date.
Let Fast Date run for the supported calls since it's more accurate, let
Alpha Stencil take care of the rest.
This might fix some issues where Alpha Stencil caused some issues making
it a bit more accurate.
It fixes a bunch of shadow/transparency issues.
Fast DATE doesn't rely on the gui option and is always on.
Confirmed fixed issues: Persona 3 shadows on d3d11,
Digital Devil Saga Transparency d3d9/11.
Fast accurate date works the same/similar to OpenGL.
Confirmed fixed issues: DBZ BT3 ground shadows, Fifa Street 1 shadows
on all d3d renders as well.
Also this option doesn't cause other transparency issues like the
Alpha Stencil hack.
Note: If Alpha Stencil is enabled Fast Date and Fast Accurate Date will
be disabled.
Note2: Full Accurate Date is not implemented so the code fallbacks to
Fast mode instead.
Commits:
3ab12cef2f584397a3fd
This will probably be the last feature d3d9 gets before getting purged.
Move Enable User Hacks at the top. Otherwise spacing looks weird.
Large Framebuffer should be next to Allow 8 bit textures.
Move Accurate Date and Accurate Blending at the bottom (similar to windows).
Suggested by Gregory.
Change the checkbox to a drop down list Off, Fast, Full.
Off and Full do the same as before, the Fast option is new. Most of the
time users don't actually need full Accurate Date so why not reduce that
cost and use a fast mode instead, plus it can also be used on a gpu with
a limited driver. Also change the default value to Fast instead of Off.
Always enable unscale point and line hack on upscaled resolutions, and
purge the gui option.
It was discussed in the past with Gregoy that it can be enabled without
causing any issues which will be beneficial to getting rid of 1 less
option and fixing a bunch of fmv issues without relying on a gui toggle.
Fix GSVector4i::compare64 function by adjusting the number of iterations
needed to cover the comparison of all the elements of the input arrays,
where the number of bytes to compare is indicated in the size parameter
of the function.
The function is used only in GSdx-TC to compare CLUT arrays.
On one hand this fix closes the recent #2706 and possibly the color
regressions indicated in #2702 (which were both introduced with the new
PaletteMap mechanism, which partially replaced the GSVector4i::update
logic with the bugged GSVector4i::compare64).
On the other hand this might impact long standing wrong texture cache
lookup when palette was involved with 8-bit palette disabled (to be
verified which ones).
Close#2713Fixes#2706Fixes#2715
Fixes right half screen issue on TalesOfLegendia. UI elements of the
screen are properly emulated with depth emulation on gl (possibly fixed
by
1cc696ab31).
Shadows will be glitchy if crc hack level is below partial level.
I'm not even sure if the hack is useful at all anymore since it
introduces issues now.
Issue #2692
The code was never working properly ( tested by @tadanokojin ) so let's
clean up and remove it. If someone actually wishes to maintain it then
they can re add it and update the code to a functional stage.
Cutie Chinese comments, they were removed in commit
21522e71b2
It's better to have google translated comments than nothing, at least we
have something to go on when doing future testing.
Also ghosting and blur crc hacks might need to be updated as they may
not be necessary on native res only.
List: GSC_Tekken5, GSC_TombRaiderUnderWorld, GSC_XE3, GSC_AceCombat4,
GSC_SoTC, GSC_ResidentEvil4.
Note: I left GSC_ValkyrieProfile2 in there because it might need to be
re enabled for dx, someday will look in to it when I'm up for the task.
This pull request is for the pending reorganization of the folder structure on GSdx,
making it better organized and easier to work with.
Also remove unused GSTextureFX.cpp file.
Enabled caching of clut copies with PaletteMap also in the case 8-bit texture is disabled, which is the default (on #2344 the caching of clut copies and palette textures was done only when 8-bit texture was enabled).
Brings moderate speedups ~10% in the most concitated parts of the ZoE2 Anubis benchmark, but may improve performance in all the cases when there are many Source objects created with clut copies to be stored.
The quality of the comments has been improved to better highlight the mechanics of the caching system.
Removed crc id 0x7D4EA48F and mentions of that id and it's duplicates. The id is from a multiloader when packing images, and not an actual crc id from a game(s).
This follows the 4th point of #2310.
The idea was to rework the current palette texture management to improve performances with games that uses multiple palettes for the same data texture.
The new management shows small to none performances improvement in almost every game in terms of FPS, and it lowers the GPU BUS usage by some percentage points in games like Baldur's Gate: Dark Alliance (9% to 7%) which uses many palettes.
The hot topic is that the performances in Zone Of The Enders 2 skyrocketed (2x), because of the fact that the game uses many palettes and a small number of textures to render it's effects.
For more detailed information check the PR #2344
Some users get confused and change the setting to a recommended option.
This can cause some issues when switching different hw render types.
Most of the time users shouldn't change the option and leave it on
Automatic.
Also remove ICO from crc Aggressive tooltip.
Only impacts custom resolution, there used to be a much weaker algorithm
which doens't consider scissor sizes and gives a minor performance boost
in costs of accuracy (which was used when large framebuffer was disabled
in custom resolutions)
I've removed this as the performance tradeoff is rather negligible after
the implementation of #1942 and the older one is no longer necessary.
Also added an extra parameter for considering the horizontal scissor,
I'm not sure where this might be useful so this is disabled in code for
now till I discover a testcase where this helps or run it on random data
ensuring it's working properly.
Also porting this to the general scaling function might help with memory
spikes which are experienced when large framebuffer is enabled.
We can't do a full port because channel shuffle and depth sampling need
to be ported to d3d but at the very least we can do a partial port that
skips the bad draw calls.
This way we can remove all the remaining crc hacks for ICO in GSHwHacks.
This should make things a bit easier for users when picking resolutions.
Native (PS2)
2x Native (~720p)
3x Native (~1080p)
4x Native (~1440p 2K)
5x Native (~1620p 3K)
6x Native (~2160p 4K)
8x Native (~2880p 5K)
Custom (Not Recommended)
Change the code so that some crc hacks on some games that remove
ghosting/blur issues on upscaled resolutions are disabled on native
resolution if crc hack level is below Aggressive state (most of the time).
They aren't needed then so why don't we aim for better accuracy.
Follow up from #2586 which ensures that MAC address is unique on Xlink Kai when using Windows.
Previous build was returning last two bytes as 00:00 rather than last two bytes of host adapter's MAC.