Commit Graph

234 Commits

Author SHA1 Message Date
lightningterror 8219bcd1b4 gsdx-hw: Move GSC_YakuzaGames to partial level.
Don't enable hack on native res if crc is below aggressive. Upscaling
issues.

Bonus, revert recent barrier changes on gl date code.
2019-03-05 12:39:07 +01:00
lightningterror e36976bf86 gsdx-d3d11: Minor adjustments to DATE code.
Run fast accurate date instead of alpha stencil when accurate date is
enabled on supported calls, also update some logs and comments.
2019-03-04 20:35:09 +01:00
lightningterror e48ce1bc69 gsdx-ogl: Minor adjustments to DATE code.
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.
2019-03-04 19:39:58 +01:00
lightningterror 425059d882 gsdx: Forgot to move the crc state for mgs3 and ace combat 4.
crc hacks are aggressive only. Fixes regressions mentioned in
https://forums.pcsx2.net/Thread-Metal-Gear-Solid-3-OpenGL-Issue-with-Latest-Builds
2019-03-01 08:37:04 +01:00
lightningterror 8a9abd8a1b gsdx: Purge depth crc hack for GSC_RadiataStories.
Effects rendered correctly, blur/ghosting upscaling issues can be
resolved with HPO special.
2019-02-25 11:35:27 +01:00
lightningterror 79a38858d1 gsdx: Purge GSC_CrashNburn crc hacks.
Depth, texture shuffle rendered correctly.
@MrCK1 did the tests. PAL needs to be tested as well.
2019-02-24 22:12:27 +01:00
lightningterror 8e8598412d gsdx: Purge all crc hacks for GSC_OnePieceGrandAdventure and GSC_OnePieceGrandBattle.
Texture shuffle and hdr colclip.
Effects rendered correctly.
2019-02-23 06:52:40 +01:00
lightningterror 930f07df4a gsdx: Purge depth crc hack for Haunting Ground.
Effects rendered correctly on all renderers.
2019-02-22 17:18:58 +01:00
Gregory Hainaut e56f75fe9a gsdx hw:move vertices fixup for texture shuffle in RendererHw
Bonus: fix m_vt value
2019-02-22 16:57:59 +01:00
lightningterror e55fcae981 gsdx d3d11: re-normalize coordinate when TEX0 is invalid. 2019-02-20 13:49:57 +01:00
Gregory Hainaut 29aef04fbf gsdx ogl: re-normalize coordinate when TEX0 is invalid
Fix #258
Fix #695
2019-02-20 13:49:57 +01:00
Gregory Hainaut 12dcb701c7 gsdx: add a function to fix the TEX0 register value for HW renderer
Based on the SW renderer
2019-02-20 13:49:57 +01:00
lightningterror c6f57c0bdb gsdx: Save hotkey toggle to ini config.
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.
2019-02-20 11:07:02 +01:00
Gregory Hainaut 31d95448ed gsdx device: use same target for fxaa/shaderboost/shaderfx
It avoid to waste VRAM memory
2019-02-13 19:52:43 +01:00
Gregory Hainaut 45dfb0dcdb gsdx device: use generic resize texture function
V2: add missing size for merge and interlace
2019-02-13 19:52:43 +01:00
lightningterror 12b622c9c1 gsdx: Cleanup/update Wild Arms offset hack.
Don't use integer for the variable, option has only on and off states.
Use member variable names and adjust some checks.
2019-02-13 10:28:07 +01:00
lightningterror 19586fdd7f gsdx: Move GSTexturecache files from Common to HW renderer. 2019-02-11 18:18:02 +01:00
lightningterror ca002c56e5 GSdx: Adjust Burnout crc hacks to work on multiplayer mode as well.
Yellow stripes crc hack.
Note: Only Takedown was tested but other games should work as well.
2019-02-09 21:42:38 +01:00
lightningterror dabc99f466 gsdx-ogl: Small colclip improvements.
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
2019-02-08 14:53:15 +01:00
lightningterror a9e622357a gsdx-ogl: Fix override detection for extensions. 2019-02-07 18:38:40 +01:00
Gregory Hainaut 6282c3d263 gsdx ogl: remove boilerplate of extension check
* 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
2019-02-07 12:34:02 +01:00
Gregory Hainaut 86a10969f3 gsdx ogl: load GL_EXT_direct_state_access for sparse texture
They forgot to add is to the ARB extension...
2019-02-07 12:34:02 +01:00
Gregory Hainaut 2ea47a1d96 gsdx-ogl: add sparse format detection
v2: fix wrong variable name
2019-02-07 12:34:02 +01:00
Gregory Hainaut fa7ffcd1bf gsdx-ogl: use a print_once macro 2019-02-07 12:34:02 +01:00
Gregory Hainaut 0e4c63db5d gsdx-ogl: add extensions check that might be useful in the future
Namely
* GL_ARB_multi_bind
* GL_ARB_vertex_attrib_binding
* GL_ARB_shader_storage_buffer_object
* GL_ARB_sparse_texture
* GL_ARB_sparse_texture2
* GL_ARB_compute_shader
* GL_ARB_texture_view

