Commit Graph

2941 Commits

Author SHA1 Message Date
lightningterror 014e27bc20 GSdx: Add Quak3 Revolution to Automatic mipmapping. 2018-03-27 15:11:08 +02:00
lightningterror 312db7755b GSdx: Adjust CRC hacks.
Move CRC hack that removed shadows to Aggressive, shadows are misaligned
when upscaling - can be fixed with HPO. We can use the hack as a
speedhack for Aggressive state.

Add correct FBP code for Sly 2 E3 Demo. CRC hack should work properly now.

Purge God of War 1/2 CRC hacks that fixed/removed the vertical red lines.
No longer needed since the issue is fixed accross all renders.
Also useless to be kept for speedhacks.
2018-03-27 15:11:08 +02:00
lightningterror 9769f19ebe GSdx: Remove fbmask handle in GSRendererDX.
It's already handled in texture shuffle code.
2018-03-27 15:11:08 +02:00
lightningterror 0e83b89dbd GSdx-D3D: Texture and channel shuffle improvements.
Texture Shuffle changes:
Always Enable Texture shuffle on D3D10/11.
Previously Texture shuffle was enabled if CRC hack
level was below Full, this was kinda not good since
D3D also relies on CRC hacks on Full so you could either
stick with texture shuffle or crc hacks.

Texture shuffle is not supported on D3D9, however we can do a partial
port where instead of vertical lines with the effect we get the effect
on the entire screen. Better than nothing I suppose.

Ported some of the code from OpenGL to D3D
( just a copy - paste job :) ),
part of the code misses a dedicated shader but we can still
use it to fix various issues on many games.

List of affected games tested so far:
The Godfather, Final Fight Streetwise, The Suffering Ties that Bind,
Urban Chaos have their vertical lines issues fixed
(highly possible for other games as well), MGS and Stolen see an improvement
but they are still broken without crc hacks. Other games that suffered
similar issues are probably affected as well.

Channel Shuffle changes:
Update Channel Shuffle detection. A lot of games should see an improvement,
MGS, Urban Chaos, Stolen have their top left corner issues resolved.
Other games should be affected as well that use similar logic.
They still miss a shader so some effects are still broken/show glitches
but it's a nice improvement for D3D users.

Shared changes:
Texture Shuffle and Channel shuffle have been moved to their
own dedicated functions. Should make things a bit cleaner.

Move part of the code for Texture Shuffle to GSRendererHW to be shared
across all HW renderers, should aboid copy paste/duplicate code.
2018-03-23 13:38:34 +01:00
lightningterror 2ad5db2279 GSdx Adjust/Replace crc hack for Final Fight Streetwise.
Replace/remove an old crc hack that was used to fix the red vertical
lines issue, the hack is no longer needed. The new hack removes depth
effects on D3D only.
Note: The game has another vertical lines issue that can be fixed with
texture shuffle on D3D.

Add comments to Simple2000Vol114 explaining what the hacks do.
2018-03-22 14:46:31 +01:00
lightningterror 99350d6caa GSdx: Add some missing crc ids.
Sly 2 E3 Demo US, Sly 2 JP.
2018-03-22 14:46:31 +01:00
Christian Kenny 40f7d6c95b GSdx: Add Shox to Automatic Mipmapping 2018-03-19 01:00:26 +05:30
lightningterror 6aaae6970e GSdx: Cleanup hacks in GSRendererHW.
Merge identical code for Spyro Games in to one to avoid duplicate code.

Rename hacks name for Jak series from OO_Jak to OO_JakGames since there
are multiple games added.
2018-03-13 18:56:30 +05:30
lightningterror f4fa115c82 GSdx: Remove GT3/Concept CRC Hacks.
This follows PR #2304.
The CRC hacks are no longer needed due to the partial port of channel
shuffle on D3D.
They cause higher vram spikes  now.
2018-03-13 18:56:30 +05:30
lightningterror bd0947e7a3 GSdx: Add/adjust CRC ids.
This follows PR #2330.

Add some missing regions: Tomb Raider Legend JP,
StarWars Force Unleashed EU, SuperMan Returns EU, Valkyrie Profile 2 FR.

Rename GT3/Concept titles, they were incorrect.

Adjust Harley Davidson region id from NoRegion to US.

Add some missing regions to automatic mipmapping:
FIFA 03 US, FIFA 04 EU, FIFA 05 EU.

Reformat a few comments.
2018-03-13 18:56:30 +05:30
lightningterror 73f1d7d099 GSdx: Rename HW hacks drop list options.
Add "Default" nametag for default list options for the hacks: Sprite,
Round Sprite, GL Advanced settings, HPO.

Should help users know which options are the default ones with less
confusion.
2018-03-04 20:54:10 +05:30
refractionpcsx2 084530eeca
Merge pull request #2122 from PCSX2/target_load
GSdx-TC: Fix load size calculation in target update Fixes #1972 Fixes #2110 Fixes #2138
2018-03-03 03:31:25 +00:00
Jonathan Li fb4f274882 gsdx: Remove inappropriate comment 2018-03-02 23:41:46 +00:00
lightningterror 38aa4e1745 GSdx: GSCrc.cpp reformat comments and whitespaces. 2018-03-02 10:10:31 +05:30
lightningterror 2be9cf060d GSdx: Add/adjust CRC ids.
Add CRC id for FFXII US, SFEX3 EU,
GT4 CH and GT4 Online Beta US.
Adjust BullyCC region from US to EU.

Add Missing regions for Ratchet & Clank,
Ace Combat, Destroy All Humans and Soul Reaver
series to Automatic Mipmapping.
2018-03-02 10:10:31 +05:30
Christian Kenny 10ebe16653 GSdx (OGL HW): Perform a texture shuffle when the address of the framebuffer and the texture are the same.
Tomb Raider: Angel of Darkness relies on this behavior to produce a distance fog effect.

Closes #2215
2018-02-22 00:20:54 +05:30
FlatOutPS2 c1fd01545a GSdx: Remove GT4/Tourist Trophy CRC hacks
Removes GT4/Tourist Trophy CRC hacks. The hack had already been moved to
aggressive due to VRAM spike issues, but is no longer necessary at all
due to the in-game brightness/contrast setting issue being moved to
behind the frame buffer conversion hack for Direct3D and being resolved for OpenGL.
2018-02-21 17:08:48 +05:30
lightningterror 768a4412d5 Gsdx: Adjust Ikkitousen CRC hacks.
Move hacks that disabled shadows to DX level since OpenGL renders
shadows properly with Depth Emulation.

Some other upscaling issues appear with the disabled hack like a small
black border on the bottom of the screen or some ui elements but those
can be fixed with TC X,Y Offset hack.
2018-02-21 17:06:16 +05:30
Akash b10c357065 GSdx-TC: Fix load size calculation in target update
Previously, the calculation for the size of data to be loaded was done
based on the rendering target buffer size and scaling multiplier, which
was totally wrong. This led to different resolutions having different
load sizes while the size of the real GS memory is common regardless of
the scaling variancies.

Hence use the default rendering target buffer size for the load size
independent of the scaling values. I've also removed a buffer height saturation
code which seemed unreliable.