v2: add default option value
2019-02-07 12:34:02 +01:00
Gregory Hainaut aed7ccaadf gsdx ogl: use a set to store the supported extension
Split mandatory/optional extensions

Note: set is nice but likely much slower than reading a boolean
So both are kept
2019-02-07 12:34:02 +01:00
Gregory Hainaut e6b0a7828e gsdx-ogl: add a separate glext.h file
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
2019-02-07 12:34:02 +01:00
Gregory Hainaut 8cd6f4375e gsdx-ogl: use only core debug extension
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.
2019-02-07 12:34:02 +01:00
Gregory Hainaut cd333c2c94 gsdx-ogl: add missing define of glcorearb.h
Migration isn't expected soon but it should ease the process
2019-02-07 12:34:02 +01:00
Gregory Hainaut 8a723b3be8 gsdx-ogl: clean partially the GL1 mess
Remaining will require a move to glcorearb.h
2019-02-07 12:34:02 +01:00
Gregory Hainaut 4f09124f19 gsdx-ogl: generate nearly all gl entries function pointers
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
2019-02-07 12:34:02 +01:00
Gregory Hainaut dbffad2aef gsdx hw: use non virtual Create Texture function.
Just do the format check in FetchSurface. It removes a level of virtual function
and avoid useless code duplication.
2019-02-02 22:54:30 +01:00
lightningterror f02c683178 gsdx: Merge Sly 2 and 3 crc hacks.
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.
2019-01-28 21:58:30 +01:00
lightningterror ee7749452d gsdx-d3d11: Remove unused function OMSetRenderTargets with UnorderedAccessView.
Note ID3D11UnorderedAccessView parameters are also unused but could be
useful for future DATE ports.
2019-01-28 21:01:22 +01:00
lightningterror 4c477d3cd6 gsdx-debug: Disable Alpha Test debug logs on d3d11.
Unfortunately they do more harm than help, slowing things quite a lot
because of the endless log spam when debugging gs dumps.
2019-01-28 20:38:11 +01:00
Kojin af64865c5d gsdx-d3d11: Framebuffer copy improvements
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
2019-01-27 16:40:39 +01:00
lightningterror ece7d6e718 gsdx-ogl: Update intel bad driver log.
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.
2019-01-27 00:12:08 +01:00
lightningterror d4833a4618 gsdx-d3d11: Add final specifier to some voids. 2019-01-26 16:13:07 +01:00
lightningterror 744fa18d95 gsdx-d3d11: Merge/move GSDeviceDX code to GSDevice11.
Update VS and cmake project files, remove GSDeviceDX files.
2019-01-26 16:13:07 +01:00
lightningterror 19b97f8684 gsdx-ogl: Remove useless SetupIA from GSDeviceOGL.h not used. 2019-01-26 16:13:07 +01:00
lightningterror 2e2c9b14a4 gsdx-ogl: Enable anisotropic filtering only for triangles.
Sprites are flat so aniso is likely useless (it would save perf for
others primitives).

Idea by Gregory.
2019-01-26 14:52:30 +01:00
lightningterror 7b4133ac08 GSdx-d3d11: Add final to Renderer class and DrawPrims, also change some voids to inline. 2019-01-24 20:30:48 +01:00
lightningterror 78f0b65e19 GSdx-d3d11: Merge GSRendererDX11 and GSRendererDX together.
Update VS and cmake project files to match new changes.
2019-01-24 20:30:48 +01:00
lightningterror b9df1e643b gsdx-hw: Adjust/cleanup hw hacks variable calls.
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.
2019-01-23 12:24:12 +01:00
lightningterror 2aadf0be89 GSdx: Adjust Scaling Factor.
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.
2019-01-22 23:25:01 +01:00
Kojin 8c8b1f497c gsdx-d3d11: ICO depth HLE
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
2019-01-22 06:52:24 +01:00
Kojin 468b9ded46 gsdx-d3d11: Update texture copy method to handle depth
- Rename CopyRenderTarget to CloneTexture
- Allow copy of depth target

Also fix a small oversight from the removal of MSAA.
2019-01-22 06:52:24 +01:00
Kojin 57824261c6 gsdx-d3d11: Cache rt depth stencil on m_state
Cache the depth stencil in addition to color rt.
This will allow us to check for depth stencil equality on slot 4.
2019-01-22 06:52:24 +01:00
lightningterror 946e6046b3 gsdx: Adjust some crc hack comments for some games.
Maybe in the future I'll add github issue links to corresponding crc
hacks.
2019-01-21 19:38:20 +01:00
lightningterror 548d6b31bf Gsdx: Purge GSC_RedDeadRevolver crc hacks.
Blurring with a bit of ghosting is intended and it looks like that on
the console as well.

Depth properly emulated.

D3D11 misses blending.
2019-01-20 19:49:36 +01:00
lightningterror 4ecbb750a8 GSdx: Purge GSC_BlackHawkDown crc hacks.
Channel and texture shuffle emulated correctly.
2019-01-20 00:05:18 +01:00
lightningterror b4cb805a91 gsdx-tc: Remove CanConvertDepth virtual bool and use m_can_convert_depth for depth toggling. 2019-01-18 14:53:06 +01:00
lightningterror bbd8cbbcf4 GSdx: Move GSC_DeathByDegreesTekkenNinaWilliams to partial crc level.
Upscaling issues + unsupported texture shuffle.
Hacks might need to be updated.
2019-01-18 13:17:28 +01:00
lightningterror 0c3a0da58f GSdx: Purge GSC_LegoBatman crc hacks.
Effects emulated correctly with texture shuffle and depth.

Game has upscaling issues which can be fixed with TC offsets.
2019-01-17 09:58:59 +01:00
lightningterror 51fe6c20ca GSdx: Adjust dbz bt glow/blur crc hack.
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.
2019-01-17 07:45:35 +01:00
Kojin e429677a07 gsdx-hw: Completely remove MSAA from renderer code. 2019-01-15 19:13:14 +01:00
lightningterror ee4d295667 GSdx-d3d11: Remove afix factor from 24bit format. 2019-01-14 16:52:19 +01:00
lightningterror e05b5d2420 GSdx-d3d: Move channel and texture shuffle in GSRendererDX.
Preparations for file merge.
2019-01-14 02:30:25 +01:00
lightningterror 106c678cc1 GSdx: Purge GSC_EternalPoison crc hacks.
Shadows are better rendered now with hdr colclip, blending is still
needed but the shadow's shape is proper now so let's purge the hack.
2019-01-13 17:33:08 +01:00
lightningterror 52bad3505c GSdx: Adjust GSC_GodOfWar 1 and 2 crc hacks a bit more.
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.
2019-01-13 16:26:09 +01:00
lightningterror f5b9965910 GSdx: Purge OI_GodOfWar2 hw hack. 2019-01-13 15:08:36 +01:00
lightningterror 6f01936943 GSdx: Remove depth crc hacks for god of war 1 and 2.
Effects rendered correctly with depth on all renderers.
2019-01-13 14:42:53 +01:00
lightningterror 9119e3110d GSdx-ogl: Correct DATE log. 2019-01-12 16:43:26 +01:00
lightningterror f73de4c59c GSdx-ogl: Add perf log for Slow DATE code on texture shuffle/no prim overlap. 2019-01-12 09:59:28 +01:00
lightningterror 7e6c325210 GSdx: Move BoundingBox to HW render and update d3d11 code to use the gl bounding box as well.
hdr colclip and date uses it.
2019-01-12 09:53:51 +01:00
lightningterror d17e0eba9b GSdx-d3d11: Add/port HDR colclip support.
It helps render shadows a lot better compared to the old code.

Credits to Gregory and Kojin for helping with the code.
2019-01-12 09:53:51 +01:00
lightningterror 8a57d7f470 GSdx-d3d11: Remove colclip and negative blend algo.
Code was old and inefficient. HDR colclip will do a better job.
2019-01-12 09:53:51 +01:00
lightningterror f2f66c02d3 GSdx: Add option to Disable Safe Features.
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.
2019-01-09 15:44:41 +01:00
lightningterror 54f8aca7d5 GSdx-d3d11: Re enable shader code logging.
Log was disabled in #2760
2019-01-04 01:00:10 +01:00
Kojin eddaf71d47 gsdx: remove dds parameter from texture save method 2018-12-30 20:13:59 +01:00
Kojin e847d94062 gsdx-d3d11: enable splitting of alpha in dumps 2018-12-30 20:13:59 +01:00
lightningterror 781323ff10 GSdx: Purge a crc hacks for GSC_Onimusha3.
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.
2018-12-29 01:35:44 +01:00
lightningterror 01c64f1b35 GSdx: Purge some crc hacks for GSC_BurnoutGames.
Purge hacks that removed texture shuffle effects only.
2018-12-28 20:21:02 +01:00
lightningterror 7577165a97 GSdx: Adjust Aggressive state crc level.
Create a Aggressive state function instead of adjusting the hacks
separate, move the aggressive only there.
It's more efficient this way.
2018-12-28 20:03:38 +01:00
lightningterror d1c8808797 GSdx-d3d: Add texture shuffle check in DATE selection.
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.
2018-12-26 18:45:11 +01:00
lightningterror a020c98421 GSdx: Cleanup file includes.
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
2018-12-25 20:12:29 +01:00
Kojin a5564896ea gsdx-d3d11: remove useless gs creation method 2018-12-25 13:38:19 +01:00
Kojin e0c598f38e gsdx-d3d11: Enable HLSL debugging on development builds
Enable HLSL compile flags that allow devs to use tools such as NSight or VS Graphics debugging for HLSL.
2018-12-25 13:38:19 +01:00
lightningterror 29941f3e0d GSdx: Partially re add Bully crc hack.
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.
2018-12-24 15:25:06 +01:00
lightningterror e299ac1ffa GSdx: Update GSC_DBZBT2, GSC_DBZBT3 crc hacks.
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.
2018-12-23 18:48:17 +01:00
lightningterror 59ecfb23d7 GSdx: Purge GSC_Bully, GSC_BullyCC crc hacks. It's the same game.
Depth and texture shuffle render the effects correctly.