Note: The accurate version of the code can be enabled using the macro
provided in config.h (which is more intensive on resources), the current
code goes along with the approach of maintaining a decent performance
level along with a formidable accuracy.
2018-02-06 18:00:22 +05:30
Jonathan Li f64488f818 gsdx:d3d: Fix fbmask conversion on texture shuffle
Port of 6580f4922f.
2018-02-06 00:03:25 +00:00
lightningterror 85c59fdb5e GSdx: Adjust DBZ BT2 CRC hack and id, add R&C3 EU to Automatic Mipmap.
Adjust region id for BT2.
Move the sky texture(depth) hack back to Partial level only for the EU
regions.  Effect is still not rendered correctly and causes a half
screen bottom issue.

Add R&C3 EU to Automatic Mipmapping.
2018-02-05 23:03:19 +00:00
lightningterror 86a8cbf402 GSdx: Change Skipdraw Maximum limit value.
Previously the limit was 1000, now 10000 in the GUI. It should help in
some rare cases where a higher number is needed without the need of ini
editing and value reset issues caused by the GUI.
2018-02-05 23:03:19 +00:00
lightningterror 4aa25c4971 GSdx: Disable Merge Sprite on native resolution.
Previously if HW hacks were enabled Merge Sprite was active(if checked) on
native resolution even if the GUI option was disabled, which in result
caused glitches in games on native resolution.

This should address that issue.
2018-01-13 23:18:57 +05:30
FlatOutPS2 fe27d3b25a GSdx: Add Dark Cloud CRCs to automatic mipmapping 2018-01-12 13:28:43 +05:30
lightningterror 9dc7930ff2 GSdx: Merge CRC hacks of Wild Arms 4 and 5
It's better to avoid duplicate code so let's merge these two together
as well.
2018-01-12 13:25:40 +05:30
lightningterror fbdd0f4394 GSdx: Remove/move/merge CRC hacks.
Remove Aggressive CRC hacks for SSX 3. Was used to remove the red lines
on older versions but no longer needed since the issue has been fixed.
Offered 1fps or less speed bump but it's not worth keeping for such a
minimal increase.

Merge all FFX CRC hacks in to one. They share the same code so it's
better to have one to avoid duplicate code.

Move CRC hack for Bleach Blade Battlers to Aggressive. It removes the
character shading. It can be used as a speed hack since the gains are
quite good from it. Around 15-30%.
2018-01-10 08:10:56 +05:30
lightningterror 29ef586f91 GSdx: Move CRC hacks for Soul Calibur 2&3 to DX level.
Add missing CRC ids for Soul Calibur 2 and 3.
Move CRC hacks to DX level. They are not needed anymore on OpenGL since
Depth Emulation fixes depth issues (shadows).
2018-01-09 20:36:14 +05:30
lightningterror 687c0b45e2 Gsdx: Tekken 5 Channel effect and CRC Hacks
Move CRC hack to Partial that fix the half screen
bottom issue since the effect is not rendered correctly.

Move CRC hack to Aggressive. These hacks are only
needed when running upscaled resolution. They skip the
blur effect which cause ghosting and some other screen issues.
Side effect is they also remove the channel effect on OpenGL
which is emulated correctly so let's put them on Aggressive.

Comment out a hack, it's unknown what the hack does atm.
If there are new issues then it will be added back.

Added comments what the hacks do.

Partial port for channel shuffle effect to Direct3D for Tekken5.
The effect is skipped and not rendered but now the top left
screen glitch has been resolved.
Note: At least Minimum CRC level is required for this to work.
2017-12-13 13:31:49 +01:00
lightningterror 41051f3cfe GSdx: Add hidden option to disable Nvidia hack
Add hidden option "UserHacks_DisableNVhack" to disable
the Nvidia hack on Direct3D which added black lines on the right
and bottom of the screen. Could be useful for Intel and AMD GPUs.

A better solution would be to add Vendor Id detection instead,
but this will do for now.

To disable the Nvidia hack add UserHacks_DisableNVhack=1 in GSdx.ini
2017-12-10 21:37:00 +05:30
lightningterror a74a5d95ab GSdx: Remove/move CRC hacks for Simpsons Game
Remove CRC hacks no longer needed.
Move CRC hacks to Aggressive level. Can be used as a performance hack.
2017-11-28 16:59:13 +05:30
lightningterror 3c74f0f907 GSdx: Extend support of "Preload Frame Data" for Direct3D.
Fixes glitchy water in Rogue Galaxy in Direct3D when the hack is
enabled.
Fixes Test Drive car reflection in Direct3D when the hack is enabled.

OTher games are affected as well.
2017-11-27 11:01:43 +01:00
lightningterror 6d49bf6fc6 GSdx: Automatic HW Mipmapping option
Adds automatic HW mipmapping support.
It relies on CRC ids so if a game does
not have their CRC id but needs mipmapping
it will not work until the id is added.

Add GUI menu and tooltip for Automatic mipmap
"Automatic (Default)"
This option will be default option from now on.

Rename "Very Slow" text option to "Slow" for full mipmap
as it caused the text not to fit properly in the menu.

Credits also go to @RedPanda4552 and @ssakash for helping
with the code.
2017-11-20 09:54:56 +01:00
lightningterror 431b4f6f17 GSdx: Rearrange HW Hacks
Rearrange the two columns of HW hacks, new arrangement
is done in alphabetical order on Windows and Linux.

Rename some hacks on Linux to match the windows version.

Some other minor tweaks as well.
2017-11-20 09:54:32 +01:00
Christian Kenny 5956493684 GSdx: Remove CRC hack for James Bond Everything or Nothing. Thes hack was used to avoid a VRAM spike, but isn't needed anymore. 2017-11-19 12:58:48 +05:30
lightningterror b31c23b37b GSdx: Add/move CRC hacks for Street Fighter EX3
Add missing CRC ids.
Move CRC hacks to OpenGL since the effects aren't emulated properly atm.
2017-11-13 16:04:42 +05:30
Akash 6299d9efa9 GSdx-Capture: Grayout configure button for codecs
The following patch grays out the configure button when there's no
configuration dialog available for the selected codec. What's the use in
clicking it when no dialog pops up? :P (I've been tricked by it lots of
times)
2017-11-11 12:50:22 +05:30
Akash 849c2f36d9 GSdx-Capture: Format event commands in switch-case
Use switch-case over chained if statements for the event commands, makes
the code more readable in my opinion.
2017-11-11 12:50:22 +05:30
lightningterror 1cbd4c5387 GSdx: Add CPU Frame buffer Conversion Hack
Add HW Hack that enables Framebuffer Conversion on the CPU instead of the GPU.
Can fix broken textures on games but at the cost of slower performance.
List of games: Harry Potter games, FIFA Street games.
Games like Call of Duty, Kung fu Panda might also be affected as well as others
especially on Direct3D.
Add HW Hack GUI option on Windows/Linux for 4-bit and 8-bit Framebuffer conversion hack
named "Frame Buffer Conversion".
2017-11-02 10:38:07 +01:00
Jonathan Li fe2dfdb3b9 gsdx: Remove "using namespace std" 2017-09-08 09:56:28 +02:00
Jonathan Li 82d1aba67f gsdx: Prefix std:: to ostringstream, pair, codecvt* 2017-09-08 09:56:28 +02:00
Jonathan Li 7ed360e06b gsdx: Prefix std:: to shared_ptr 2017-09-08 09:56:28 +02:00
Jonathan Li 0cde534e30 gsdx: Prefix std:: to min and max 2017-09-08 09:56:28 +02:00
Jonathan Li 54c320c724 gdsx: Prefix std:: to map
Also use auto when appropriate.
2017-09-08 09:56:28 +02:00
Jonathan Li 2ff67f3741 gsdx: Prefix std:: to list
Also use auto when appropriate
2017-09-08 09:56:28 +02:00
Jonathan Li 5415b7ad5b gsdx: Prefix std:: to vector
Also use auto when appropriate
2017-09-08 09:56:28 +02:00
Jonathan Li 2aeb406e38 gsdx: Remove hash_{map,set} macros
Also use auto when appropriate.
2017-09-08 09:56:28 +02:00
Jonathan Li d57b812f36 gsdx: Prefix std:: to string and to_string 2017-09-08 09:56:28 +02:00
lightningterror d158ac5ffe GSdx-ogl:
Comment out driver version detection on amd as it was not working properly.
Rename bools for vendor ids.
2017-09-06 18:08:37 +02:00
lightningterror 481a884d25 GSdx - dx9: Edit Alpha Correction (FBA) tooltip.
Can cause graphical glitches in some games.
2017-09-06 18:05:21 +02:00
lightningterror f14c78cf12 GSdx-ogl: Fix GSdx crashing on Intel igpus
Regression was introduced in #1954
GSdx caused the emulator to crash when the renderer was restarted.

It may have affected older gpus from nvidia/amd
with older OpenGL support as well.
2017-09-06 17:14:21 +02:00
lightningterror 91d8e7c7c6 GSdx-Windows: Grey out OSD and Shader Configuration
Grey out OSD Configuration button for Direct3D
since only OpenGL supports the feature atm.
Grey out Shader Configuration button in Core Benchmark.
2017-08-31 21:11:43 +05:30
Jonathan Li fecf8e3ed2 gsdx:ogl: Call swap interval function on rendering thread
The swap interval function must be called on the same thread that
rendering takes place on. This fixes an issue where the turbo speed and
frame limiter hotkeys fail to disable vsync when the OpenGL renderer is
used.
2017-08-30 21:08:54 +01:00
Alessandro Vetere a0aa585afd GSdx GSTextureCache: Using FastList instead of std::list. Various other improvements.
Using range loops where possible (correctly).
Using auto where possible (minimize code changes whenever it's decided to change back to a std container).
Use more efficient erase pattern (where possible).
Minor code tweaks.
2017-08-30 11:43:18 +02:00
Alessandro Vetere b2508dcb59 GSdx GSDevice: Using FastList instead of std::list. Using range loops (correctly). Using auto instead of declaring iterator type. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 965334350f GSdx GSTextureCacheSW: Ported erase iterator trick. Using FastList instead of std::list. Using range loops. Using more efficient erase pattern. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 676c7b89c7 GSdx GSFastList: Introducing the custom container template class. 2017-08-30 11:43:18 +02:00
Alessandro Vetere b431d172b7 GSdx GSDirtyRect: std::vector instead of std::list, to speedup linear scan. Improved const-ness. Using range loop. 2017-08-30 11:43:18 +02:00
Alessandro Vetere f8e89b694a GSdx GSLocalMemory: Reserve space required in the std::vector before adding elements to it. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 3300470a29 GSdx GSCodeBuffer: std::vector instead of std::list, to speedup linear scan. Using range loop on destruction. 2017-08-30 11:43:18 +02:00
Alessandro Vetere 798d6a9134 GSdx GSDevice11: Fix unsigned warning under VS2015 with DEBUG build enabled. 2017-08-30 11:43:18 +02:00
Akash 8fe8cad8f9 GSdx-D3D11: Avoid undefined behavior in swapchain
PCSX2 sends a negative value (-1) to GSdx when adaptive mode is
specified for Vsync, this mode is exclusive to OpenGL at the moment
and is unimplemented on the D3D11 renderer. Also the present function
of swapchain only accepts values from 0 to 4 as parameter, hence
passing negative values to the function is undefined behavior.

So let's fallback to standard synchronization method on D3D11 when
PCSX2 requests for adaptive mode.
2017-08-25 22:40:42 +01:00
lightningterror 420f111611 GSdx: Add missing CRC for GT3 2017-08-16 17:35:32 +05:30
Gregory Hainaut c4bf09ad32 glsl: extension must be declared first
Mesa follows this rule of the standard.

Issue #2037

Shader compile fines now but SSO interface seems to be broken.
2017-08-12 15:37:29 +02:00
Gregory Hainaut 17d2d9217b gsdx ogl: test adaptive/late vsync driver support
Supported on GLX (but not Linux free driver) and WGL
2017-08-05 11:00:39 +02:00
Gregory Hainaut 2e4643a398 gsdx ogl: factorize SetVSync
Move common logic into base class
Add API to handle late Vsync (only stub)
2017-08-05 10:59:48 +02:00
Gregory Hainaut 2204885fbb gsdx ogl: factorize common context init code 2017-08-05 10:56:54 +02:00
lightningterror 66a87ce4d0 GSdx: Add missing CRC for Tomb Raider Underworld 2017-07-29 20:10:46 +05:30
Akash 31400b29c3 Merge pull request #2017 from lightningterror/dbzbt3-crcfixup
GSdx: Adjust CRC hack for DBZ BT3
2017-07-27 00:23:25 +05:30
lightningterror f5b4ccf741 GSdx: Adjust CRC for DBZ BT3
Fix CRC hacks on PAL version.
PAL version will no longer experience very high brightness/contrast
issues on stages in hw mode caused by an incorrect CRC hack.
Moved a CRC hack back to OpenGL mode only for the PAL version
because texture shuffling does not work properly on PAL games.
2017-07-26 20:19:44 +02:00
Akash bd5e54e825 GSdx-Windows: Fix Shadeboost text bug
Forgot to replace `IDC_TEXT` with `IDC_VALUE` macros, due to this the
text containing the name of the options was being updated with the
current value of the option instead of updating the text designated for
holding the values.
2017-07-23 22:50:40 +01:00
puzzo888 1d983a6818 Update GSCrc.cpp (#2018)
gsdx crc: add Front Mission 5 CRC
2017-07-22 11:32:15 +02:00
Akash c3ff1074bb GSdx: Rework framebuffer height calculation
DBY isn't an offset to the frame memory but rather an offset to read
output circuit inside the frame memory, hence the top offset should also
be calculated for the total height of the frame memory. Fixes software
mode regression in Beyond Good and Evil.

Also handle cases when GetFrameRect() is called without any paramerer to
avoid an illegal value access violation on the DISP register.
2017-07-13 17:53:29 +02:00
Gregory Hainaut c5d35d434c glsl: reduce geometry shader complexity
output 1 strip of 2 triangles instead of 2 strips of 1 triangle.

Potentially it would reduce the geometry shader overhead. And it
might avoid a middle line in sprite in some AMD GPU/driver/OS
bad combination
2017-07-12 22:04:03 +02:00
Gregory Hainaut 38010432ee gsdx ogl: handle float integral coordinate for depth sampling
Fix depth effect regression on Nemo (issue #1979)
2017-07-12 22:03:47 +02:00
Jonathan Li 45ac69a1f6 gsdx:d3d11: Fix sprite geometry shader
Sprites always use flat shading.

Fixes #1980
2017-07-02 22:54:36 +01:00
Gregory Hainaut 392816fae3 gsdx: store vsync state into an integer
allow to support late vsync (Adaptive vsync).
2017-07-02 15:14:45 +02:00
Gregory Hainaut 36fd2b6854 gsdx: remove the unused GSsetFrameLimit API 2017-07-02 15:09:47 +02:00
lightningterror 358954d69e GSdx-ogl: Printing console messages v2 (#1954)
GSdx-ogl: Console messages v2

Follow up to
commit/ec63b04719fd9c05a6aeeacb55dc1c54f5ef145b

Add intel broken driver wiki link message in console (OpenGL).
Print intel / amd buggy driver message once in console (OpenGL).
Pring texture barrier and viewpoint array info once in console (OpenGL).
2017-07-02 13:56:45 +02:00
lightningterror f88972013f GSdx: Remove/move DBZ:BT3 CRC
Enables character outlines to partially work on Full CRC.
DX9 has a small issue where a small black line at the bottom shakes when outlines are enabled.
You can either use Aggressive crc or x,y offset to fix the issue.

Removed unnecessary crc hack that caused shadows on stationary objects (trees) to move on Direct3D in a weird
motion blur type way when the player moved slightly.
2017-06-29 16:54:11 +02:00
Akash f2de553d63 GSdx: Cleanup warnings on MSVC
* Cast return value of IsEof() to bool. (Avoids int -> bool performance
warning error)
* Cast field and index to the required parameter type of AppendRawData.
2017-06-29 16:48:50 +02:00
Gregory Hainaut 7d75a73105 cmake: blacklist GCC 7.0 and GCC 7.1 (based on a small testcase)
GCC bug => https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80799

Close #1937
2017-06-29 14:51:50 +02:00
Jonathan Li 4a562401dc gsdx:d3d11: Fix incorrect geometry shader use
The sprite geometry shader was still being used even if the sprites were
converted on the CPUs.

Convert all sprites using the GPU - the fix isn't ideal, but it'll
likely have to do unless someone feels like porting over more of the
OpenGL changes to the D3D11 renderer.

Closes #1921.
2017-06-13 01:11:45 +01:00
Jonathan Li f8787ca6b9 gsdx: Fix variable initialisation issue
Class member variables are initialised in order of declaration in the
class definition. Move native_buffer to the top of the class definition
to avoid initialising m_width and m_height to random values.
2017-06-05 01:12:41 +01:00
Akash 23fa0657a7 GSdx-HW: Move scaling code to separate subroutine
Move the custom resolution scaling code to a separate subroutine and
allow future RT buffer resize calls when the buffer size isn't enough.

(Example: when a game's CRTC/Framebuffer size changes. The older code
didn't consider such cases)
2017-06-04 17:10:25 +02:00
Akash a04d9fa388 GSdx-HW: Revamp buffer size calculation
Added a more robust buffer size calculation mechanism for custom
resolutions. Improves performance in higher resolutions for games
which don't need a big buffer. There's a great boost in performance
at GS limited scenarios.

I don't even feel there's a need for the large framebuffer option right
now, For future - I plan on making the large framebuffer enabled version
as the default as the overhead is there only at situations when it's
necessary. Until then keeping the original code just to be on the safe
side in case any issue pops up.
2017-06-04 17:10:25 +02:00
Akash 266c114c1e GSdx-OGL: Extend ICO workaround to PAL videomode 2017-06-03 14:52:42 +02:00
Jonathan Li 11ed4de0aa gsdx: windows: Port xz dump readback
Also modernize and std:: a bit while I'm at it.
2017-06-03 14:52:01 +02:00
Jonathan Li 742b0edaa8 gsdx: Fix GS dump readback EOF handling
An EOF only occurs after attempting to read past the end of the file.
Account for this correctly, which fixes a potential infinite loop when
reading back an xz compressed GS dump.
2017-06-03 14:52:01 +02:00
Jonathan Li a6ed698fca unix: Remove LZMA_SUPPORTED define 2017-06-03 14:52:01 +02:00
Jonathan Li 3912f3330f windows: Link GSdx to liblzma (xz) 2017-06-03 14:52:01 +02:00
Jonathan Li 97d99632a6 gsdx: Use std::vector for xz dump output buffer
By default, Windows has a 1MB stack size limit per thread, so array
cannot be used...
2017-06-03 14:52:01 +02:00
Akash 49840bb621 GSdx: Implement SYNCV register bitfields
Add the bitfield structure of the undocumented SYNCV register,
potentially might be useful in proper height determination of the output
circuit for some weird games which still get it wrong but still haven't
figured out how it might be useful. Maybe some sort of black magic
formula with the vertical synchronization values?

The differential phase value seems to closely resemble the display
height value of the video modes (480 for NTSC, 576 for PAL) but after
some investigating into the differential phase, I have no clue on how
they might be even related. Hopefully the mystery will be unveiled in
the near future.
2017-05-24 13:44:52 +02:00
Gregory Hainaut 802f1029e9 gsdx: dump gsdump in xz format directly
Reduce disk space. Easy to share.

It would be nice to port the code to Windows.
libzma code was taken from https://git.tukaani.org/xz.git

Note: only short dumps are supported so far. Big dump will freeze the interface during the compression.
Or will suck all the RAM.
Note2: a multithreaded encoder would badly impact the compression ratio

Thanks to Turtleli for all review comments
2017-05-21 23:45:35 +02:00
Gregory Hainaut 53b2fdf31c linux: requires liblzma (xz) to build GSdx 2017-05-21 23:45:35 +02:00
Gregory Hainaut 5c7d9d08e2 gsdx: defer init of GSUtil global object
Close #1935
2017-05-21 14:39:22 +02:00
Gregory Hainaut 9cb8c70434 gsdx linux: port to latest GTK3 API
* replace gtk_table by gtk_grid
  => it still misses some paddings
* Use 3.22 monitor API to query screen size
  => need to be tested
* directly add scrolled windows into a container without bothering with
  the viewport.

Code compile fine but wasn't tested.

v2: disable the code until I (or someone) get a chance to test and fix it.
2017-05-13 10:39:06 +02:00
Gregory Hainaut b15ab1b1cf gsdx: use = default instead of trivial constructor/destructor
reported by clang-tidy
2017-05-13 10:38:35 +02:00
Gregory Hainaut 595ad99a5b Cmake: what should have been the previous commit 2017-05-12 19:38:51 +02:00
Gregory Hainaut 05763b3669 cmake: better gcc + gsdx integration
Only set fabi-version on older GCC (5.0 and below)
Disable broken optimization for GCC7+ (until we find a better solution)
2017-05-11 23:14:06 +02:00
Gregory Hainaut ec63b04719 gsdx: only print once OpenGL status message
All credits go to @lightningterror

Fix #1882
2017-05-11 22:35:31 +02:00
Akash 984fcfda2e Counters: Update videomode enum with proper prefix
Thanks to @colepcsx2 (https://github.com/PCSX2/pcsx2/pull/1896#commitcomment-21858717) for pointing it out!

I also updated the prefix in the inferior video mode detection of GSdx, I'm not even sure why we need the videomode info on the plugin side, might be useful someday.
2017-05-11 11:23:10 +02:00
Akash 7a3239cba0 GSDX: Remove redundant parenthesis from combobox text
The third parameter of the GSSetting constructor already encloses the
text in parenthesis, so the right bracket here just messed up things.
2017-05-07 19:31:37 +01:00
Akash 5f449151a1 GSDX: Add missing grayouts to Shadeboost options
The shadeboost options text (Contrast, Brightness, Saturation) were not
grayed out when shadeboost was disabled, it was sort of inconsistent
compared to the behavior of external shader, so added grayouts to them
when shadeboost is disabled.

Also changed "OpenGL Very Advanced Custom Settings" to "OpenGL Advanced
Settings", the verbosity didn't help much in my opinion.
2017-05-07 19:31:37 +01:00
Gregory Hainaut dc00af8829 psx|spu2x|gsdx: shift negative value is undefined in C standard
Instead does the negation after the shift

v2: assert shift <= 15 in clamp_mix
2017-04-30 21:20:23 +02:00
Gregory Hainaut d9e43b5d8d gsdx egl: rewrite the EGL implementation
Split code in 2 parts
* Base class (GSWndEGL) that implement the core EGL and GL context
* Derived class (GSWndEGL_X11/GSWndEGL_WL) that implement the backend to handle native resources

Note: Most backend code is only useful for GSopen1/PS1 mode. GSopen2 only requires
the AttachNativeWindow implementation

Code is based around EGL_EXT_platform extension that allow to select the platform at runtime.
Note: I think the extension was integrated in EGL 1.5

The X11 backend was mostly converted to XCB
The wayland backend is only a placeholder for future code

I don't know if MS windows is/could be supported with EGL_EXT_platform API

Code validated on Mesa. Proprietary drivers aren't yet tested.
2017-04-30 14:04:24 +02:00
Jonathan Li a3b3b4f657 gsdx: Fix uptr size on Windows x64 build 2017-04-29 23:22:02 +01:00
Gregory Hainaut 413d1828eb gsdx: call XInitThread on Linux dump replay 2017-04-29 13:05:28 +02:00
Gregory Hainaut 41990a6402 cmake: create the macro add_custom_glib_res to handle resources 2017-04-28 11:27:19 +02:00
lightningterror 303564fd70 GSdx: Move/add GT4 CRC
Moved a CRC hack to Aggressive that can cause or fix VRAM and RAM spikes.
This way people can switch between each config if they experience problems with either.
Varies on userconfig , game version and maybe hardware.

Added missing CRC game version for GT4 pal.

Note: The issue might be the same on GT3 and GTConcept , the code might
need to be removed for those games as well.
2017-04-27 17:46:58 +02:00
Gregory Hainaut bb35261aca gsdx: don't request a depth buffer on the window
Code directly uses depth buffer attached to a frame buffer
2017-04-23 10:59:33 +02:00
Gregory Hainaut 2155f65478 gsdx: fix EGL build 2017-04-23 10:59:33 +02:00
FlatOutPS2 47c2f0a289 GSdx: Remove Dirge Of Cerberus CRC hack
Hack was used to remove garbage data rectangles from popping up on screen when objects and characters were added to or removed from the world.
This issue is now being handled by OI_DoubleHalfClear in GSRendererHW.cpp, so the hack is no longe necessary and has been removed.
2017-04-21 11:13:27 +02:00
FlatOutPS2 7392f52184 GSdx: Move Resident Evil 4 and The Getaway series CRC hacks
Moves Resident Evil 4 hack to Aggressive level as it is no longer
required to fix any issues, but does offer a decent speed boost.

Moves The Getaway & The Getaway Black Monday CRC hack to Full level, as the issue can be resolved
when using the OpenGL Hardware renderer.
2017-04-21 11:13:27 +02:00
Gregory Hainaut 688f05ff26 gsdx sw: always enable the gs memory wrapping emulation 2017-04-21 10:53:05 +02:00
Gregory Hainaut 24eb1627e5 gsdx: add GStempdir wrapper to get a tempory directory
Allow to use Linux compatible code for OpenCL
2017-04-12 18:39:11 +02:00
Gregory Hainaut 2b30e7880e gsdx: add GSmkdir for windows based on CreateDirectory
v2: use nullptr
2017-04-12 18:39:11 +02:00
Gregory Hainaut 2d0a61fc8d gsdx ogl: use load resource to load shader
* Windows behavior must be checked
* remove glsl_source.h

v2: fix missing include
Big thanks to Turtleli

v3:
fix indentation in gsdx-res.xml
add dependency in cmake
remove old res/glsl/fxaa.fx symlink
add tfx.cl for OpenCL support on Linux

v4, v5
fix cmake indentation
2017-04-12 18:09:06 +02:00
Gregory Hainaut 38c4f5b6e7 gsdx: always NULL terminate resources on Windows
It is done automatically on Linux. Strings are much
better with this NULL char ;)

All credits go to turtleli

v2: increase resize instead of push_back NULL char
2017-04-12 18:09:06 +02:00
Gregory Hainaut ebae8b65f8 gsdx linux: implement GSdxApp::LoadResource based on g_resource
v2: use early return to reduce code/branch complexity
v3: use nullptr
2017-04-12 18:09:06 +02:00
Gregory Hainaut 1cbade511d gsdx: use vector of char as shader container
It will avoid various char cast on Linux.

v2:
remove cast on windows file and std prefix shader vector
v3:
forget to remove some char cast
2017-04-12 18:09:06 +02:00
Gregory Hainaut e91194994f gsdx ogl: remove useless glx/egl context print 2017-04-09 12:59:08 +02:00
Gregory Hainaut dad4ab1980 gsdx ogl: Deleted objects are automatically unbound/unmapped 2017-04-08 14:40:54 +02:00
Gregory Hainaut 12d2c6be56 gsdx linux gui: align gui with wndows (tooltip + checkbox)
add checkboxes for the 2 "new" hacks
    Wrap gs memory & merge postprocessing sprite

add tooltip for OpenGL options

v2: based on turtleli feedback
use gtk_scrolled_window_set_propagate_natural_height on GTK 3.22+
use the nicer GTK_CHECK_VERSION macro
2017-04-07 23:06:29 +02:00
Gregory Hainaut 83d83b9add gsdx linux gui: reduce height on/for small screen
* Remove the logo
* add a scroll on the osd panel
2017-04-07 23:06:29 +02:00
lightningterror 820919c0a9 GSdx ogl sw: Move GL_ARB_copy_image to optional
Move GL_ARB_copy_image to optional for OpenGL SW render.
It will allow Ivy Bridge to work with OpenGL SW as it's not required.

Sandy Bridge is not yet tested , would be nice if someone could test.
2017-04-06 18:14:59 +02:00
Gregory Hainaut ad63c13cd1 gsdx sw: Update comment on the GCC bug
Add link to bugzilla. Bug will be fixed in GCC7

Close #1881
2017-04-04 19:04:21 +02:00
Gregory Hainaut 5b91dc45e0 gsdx ogl: reduce requirement for SW renderer
Clip Control is only used for the HW renderer.

It will help Nvidia DX10 GPU on Windows. Potentially old AMD GPU too.
Unfortunately Ivy bridge still misses texture copy

Note on Linux, you can use the free Mesa driver.

Otherwise, it is time to save money for a future upgrade :)
2017-04-04 18:37:26 +02:00
Gregory Hainaut df32564bef gsdx: workaround AVX2 generated code by GCC
See commit for the full details.

v2: use a direct access to the union field instead of extract32
It gives us both optimal and working code.
2017-04-01 14:05:40 +02:00
FlatOutPS2 82405982f7 GSdx: Add merge sprite hack to GSdx hacks dialog
Adds merge sprite hack to GSDx hacks dialog

And ports merge sprite hack to Direct3D renderers.
Special thanks to my keyboards Ctrl, c and v buttons for all their hard
work in porting this hack.
2017-04-01 11:16:25 +02:00
FlatOutPS2 557b672232 GSdx: Unscale Point and Line Direct3D11 port
Ports the "Unscale Point and Line" hack to the Direct3D11 Hardware renderer.

And enables the "Unscale Point and Line" hack for Custom Resolutions with Direct3D11 and OpenGL.
2017-04-01 11:16:25 +02:00
FlatOutPS2 117c249595 GSdx: Add Windows GUI for split texture filtering option
Adds Windows GUI elements of the split texture filtering options.

Bilinear Texture Filtering is moved to the top section of the main GSdx window,
and Trilinear Filtering is moved to Hacks.
2017-04-01 11:16:25 +02:00
FlatOutPS2 cb0a430aa4 GSdx: Shader & OSD window update
Adds Texture Filtering Of Display option to the Shader dialog window Windows UI.

Updates the layouts of the Shader and OSD dialog windows to more closely resemble the Linux GUI.
2017-04-01 11:16:25 +02:00
FlatOutPS2 df5278df72 GSdx: Main & Hacks window update
Reorganizes Hacks dialog window.

Adds UI elements for the Memory Wrapping and HPO v2/Special commits

Adds advanced OpenGL functions "Geometry Shader" and "Image Load Store" to the Windows UI.

Renames "Configure Hacks" to "Advanced Settings and Hacks", to more closely resemble the Linux GUI.
2017-04-01 11:16:25 +02:00
FlatOutPS2 975441dfe9 GSdx: Direct3D port of HPO special/V2
Adds a port of the new Half-pixel Offset options for the Direct3D
Hardware renderers.
2017-04-01 11:16:25 +02:00
FlatOutPS2 2d591182c4 GSdx: Memory Wrapping Windows port
Adds GS Memory Wrapping hack to Windows. Enabling the hack will fix cut-off cutscenes in Wallace & Gromit: The Curse of the Were-Rabbit and Thrillville.
2017-04-01 11:16:25 +02:00
Gregory Hainaut 41fb11d846 gsdx: cpu detection take 3! Don't use 64 bits type in Xbyak::Cpu
Recent GCC uses SSE4/AVX code to optimize the 64 bits operation.
It is bad idea as it would generate an illegal instruction on
older CPU.
2017-04-01 11:14:18 +02:00
FlatOutPS2 82ad1392ef GSdx: Move Ace Combat 4 CRC hack to aggressive level and fix spelling issues
Ace Combat 4 CRC hack removes clouds for a good speed boost, which removes both 3D clouds(invisible with Hardware renderers, but cause slowdown) and 2D background clouds.
Removes blur from player airplane.
This hack also removes rockets, shows explosions(invisible without CRC hack) as garbage data, causes flickering issues with the HUD, and in some (night) missions removes the HUD altogether.
The CRC hack has been moved to the aggressive level.

Aggressive is misspeled several times in the file, this has been adressed.
2017-03-31 23:36:35 +02:00
Jonathan Li 815ac8be04 gsdx:cmake: Fix logo dependency issue
Changes to the dependencies of the generated logo files did not trigger
a rebuild of the files. Use add_custom_command instead of
execute_process so build dependencies can be specified.

Also prevent the generated files from polluting the source directory.
2017-03-30 22:55:34 +01:00
Jonathan Li ba94643f0f gsdx:linux: Fix missing logo on some Linux distros
The pixdata format loader has been removed from recent versions of
gdk2-pixbuf, so the logo doesn't load. Avoid preprocessing the data and
leave the logo as an embedded bitmap file.
2017-03-30 17:45:49 +01:00
Jonathan Li ae73356ecf gsdx: Avoid const strings in header file
This prevents each .cpp file that included stdafx.h (IOW everything)
from having its own copy of the strings.
2017-03-30 01:10:48 +01:00
Akash 38c2de3ae3 GSdx-PCRTC: Minor modification to NTSC saturation
Allow the output circuit saturation to take place at cases where one of the output circuit is enabled with frame mode rendering, I'm not sure it would be safe to allow saturations when both of the output circuits are enabled with frame mode rendering. Unlike field mode rendering, frame mode doesn't use identical rectangles at same co-ordinates for output in two alternating fields and potentially they could use a much bigger output size when both of the output circuits are enabled and are separated without any intersection. So let's limit the saturation to only the cases where we detect a single output circuit for frame mode rendering.

Fixes a regression in Devil May Cry 3 and Sky Gunner.
2017-03-29 19:37:44 +02:00
willkuer a18d624bcb gsdx: Add an automatic CRC hack level
If a user switches renderer they also have to remember to change the CRC
hack level for the best user experience with the selected renderer.

This commit adds a new automatic CRC level that autoselects the
recommended CRC level for the selected renderer, so that a user doesn't
have to make the change manually.

coauthor: turtleli
2017-03-28 23:05:24 +02:00
willkuer 439472d4f8 gsdx: Add template version of GetConfig
It allows static_casts to be avoided for enum classes
2017-03-28 23:05:24 +02:00
Jonathan Li 85ddf69042 gsdx: Improve OpenGL HW renderer checks
If OpenGL software is the saved ini renderer and F9 is pressed to toggle
to the hardware renderer, depth emulation will be disabled. This fixes
that issue.
2017-03-28 23:05:24 +02:00
Jonathan Li a5282daf91 gsdx: Store the current renderer in GSdxApp 2017-03-28 23:05:24 +02:00
Jonathan Li 94f2ad9263 gsdx: Move renderer config loading from GSOpen2 to _GSOpen
Some duplicate logic is avoided this way.
2017-03-28 23:05:24 +02:00
lightningterror 6977658443 GSdx ogl: SSO Workaround for AMD buggy drivers (#1858)
GSdx ogl: SSO Workaround for AMD buggy drivers

All 2017 drivers are now blacklisted.
The BSOD/crash issue is still there so don't set Blending Accuracy to None!
Shortened the message in the console making it more appealing.
2017-03-28 23:02:19 +02:00
orbea 2aa33e2875 Add crc hack for project metafalica
Closes https://github.com/PCSX2/pcsx2/issues/1762
2017-03-27 12:51:43 +02:00
Jonathan Li f1eff358da gsdx:windows: Fix console output when replaying dumps 2017-03-23 01:33:35 +00:00
Jonathan Li f174d71ac7 gsdx: Fix vsnprintf usage in format function
-1 is only returned when there is an encoding error, and the va_list
argument is indeterminate after being passed to vsnprintf.

Use the return value to determine the buffer length, and call va_end and
then va_start before vsnprintf is called again.
2017-03-21 23:21:26 +00:00
Jonathan Li ae2e8469b4 gsdx: Remove ancient codeblocks file 2017-03-21 23:21:26 +00:00
Jonathan Li 67d9436f22 gsdx: Remove unused and incomplete GSDeviceSW 2017-03-21 23:21:26 +00:00
Jonathan Li 448ca97d93 gsdx: Avoid "using namespace std" in spsc queue 2017-03-21 00:10:35 +00:00
Gregory Hainaut 9865270e68 gsdx: split GSVector.h into smaller files 2017-03-19 13:50:13 +01:00
Gregory Hainaut a3efc77255 gsdx ogl: use an HLE shader to avoid upscaling line in ICO
ICO uses a depth of field effect for the fog. Depth is extracted
into the alpha channel of a texture. And then used as blending factor.
You need a 1:1 texture/pixel mapping otherwise you will line at boundaries.

In order to extract the DoF, ICO moves the depth buffer around the GS
memory. Memory moves are implemented in the not-scaled world. It means
that we can't have the above 1:1 ratio. And we don't know anymore that
data are coming from the current depth buffer.

The solution: I reused an HLE channel shader to read the depth buffer directly.
This way I have the guarantee that pixel/depth are aligned.

Close #1816
2017-03-16 08:27:12 +01:00
Gregory Hainaut 1a768ca438 gsdx sw: sync thread if current target pages are already used by input texture
Otherwise you have a write before read typical race condition. It works
most of the time because textures are stored in temporary buffers (aka
texture cache). So the race condition requires texture invalidation in the mix.

I hope the perf impact will be small enough.

Fix #1691
Blood Will Tell: gray scale effect description

Frame is renderer in 0x700
Sync 0x700 (RT will be used as input)

Foreach page of frame
    // The missing Sync was this one. You can't copy new data to 0x2800
    // until you finish the rendering that use 0x2800 as input texture
    // (AKA end of this foreach loop)
    Sync 0x2800 (not the first iteration, texture will be used as a RT)
    Copy page from 0x700+offset to 0x2800

    Sync 0x2800 (RT will be used as input)
    Render Effect line1 from 0x2800 to 0x700
2017-03-15 18:30:46 +01:00
Jonathan Li c498833c27 gsdx: Remove VS2013 stuff 2017-03-13 23:57:15 +00:00
Gregory Hainaut 0af80b7c86 gsdx: restore the order of the texture filtering option
It was modified by mistake with previous filtering refactoring
2017-03-13 22:55:47 +01:00
Akash f423cf73c4 GSdx: Fix Alpha test value initialization
Alpha test should only be disabled when writes to all of the alpha bits in the Framebuffer are masked. Fixes a regression in Dragon Ball Z: Budokai 3 scouter image rendering.
2017-03-11 17:40:28 +01:00
Gregory Hainaut 7d3c850813 gsdx ogl: improve ST/Q precision
When a float overflow is detected, geometry shader is disabled. And ST/Q is done on the CPU

It will help
Issue 551
Issue 1684
2017-03-11 00:24:38 +01:00
Gregory Hainaut 6d6ed1a205 gsdx sw: do const q division in ConvertVertexBuffer
It allow to do the division before the size multiplication
It avoid a float overflow if T is too big.
Old behavior: (T * size) / Q
New behavior: (T / Q) * size

Performance Note:
* Rcp was replaced by a slow division (more accurate)
* At least we avoid a 2nd loop on the vertex buffer

It helps on Pro Soccer Club and Galerians Ash rendering

Tric Note:
SPRITE must be handled differently because the 'q' of first vertex could
be invalid
2017-03-10 20:45:14 +01:00
Gregory Hainaut 611239db5c gsdx: handle float overflow on Q in vertex trace
Replace the fast reciprocal with a slower division when we detect a too big Q value.

Improve #551, #1684
2017-03-10 20:45:14 +01:00
Gregory Hainaut f862f5be03 gsdx sw: use accurate division for the C reference implementation
Speed isn't important here. It would allow to compare the rendering with
the JIT implementation. If it is necessary we could an option for the JIT.
2017-03-10 20:45:14 +01:00
Gregory Hainaut b54a824abd gsdx: split texture filtering option
Bilinear applies to all renderer
* Common code done in GSVertexTrace
* Extend it with forced but sprite (trade-off between linear/upscale glitches)
* Linux GUI option was moved at the top with the renderer selection

Trilinear is moved to OGL hack

close #1837

Thanks to Flatout for the review and feedback.
It will take care to update the Window GUI :)
2017-03-10 18:05:34 +01:00
Gregory Hainaut 91f805675b gsdx: dump xyoffset register 2017-03-05 22:16:01 +01:00
Gregory Hainaut 0a5f796c33 gsdx sw: missing texture due to wrong optimization fix
Typical bug, missing/wrong texture on the SW renderer but working fine on the HW renderer

Debugged on ATV Quad Power Racing 2 but I suspect couple of game are impacted

Bug description:
GSdx flatten the Q value of sprite. So m_vt.m_eq.q is true when Q(2N+1) are the same.
Q(2N) values could be random. The fix replaces Q0 by Q1 for the uniform Q value.
2017-03-05 20:27:19 +01:00
Gregory Hainaut 438fbf31cf gsdx sw: rcp introduce bad rounding on the grandient
Division is slower but more accurate. Fix rendering issue on Xenosaga (batte slot)/Jak3 (skin color)

Coauthor:pseudonym

Fix issue #1769
2017-03-05 10:53:07 +01:00
Gregory Hainaut ae8aa358e4 gsdx: move window creation before renderer/device setup 2017-02-26 19:09:16 +01:00
Gregory Hainaut da2bf4e366 gsdx: reduce the complexity on window creation
Improve code sharing between OS
Use vector to handle priority
Throw in GSWndDX create in case of error
2017-02-26 19:09:16 +01:00
Gregory Hainaut 9ff385f6f3 gsdx: use shared_ptr instead of raw GSWnd* 2017-02-26 19:09:16 +01:00
Gregory Hainaut 714fcaaadd gsdx ogl: move the validation of the gl context in the window 2017-02-26 19:09:16 +01:00
Gregory Hainaut b3836c58d2 gsdx ogl: properly plug the new HPO option 2017-02-26 19:04:00 +01:00
Gregory Hainaut 646c02a5e2 gsdx linux: update GUI based on previous commit 2017-02-26 19:04:00 +01:00
woj1993 4a6a3af418 gsdx windows: update gui to add a HPO v2 checkbox
Squash done by greg

v2: update tooltip
2017-02-26 19:04:00 +01:00
Akash 500d2e076d GSdx-PCRTC: Apply saturation only for field mode
Previously, the NTSC saturation was also applied for double scan mode (Interlaced and Frame) where the developers send double the height to the DISP registers, saturation shouldn't be performed at such cases as the developers could send a value of 780 while the real size of the output would be 390 due to double scan mode. Doing the saturation later after identifying the real size also seems a bit counter-intuitive as we haven't discovered any cases where double scan games require the NTSC saturation hack. So let's just apply the saturation only for Interlaced (Field) Mode and omit the saturation step for other modes.
2017-02-21 10:54:28 +01:00
Akash 17b33afd64 GSdx-PCRTC: Move hacks away from GetDisplayRect()
Isolate all the hacks into a separate subroutine and properly document about them, should make it easier for people to understand the display rectangle setup code, the hacks were totally messing up the readability of the function earlier.
2017-02-21 10:54:28 +01:00
Akash 319b3dabdf GSdx-Windows: Automatic CRC hack level selection
Default to "Partial" CRC hack level when the GPU's best renderer is determined as the OpenGL hardware renderer.
2017-02-21 10:54:03 +01:00
Akash ff89619b09 GSdx: Add an Enumeration for CRC Hack level 2017-02-21 10:54:03 +01:00
Gregory Hainaut 726f9d5312 gsdx ogl: improve error message on windows
* Common function
* Print an error id
* Don't exit on bad setpixelformat (it is illegal to call it twice)
2017-02-18 22:25:27 +01:00
Gregory Hainaut f3adf4bf57 gsdx ogl: texture barrier is optional too 2017-02-18 20:11:56 +01:00
Gregory Hainaut 193d9f838b gsdx ogl: mark 2 DSA functions as optional 2017-02-18 19:44:17 +01:00
Gregory Hainaut 674d22321a gsdx wgl: drop GL2.0 context and avoid a context leak
Namely detach/delete context before throwing
2017-02-17 19:20:42 +01:00
Gregory Hainaut cdb71101a1 gsdx ogl: As Intel is too cheap to provide GL_ARB_direct_state_access on theirs expensive iGPUs
Add a "slower" emulation of the extension...

Hopefully it will allow to start openGL on haswell (maybe broadwell) and later.
2017-02-17 17:44:26 +01:00
Gregory Hainaut 26993380b1 gsdx-ogl: black list 2016/2017.1 AMD driver
Based on AMD feedback, I'm might blacklist all 2017 drivers too.
2017-02-17 17:32:53 +01:00
Gregory Hainaut da1bb43618 cmake: Add various missing file in CMakeLists.txt
Add some windows code path. It would reduce the burden to port Cmake to windows.
(sill miss 3rdparty/some plugins/...)
2017-02-16 20:11:57 +01:00
Gregory Hainaut de962d3e7e gsdx wgl: retry to create a context without advance flag
Hopefully it will support more drivers #1813
2017-02-10 22:26:41 +01:00
Gregory Hainaut 213fa1c148 gsdx sw: init completely m_scanline buffer
The buffer contains extra room to avoid a segmentation fault due to an overflow.
Unfortunately the end of the buffer wasn't initialized which can lead to unexpected behavior.

Based on issue #1806 it could impact Guilty Gear X2
2017-02-08 19:42:54 +01:00
Gregory Hainaut 2a2a022792 gsdx ogl: add a texture barrier when target is read back
Fix graphical corruption in Nouveau/BUA/devil may cry

Issue #1805
2017-02-08 19:42:54 +01:00
Gregory Hainaut ba91c8f0c2 gsdx opencl: warning+compilation fixes 2017-02-08 19:42:54 +01:00
Gregory Hainaut c232f90d6e cmake: add an option to enable openCL
Note: nothing work
2017-02-08 19:42:54 +01:00
Gregory Hainaut d0b1162b15 gsdx ogl: drop fallback of GL_ARB_clear_texture
Mesa AMD was updated :)

all drivers[1] that support GL_ARB_shader_image_load_store got GL_ARB_clear_texture

[1] Intel driver misses others extensions to run GSdx
2017-02-03 21:56:24 +01:00
Gregory Hainaut 63944e8c43 gsdx ogl: allow to start without GL_ARB_texture_barrier
Rendering will be corrupted (for advance effects) if the driver doesn't support it.
However it allow to run with Mesa software emulation (or inside a virtual machine)

Note: mesa still requires an override of the buffer storage extension
MESA_EXTENSION_OVERRIDE=GL_ARB_buffer_storage
2017-02-03 21:56:24 +01:00
Gregory Hainaut dc42c65dfb gsdx: requires/allow BMI instruction in AVX2 build
So far BMI is inclusive in AVX2 CPU. Help compiler to generate better code
2017-02-01 18:24:51 +01:00
Akash eda22c241d GSdx: Improve robustness of ComboBoxInit()
Previously, the combobox will reach an indeterminate state whenever it's passed with a value out of range via ComboBoxInit(). To avoid such cases, let's initialize the current selection of the combobox with the front element of the settings vector whenever we detect an out of range value which is not declared in the vector.

To reproduce the issue, set "Renderer" to some sort of crazy value like 50 in the GSdx.ini file and it'll mess up the whole GSdx plugin dialog really bad. This patch prevents such undesirable behavior by simply selecting the front element in the vector when we read an unsupported value.
2017-02-01 11:29:38 +00:00
Gregory Hainaut 5751e38180 gsdx: use range loop instead of for_each 2017-01-30 17:58:39 +01:00
Gregory Hainaut cf71049bd4 gsdx tc: use unsigned constant
Help the compiler to generate better code

C code:
uint32 addr = (i >> 3u) % MAX_BLOCKS;
uint32 row = addr >> 5u;
uint32 col = 1 << (addr & 31u);

ASM Before
     f48:	mov    eax,esi
     f4a:	mov    ecx,esi
     f4c:	mov    edx,DWORD PTR [ebp+0x8]
     f4f:	sar    eax,0x1f
     f52:	sar    ecx,0x3
     f55:	shr    eax,0x12
     f58:	add    ecx,eax
     f5a:	and    ecx,0x3fff
     f60:	sub    ecx,eax
     f62:	mov    eax,0x1
     f67:	shl    eax,cl
     f69:	shr    ecx,0x5
     f6c:	lea    edx,[edx+ecx*4]

ASM After
     f48:	mov    ecx,edi
     f4a:	mov    eax,0x1
     f4f:	sar    ecx,0x3
     f52:	shl    eax,cl
     f54:	shr    ecx,0x3
     f57:	and    ecx,0x7fc
     f5d:	add    ecx,DWORD PTR [ebp+0x8]
2017-01-30 17:54:29 +01:00
Gregory Hainaut da054a2aab gsdx: remove useless debug log 2017-01-30 17:54:21 +01:00
Gregory Hainaut 09b8aaed71 gsdx tc: extend the wrap option to the texture cache 2017-01-30 17:54:07 +01:00
Akash bf10873405 GSdx: Remove useless check and add debug messages
IsEnabled() check is already done in GetDisplayRect, so it's pointless to do it here. Also updated a debug message in the GetFrameRect() function.
2017-01-30 15:29:28 +01:00
Akash a2cdcb4e4d GSdx-PCRTC: Improve output circuit selection
Previously, the auto output circuit selection of the GSdx wasn't good, it simply defaulted to the second output circuit even when the first output circuit is also enabled. The new algorithm for auto selecting returns the merged rectangle dimensions when both of the output circuits are enabled and if the condition for merge is not satisfied then it returns the bigger output circuit.
2017-01-30 15:29:28 +01:00