Dump shows the game look splending compared to before on d3d11.
2018-12-23 17:55:27 +01:00
lightningterror 154dea1557 GSdx: Purge OI_SMTNocturne hw hack.
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.
2018-12-23 17:12:10 +01:00
lightningterror da76440c14 GSdx-TC: Get rid of nasty ZWriteMustNotClear hack.
d3d11 supports depth now.
2018-12-23 16:03:28 +01:00
Kojin dc2eed6ca1 gsdx-d3d11: Fix CopyOffscreen bug
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.
2018-12-23 15:20:04 +01:00
lightningterror f6df6b350b GSdx-d3d: Disable MSAA unti it's properly fixed.
MSAA causes a lot of graphical issues when enabled with the recent
accuracy changes so better disable the feature until it's properly
fixed.
2018-12-23 14:21:44 +01:00
lightningterror 1ae4b5d0ba GSdx-d3d: update blend table to use src1 blending and remove the nasty hack which we couldn't before because of d3d9. 2018-12-22 22:53:09 +01:00
Kojin 5e9ffc4a94 GSdx-d3d: Adjust D3D11Blend, get rid of some casts. 2018-12-22 22:53:09 +01:00
lightningterror bf4997b6a5 GSdx: Update/remove useless d3d9 comments. 2018-12-22 22:53:09 +01:00
lightningterror 48007350b6 GSdx-ogl: Update blend table and remove d3d9 code, remove useless defines and directly use gl code. 2018-12-22 22:53:09 +01:00
lightningterror 4644a16c5b GSdx-d3d: Update blend table enums from D3D9 to D3D11.
GSDeviceDX.
2018-12-22 22:53:09 +01:00
lightningterror 7e8360efbc GSdx-d3d: Rename d3d9 blendtable and variables to d3d11. 2018-12-22 22:53:09 +01:00
lightningterror e12447101f GSdx: Get rid of d3d9 adapter code from GSSettingsdlg and GSDevice. 2018-12-22 22:53:09 +01:00
Kojin a2f3b78bac gsdx-d3d11: Fix Depth FST
Texture scaling for x/y values wasn't being set in all cases.
This ensures that it is to fix a bug in finding nemo (and possibly others).
2018-12-22 15:53:20 +01:00
lightningterror 1957cf13c2 GSdx: Purge GSC_Black crc hacks.
Effects are rendered correctly with depth and texture shuffle on all
renders.
2018-12-21 07:32:20 +01:00
lightningterror eb000f0f41 GSdx: Move GSC_GTASanAndreas crc hack to aggressive state.
Can be used as an upscaling hack, but it removes some nice effect so
Aggressive only.
2018-12-21 05:03:45 +01:00
lightningterror f41b536682 GSdx: Adjust GSC_DemonStone crc hack.
Move back to partial level, half screen issue.
2018-12-21 02:28:59 +01:00
lightningterror 11f09d4944 GSdx: Purge GSC_SuikodenTactics crc hacks.
Depth effects are rendered properly on all renders.
2018-12-21 01:06:47 +01:00
lightningterror c23d256f02 GSdx: Purge GSC_LordOfTheRingsTwoTowers crc hacks.
Depth effects properly rendered on all renders.
2018-12-20 23:11:42 +01:00
lightningterror 526faf9193 GSdx: Move GSC_MetalGearSolid3 to Aggressive crc state.
Half screen bottom issue, hack needs to be updated to skip less effects.
2018-12-20 22:13:39 +01:00
lightningterror 0901f0a848 GSdx: Remove some crc hacks for GSC_IkkiTousen.
Remove depth hacks that skipped shadow rendering, shadows work properly
on all renders.

Upscaling hack needs to be further tested.
2018-12-20 18:31:53 +01:00