Commit Graph

2030 Commits

Author SHA1 Message Date
Gregory Hainaut ef3aa17025 gsdx-ogl: disable useless Nvidia driver message 2015-11-12 17:04:54 +01:00
Gregory Hainaut d67ba015c5 Merge pull request #962 from ssakash/GSDX_sizechecks
GSDX: Improve FB size handling
2015-11-12 12:17:31 +01:00
Gregory Hainaut c12958bf10 gsdx: sign-compare
Need review
2015-11-12 12:11:44 +01:00
Gregory Hainaut abb4cb4810 plugin API: use const char* insead of char*
I hope it doesn't change the ABI

v2: fix GSnull/zzogl/zerogs
v3: duplicated code on windows...
2015-11-12 12:11:42 +01:00
Jonathan Li 4eb57cde0e gsdx: Adjust current renderer message
The leading space was really annoying me. Also make the variable local
instead of static.

And fix a bad indentation.
2015-11-11 18:52:52 +00:00
refractionpcsx2 52802371e4 GSdx D3D11: Workaround for Gust games, must enable sprite hack (which these games need anyway) and it will fix the squares caused by the Nvidia fix. Not a perfect solution but we can't have it both ways :( 2015-11-10 22:58:53 +00:00
willkuer 9245d3ed7e gsdx: RendererEnum
1. Add GS_Renderer Enum

Replace all instances of int/uint32 renderer identifier by a strongly
typed enum and appropriate casts.

Only instances in GS[*].cpp/h classes were touched. GPU[*].cpp/h classes
do not to follow the same convention.

2. Add default renderer according to OS

The default renderer is OS dependent (Win -> Dx9HW, others -> OGLHW).
Consequently one should always check againt the appropriate default
value on config load.

The old behaviour was only - if a at all - problematic if the respective
element in the gsdx.ini was missing and probably even then didn't create
issues. The current implementation is still more stable and does not
depend on the implementation of GS.cpp -> GetConfig()
2015-11-10 00:26:39 +01:00
Jonathan Li 44d89308c9 Revert "Revert "gsdx|spu2-x: Use atlcomcli.h for CComPtr definition""
This reverts commit 9bb990e9ed.

Fight! Ahem...
2015-11-09 20:55:07 +00:00
Akash d5ba546d2e GSDX: Improve CRTC output size handling 2015-11-09 05:52:42 +05:30
Jonathan Li 9bb990e9ed Revert "gsdx|spu2-x: Use atlcomcli.h for CComPtr definition"
This reverts commit 0eb771c2a6.

The buildbot apparently cannot find atlcomcli.h. Oh joy.
2015-11-08 20:46:41 +00:00
Jonathan Li 49ff324882 Merge pull request #955 from turtleli/replace-comptr-h
gsdx|spu2-x: Use atlcomcli.h for CComPtr definition
2015-11-08 13:27:28 +00:00
Gregory Hainaut 4ef0572ceb gsdx-ogl: disable copy constructor
'class GSVertexBufferStateOGL' does not have a copy constructor which is recommended since the class contains a pointer to allocated memory.
2015-11-06 23:01:59 +01:00
Gregory Hainaut 3e4c3353ce gsdx-ogl: missing break 2015-11-06 23:01:58 +01:00
Gregory Hainaut 9f1649ae57 gsdx: use a type in sizeof
(warning) Suspicious usage of 'sizeof' with a numeric constant as parameter.
2015-11-06 23:01:58 +01:00
Gregory Hainaut 7c6d2361af gsdx: use scalar delete
(error) Mismatching allocation and deallocation: data
2015-11-06 23:01:58 +01:00
Gregory Hainaut f3394b16b8 gsdx: use standard quote character
Nicer with tool that support ANSII text (cppcheck)
2015-11-06 23:01:58 +01:00
Jonathan Li 0eb771c2a6 gsdx|spu2-x: Use atlcomcli.h for CComPtr definition
VS2013/VS2015 community includes it, so everything will still compile
for everyone.

Also delete common/include/comptr.h.
2015-11-06 18:52:33 +00:00
Jonathan Li 4ab092d011 Merge pull request #911 from ssakash/gsdx_debug
Gsdx: Add Mipmap (Software mode) and preload data frame to GUI.
2015-11-06 13:01:49 +00:00
Akash 754a7eb7de GSDX: Update toggle key messages 2015-11-06 01:47:53 +05:30
Akash d866b5592e GSDX: Add two new options to GUI.
The following patch adds Mipmap option (software mode exclusive) and Preload Data Frame (Hardware mode exclusive) to the GSDX plugin settings for debug purposes.
2015-11-06 01:47:44 +05:30
Gregory Hainaut 5ba41306ea gsdx-tc: HasSharedBits uses PSM not address
Nice heap overflow. I'm surprised that it kinda worked.
2015-11-02 07:36:37 +01:00
Gregory Hainaut 59be6c8710 gsdx: protect some options to avoid buffer overflow
Keep TVShader/interlace/aspectratio in the legal range.

Avoid a crash if the user (aka me) edit the ini file with bad value.
2015-10-25 21:44:20 +01:00
Gregory Hainaut b87cda94c5 Merge branch 'glsl-fix-tv-shaders' of git://github.com/turtleli/pcsx2 into turtleli-glsl-fix-tv-shaders 2015-10-25 21:23:39 +01:00
Gregory Hainaut bba67fbd83 Merge pull request #912 from PCSX2/accurate-blending-issue-762
gsdx-ogl: PrimitiveOverlap requires real rectangle
2015-10-25 20:55:41 +01:00
Jonathan Li 1659d5974e gsdx-ogl: Fix scanline, diagonal, triangular TV shaders
PSin.p is normalised, so integer conversions won't work. Use
gl_FragCoord instead.
2015-10-25 19:20:22 +00:00
Gregory Hainaut 50e6306331 Merge pull request #919 from ssakash/coverity_init
Coverity: Initialize class members
2015-10-25 20:08:46 +01:00
Gregory Hainaut 03bf1ec7b3 gsdx-tc: extend preload frame hack to load target too
The goal is to check the impact on game that have wrong RT content.

It helps a bit Smash Court Tennis Pro Tournament 2 but the game suffers
another texture cache bug. (RT BW is 10 whereas texture BW is 8)

Note: Armored Core: Last Raven must be tested (only game so far
that rely on the option and I didn't want to add a new one).
2015-10-25 15:26:38 +01:00
Gregory Hainaut 295f867118 gsdx: invalid alpha after an EE write
Typical wrong draw:
1/ draw in 32 bits
2/ draw in 24 bits
3/ Use alpha as a texure. (Must reuse the GPU data)
4/ Write alpha from EE
5/ Use alpha as a texure. (Must upload new data)

This commit fixes the step 5.

Fix #917 (Conflict - Desert Storm)
2015-10-24 16:23:50 +02:00
Gregory Hainaut 5cbd0cf42a gsdx-debug: add more push/pop debug group on the init 2015-10-24 14:14:37 +02:00
Gregory Hainaut 9ba949c2d9 gsdx-debug: support correct logging on mesa
By default low severity message were disabled. (thanks to be open source)
2015-10-24 14:14:37 +02:00
Akash c1f1646dab GSDX: Initialize class members
CID 146973 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)2. uninit_member: Non-static class member overflow is not initialized in this constructor nor in any functions that it calls.
2999}
2015-10-23 01:35:15 +05:30
Gregory Hainaut 87001326f6 gsdx: remove 4Y-old unused code
It was never used.
2015-10-22 19:51:03 +02:00
Gregory Hainaut a8968257db glsl: keep fract in [0;1] range
Shin Megami Tensei Lucifers seems to generate infinites values.
I suspect that DX always clamp fract output.

Finally fix #782 !
2015-10-22 18:36:45 +02:00
Gregory Hainaut c0d0e2e89d gsdx-ogl: PrimitiveOverlap requires real rectangle
runion/rempty/rinter requires x < z and y < w

Help issue #762 (accurate blending issue)

If you want to shine, please put better GSVector code (AVX512 is 2 instruction :p)
2015-10-22 12:34:50 +02:00
Gregory Hainaut 92553add8e gsdx-ogl: accurate date regression. Bad interaction between depth & DATE
In the DATE42 algo, first pass must find the primitive that write the
bad alpha value. If depth test is fail, alpha value won't be written therefore
you mustn't keep the primitive id.

In theory to ensure 100% correctness, depth would need to be fully executed
(currently depth write is disabled). However it requires to copy the depth buffer.
It is likely bad for the perf.

Issue reported on DBZInfWorld
2015-10-22 12:31:51 +02:00
Gregory Hainaut 6561fbc831 gsdx-ogl: only enable aniso when sampling from the HW texture unit
Potentially help issue #884
2015-10-22 12:21:43 +02:00
Gregory Hainaut 826319ce34 gsdx-ogl: check null pointer
CID 151735 (#1 of 1): Dereference after null check (FORWARD_NULL)
61. var_deref_model: Passing null pointer rt to CopyRectConv, which dereferences it
2015-10-21 20:10:16 +02:00
Gregory Hainaut 395b4c25f3 Merge pull request #899 from ssakash/gsdx_nullcheck
gsdx: use old size of target if ds and rt is null
2015-10-18 19:25:39 +02:00
Gregory Hainaut d5e0899955 oups collision with ref commit 2015-10-18 11:19:39 +02:00
Gregory Hainaut f99882c61c gsdx-ogl: keep gl_ActiveTexture & gl_BlendColor (fix MS compilation)
It seems openGL ABI isn't exactly the same between Windows and my PC.
2015-10-18 11:18:19 +02:00
refractionpcsx2 179a4cead5 GSdx: Fix compilation 2015-10-18 02:01:56 +01:00
Akash 294b8d3c6e gsdx: use old size of target if ds and rt is null
CID 146843 (#1 of 1): Dereference after null check (FORWARD_NULL)6. var_deref_model: Passing null pointer ds to GetSize, which dereferences it.
2015-10-17 22:47:44 +05:30
Gregory Hainaut 0958b9db8e gsdx-ogl: use the standard openGL name
Function pointer was mangled to avoid any collision. Nowadays all symbols
are hidden so no risk of collision.

Syntax is nicer beside it would allow to put back GLES3.2. I think it
supports most of the used extension.

glActiveTexture & glBlendColor are provided without symbol query.
2015-10-17 17:05:15 +02:00
Gregory Hainaut 1c8f8a00b8 Merge pull request #894 from ssakash/coverity_fix
Coverity: Prevent NULL dereferences and other stuffs.
2015-10-17 16:00:28 +02:00
Akash fedd07e4a8 gsdx: prevent a potential division by zero
CID 146834 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)9. divide_by_zero: In expression tpf * 10000ULL / ttpf, division by expression ttpf which may be zero has undefined behavior.
2015-10-17 11:26:11 +05:30
Akash 04b765a674 gsdx: check for null deference.
CID 146839 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)11. var_deref_model: Passing null pointer fb_pages to UsePages, which dereferences it.

CID 146840 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)11. var_deref_model: Passing null pointer zb_pages to UsePages, which dereferences it.

* Prevent a potential null pointer deference in ```void GSRendererSW::UsePages()```
2015-10-17 09:14:07 +05:30
Gregory Hainaut 03bc304ecf gsdx-ogl: fix colclip regression when accurate blending is enabled
Fix #865
2015-10-16 22:07:50 +02:00
Jonathan Li 39dc23e83b gsdx:windows: Widen and rearrange GUI
All combobox text can now be seen in full without having to click on the
combobox.

The internal and custom resolution stuff has been moved into the Hardware
Mode Settings groupbox since it doesn't affect software mode.

The dialog has also been rearranged a bit.
2015-10-03 22:33:55 +01:00
Jonathan Li 64cccda076 gsdx:windows: Add external shader selection to GUI
This lets Windows users select the external shader and config file via the
GUI.

Also, comment out an unused variable in the Hacks dialog code.
2015-10-03 22:33:15 +01:00
Jonathan Li a57b2a059a gsdx:windows: Add file selection support
The file open dialog will be usable for all GSdx dialogs if required.
2015-09-28 12:45:14 +01:00
Jonathan Li c0137227e6 gsdx:dx: Allow selection of external shader/shader config
shaders/GSdx.fx is now the default location and is no longer hardcoded.
The external shader and external shader config can now be selected. (The
OpenGL renderer already has this feature.)

Note: It is still possible to not use a config file, just use an invalid
value for shaderfx_conf.
2015-09-28 12:45:13 +01:00
Jonathan Li df98c766e5 gsdx:dx9: Refactor shader compilation code
Don't use D3DX compile from file and compile from resource functions -
use the compile from memory function instead. It does the same thing,
except you have to set things up yourself.

Benefits:
Allows external shaders to be split into a config file and a shader file
without hardcoding the config file name.
Less code.

Yes, I more or less used the same message as the dx11 one.
2015-09-28 12:45:13 +01:00
Jonathan Li fabd6075ef gsdx:dx11: Refactor shader compilation code
Don't use D3DX compile from file and compile from resource functions -
use the compile from memory function instead. It does the same thing,
except you have to set things up yourself.

Benefits:
Easier move to D3DCompile when it becomes necessary.
Allows external shaders to be split into a config file and a shader
file without hardcoding the config file name.
Less code.
2015-09-28 12:45:12 +01:00
Gregory Hainaut c7000355fe gsdx-ogl: flush debug file before exiting the application 2015-09-28 09:41:30 +02:00
Jonathan Li cbd2417833 gsdx:ogl:windows: Fix calling convention mismatch
OpenGL does not use the cdecl calling convention (which is the default
calling convention for GSdx on Windows). Since DebugOutputToFile is used
by OpenGL, it needs to use the same calling convention that OpenGL uses.

This fixes a debug build crash when the OpenGL renderers are used and
debug_opengl is nonzero in the ini.
2015-09-26 22:38:05 +01:00
Gregory Hainaut 00e37224ed gsdx: check the return value of mkdir function
Reported by coverity
2015-09-26 13:51:23 +02:00
Gregory Hainaut 78b73ba585 gsdx: avoid null pointer deferencement 2015-09-25 20:59:36 +02:00
Gregory Hainaut 5fb8c7e65c gsdx: initialize members in constructor of objects
A couple of useless members were removed too.

Also fix wnd initialization

Coverity:
CID 146955 (#1 of 1): Uninitialized pointer read (UNINIT)
18. uninit_use: Using uninitialized value wnd[i].
2015-09-23 09:46:53 +02:00
Gregory Hainaut c4a3d57499 gsdx: protect fscanf string read
Coverity:
CID 146816 (#1 of 1): Calling risky function (DC.STREAM_BUFFER)
dont_call: fscanf(FILE *, char const *, ...) assumes an arbitrarily large string, so callers must use correct precision specifiers or never use fscanf(FILE *, char const *, ...)
2015-09-23 09:39:09 +02:00
Gregory Hainaut 7bec15b99f gsdx: remove useless condition check
Base pointer and format are always positive (unsigned int BTW) so drop
>= 0 comparison
2015-09-23 09:39:08 +02:00
Avi Halachmi (:avih) cee0b795ee Recording: handle cancel (at the GS[dx] dialog) gracefully
Without this patch, if a user initiates a recording and then cancels at the GSdx
dialog, the audio was recording anyway, which is probably highly unexpected.

However, while probably highly unexpected, it could still be useful to record
only audio, but with this patch it's now impossible.

We can reconsider if it turns out that people are actually using this "feature",
though one might as well set the video setting to be very unobtrusive (very low
resolution/bitrate) such that it uses very little CPU.
2015-09-22 01:11:25 +03:00
Avi Halachmi (:avih) 4474d4391b GSdx: capture - print recomended resolution and DAR to the console
This is the internal resolution which GSdx uses and recording at this resolution
is optimal, i.e. without any dumb scaling, with all relevant pixels and without
redundant pixels.

The resulting clip still doesn't have the correct aspect ratio set, but that's
just a property which can be set to the clip afterwards, which is where the DAR
becomes useful. Since it's usually anamorphic, when muxing later with the audio
use the DAR to set the playback aspect ratio.
2015-09-22 01:11:13 +03:00
Avi Halachmi (:avih) 3f81fc98dd gsdx: custom resolution - use 0 instead of 9 2015-09-22 01:00:53 +03:00
Jonathan Li 4208267966 gsdx|spu2-x:windows: Scale GUI logo with DPI
The SS_REALSIZECONTROL style resizes image to fit the control window, so
let's use that.
2015-09-21 20:45:50 +01:00
Jonathan Li c088039394 gsdx:linux: Fix clang compile
Everything seems to compile and run with clang 3.7.0 now. I don't know
if clang 3.6.x works or not. 3.5.x doesn't.
2015-09-21 20:45:50 +01:00
Jonathan Li 69d27dfb4b Merge pull request #829 from ssakash/rework_internalres
gsdx changes:
Remove native resolution checkbox from GUI and rework associated code
Small changes to Windows and Linux GUI
Support 8x native resolution
Fix custom resolution width less than native width use case
2015-09-21 20:12:47 +01:00
Gregory Hainaut d42cef891c gsdx: remove ALIGN_STACK feature on GCC
Stack is already aligned correctly. Besides GCC optimizes the variable so it doesn't
have any effect except that it generates useless warnings.
2015-09-20 22:19:45 +02:00
Gregory Hainaut 9b69afe541 gsdx-ogl: typo that broke TC offset hack 2015-09-20 22:19:45 +02:00
Gregory Hainaut b60dd9d1fe Merge pull request #814 from PCSX2/coverity-qa-high
Fix a bunches of coverity warning/errors.
2015-09-20 22:18:03 +02:00
Avi Halachmi (:avih) 94c5eab776 GSdx: capture dialog - actually remember the last used codec
Previously it was saving the display name to the config but trying to restore
according to the friendly name.

Now store and restore according to the "displayName" which is more unique than
"friendlyName" since it includes GUID[s], and handle it consistently as _bstr_t.
2015-09-20 20:04:36 +03:00
Jonathan Li d4f6894e1b gsdx: Fix custom resolution and minor cleanup
This fixes the following issues when custom resolution is selected.
 - When the width is smaller than the native resolution width, the
   texture cache targets are removed on every Vsync signal, causing a
   black screen issue.
 - The texture cache code needs a 1 returned for the custom resolution
   upscale multiplier or there'll be some really funny graphical issues.

It also removes unnecessary GetConfig (which I think unconditionally
does a a file read on Windows) calls if the width was increased - the
upscale multiplier is already stored, and the custom resolution width
and height calls are now unnecessary.

Also fix some whitespace issues.
2015-09-20 07:49:46 +05:30
Gregory Hainaut 28191baa80 gsdx-linux: merge native/upscaling/custom into a single box 2015-09-20 07:49:44 +05:30
Akash a9b0cfc519 GSDX: Add 8X native to Internal resolution. 2015-09-20 07:49:32 +05:30
Avi Halachmi (:avih) 54afd377ee GSdx: recording: Progressive: make the recorded clip play at full speed
Before this patch, when recording Progressive (frame) mode, it recorded all
the frames correctly but set the clip's fps property to 25/29.97, so when
played back it played at half the speed (but was fine when played at double speed).

This patch does not affect the number of frames recorded per second, but rather
only sets the resulting clip fps property to the correct one (double than before).

Also fixes a bug that in a non-managed window in progressive mode, the title
displayed "200%" speed when it should have displayed 100% speed.

Fixes #832
2015-09-19 14:44:48 +03:00
Akash b97018932d GSDX: Rework Internal Resolution function
upscale_multiplier function values have been changed to allocate native resolution and also move custom resolution to 9.
Remove the old native checkbox value and include Native in the combo box.
Internal GSDX functions have also been updated with this new update to the upscale_multiplier variable.
2015-09-14 10:26:27 +05:30
Miguel A. Colón Vélez 4760d71a86 Remove the remaining postbuild stuff.
The bot should work now.
2015-09-13 04:33:17 -04:00
Jonathan Li 239306e9a2 pcsx2|gsdx:linux: Fix posix_memalign
The AddressSanitizer can be used on Linux again. Well, PCSX2 doesn't get
very far when it's used though.
2015-09-12 09:58:00 +01:00
Gregory Hainaut cee0fde940 gsdx-tc: improve support of TEXA register
* Greatly reduce the number of clut read (factor 10x)
* Avoid to get wrong TEXA texture in the cache.
* Fix "jump depends on uninitialized variable" Valgrind warning.

Fix #748

I try my best to avoid any breakage of DX but please test it too.
2015-09-11 14:16:11 +02:00
Gregory Hainaut 78569ee833 gsdx-ogl: redo properly the setup of texture format
* add lengthly comment to explain the format
* Likely reduce the number of shader permutation
* Avoid slow AEM (on GPU)

Expect regressions because TC needs some fixes

v2: fix palette mode
2015-09-11 14:14:22 +02:00
Gregory Hainaut 2430abed33 gsdx: potential division by zero
CID 146833 (#2-1 of 2): Division or modulo by zero (DIVIDE_BY_ZERO)
divide_by_zero: In expression this->m_width / this->m_upscale_multiplier, division by expression this->m_upscale_multiplier which may be zero has undefined behavior.
2015-09-11 08:54:29 +02:00
Gregory Hainaut e6d1a4cccf gsdx: avoid a potential division by zero
CID 146835 (#1 of 1): Division or modulo by float zero (DIVIDE_BY_ZERO)
50. divide_by_zero: In expression (float)(end - start) / (float)frame_number, division by expression frame_number which may be zero has undefined behavior
2015-09-11 08:54:29 +02:00
Gregory Hainaut 2934a15902 gsdx: remove a duplicated check 2015-09-11 08:54:29 +02:00
Gregory Hainaut ac8f4e69d6 pcsx2|gsdx: avoid potential null deferencement 2015-09-11 08:54:29 +02:00
Miguel A. Colón Vélez 26e2b4a5be Rename Release/Debug SSE2 to Release/Debug. 2015-09-08 23:17:07 -04:00
Gregory Hainaut ddc03cbccf gsdx: add a nice enum to replace the hardcoded convert shader 2015-09-08 16:51:24 +02:00
Gregory Hainaut 1ae0fed83b gsdx: fix a regression due to the shader renaming 2015-09-08 16:06:15 +02:00
Gregory Hainaut 81e056e79a gsdx: always enable the boost queue
ifdef was for VS2010

GSThread.h is useless. I keep it for the transactional queue implementation
2015-09-08 14:43:09 +02:00
Gregory Hainaut 3706cfe908 gsdx: always enable CXX11 mutex feature.
ifdef was only useful for VS2010
2015-09-08 14:34:17 +02:00
Gregory Hainaut ca9b5ce11d gsdx-ogl: move depth conversion shader
Add 2 new shaders:
* ps_main12: cast a 16 bit depth to a RGB5A1 color
* ps_main16: cast a a RGB5A1 color to a 16 bit depth

Shader might be used in future commit as it seems Silent Hill uses this
kind of format.

Fix tab/indentation too
2015-09-08 12:41:05 +02:00
Gregory Hainaut 4eed4ca3a1 gsdx-debug: restore 16 bit dump format in the SW renderer
Actually dump both 32/16 bits (former for texture shuffle and later
for real 16 bits RT)
2015-09-08 12:41:05 +02:00
Jonathan Li 9052930ebc Merge pull request #791 from turtleli/gsdx-gui-changes
Add tooltips to Windows GUI. Fixes #578.
Rearrange Window GSdx GUI a bit.
Reformat tooltip descriptions to be both Linux and Windows (un)friendly.
Add new tooltip descriptions.
2015-09-03 22:49:41 +01:00
Jonathan Li e5f045c375 gsdx: Add new tooltips and descriptions.
For Linux and Windows, add tooltip descriptions for AF, AA1, extra
rendering threads, Enable Shade Boost, FX Shader/External Shader, FXAA.

For Windows, also add Alpha Correction and Logarithmic Z tooltips.

For Linux, add software mipmap tooltip.

Thanks to tsunami2311, ssakash, gregory38 and whoever did the wiki for
helping with descriptions.
2015-09-01 19:25:28 +01:00
Jonathan Li 55adc7e728 gsdx: tooltip description formatting and minor fixes
The hack description box messages were replaced by tooltips on Windows,
so there is no need for the first line in the description to refer to
the hack anymore.

3-state checkboxes were also converted to comboboxes, so remove any
references to checkbox states.

Reformat the descriptions so it looks okay on both Windows and Linux.
Could be better, but I'm out of ideas.

Also fix a few typos and missing punctuation.
2015-09-01 19:25:27 +01:00
Jonathan Li b687b106f1 gsdx: Removed unnecessary defines and functions
The changes to the Hacks dialog removes the need for these defines.

Also remove the swap_state function since it's now unused.
2015-09-01 19:25:26 +01:00
Jonathan Li c72b4d6e8a gsdx:windows: Rework hacks dialog to use tooltips
Changes the three-state checkboxes to comboboxes.
Removes the hack description box.
Hides Alpha and Alpha Stencil when OpenGL is selected.
Rearranges the hacks dialog.
2015-09-01 19:25:26 +01:00
Jonathan Li fcc8a941b0 gsdx:windows: Redo main dialog
This moves the hardware, non-renderer dependent options to the top and
makes the renderer options visible only when it affects the current
renderer.

The texture filtering checkbox has been changed to a combobox and now
uses the same description as Linux does.

Also changes the Title to GSdx Settings.
2015-09-01 19:25:25 +01:00
Jonathan Li e6b9805167 gsdx:windows: Show tooltips on main dialog 2015-09-01 19:25:25 +01:00
Jonathan Li 48bba4d581 gsdx:windows: Add tooltip support
Tooltips will be usable for all Gsdx dialogs if required.
2015-09-01 19:25:24 +01:00
Gregory Hainaut bdc8038e7e glsl: set a size to gl_ClipDistance array
The purpose is to avoid issue on MS-Intel driver without
a dedicated hack in the compilation.

Code doesn't use it so I suspect others implement to discard the
statement.
2015-08-25 18:58:39 +02:00
Gregory Hainaut a1957a685d glsl: drop an useless min in FS
GPU will clamp color anyway. It reduces the number of instruction of 25% (4->3)
2015-08-25 18:58:39 +02:00
Jonathan Li 6f6a7b92e4 gsdx:windows: Move CRC box to main dialog
The CRC hack option is always used regardless of whether the HW Hack
checkbox is ticked. Move it to the main gsdx dialog and make it use the
same descriptions that are used in Linux.

And fix the accurate_blend_unit whitespace formatting.
2015-08-23 14:04:09 +01:00
Gregory Hainaut bfadd884c9 glsl: expand tab into space
The mix of the 2 was awful
2015-08-22 13:34:02 +02:00
Gregory Hainaut a46c11b088 gsdx-ogl: delete various leftovers 2015-08-22 13:33:32 +02:00
Gregory Hainaut 7002ff3ec3 gsdx-ogl: move texture scale from vs_cb to fs_cb
It avoid useless update of the vs_cb.
2015-08-22 13:33:04 +02:00
Gregory Hainaut 499206f0ea gsdx-ogl: disable advance rendering when drivers don't support it 2015-08-22 12:22:35 +02:00
Gregory Hainaut d9cf326879 gsdx: windows requires a static cast 2015-08-22 12:22:35 +02:00
Jonathan Li 6e826d5193 Merge pull request #754 from ssakash/patch-45
gsdx: little changes on AF value behavior.
2015-08-21 11:29:49 +01:00
Akash 111653833f AF checkbox status depends on paltex.
according to some of the internal functions in GSDevice files, Anisotropic Filtering is only done when paltex is disabled. do the same on the GUI for user awareness.
2015-08-21 15:50:13 +05:30
Akash 3c9ca799a6 Remove anisotropic filtering checkbox value.
Removes the checkbox of Anisotropic filtering from the GSDX plugin settings, the checkbox was usually used to enable & disable the AF which is not necessary since there is an option in the drop down list for disabling AF.
the internal function value of "AnisotropicFiltering" has been replaced with "MaxAnisotropy" for detection.
the detection uses the function getconfig("MaxAnisotropy", value)  where value 0 means disabled and value is the default value when no value is set in the INI file.
2015-08-21 09:45:00 +05:30
refractionpcsx2 60a90aa51c GSdx-dx11: Another attempt at the nvidia hack, changing the viewport top left slightly also seems to alleviate the issue. Lets see how well this goes down.
At worst things will look zoomed out by like, a pixel :P
2015-08-20 23:45:26 +01:00
Gregory Hainaut 37f9bcf9cb gsdx-ogl: reduce state change
* don't dirty aref when a fog color is uploaded
* only set clamp mode in clamp mode (region clamp is handled in shader)

v2: fix SSE2/3 compilation
2015-08-20 23:01:43 +02:00
Gregory Hainaut c5a786ed2c gsdx-ogl: remove support WMS/T == 2 in hardware unit
I think behavior was wrong because only first texel coordinate was clamped.

Beside we can't interpolate if AEM isn't yet applied
2015-08-20 23:01:43 +02:00
Gregory Hainaut 53d1fdd8f1 glsl:debug: disable fst when testing texturing shader
Reduce clutter in ASM dump
2015-08-20 23:01:43 +02:00
Gregory Hainaut 78dd957717 gsdx-ogl: use normalized index coordinate for palette texture
In palette mode, 90% of texture accesses are done in 8 bits.
So let's keep this path as light as possible. It reduces GPU load.
2015-08-20 23:01:43 +02:00
Gregory Hainaut 42c08e6123 gsdx-debug: infinite replay for value > 90
Allow to use Nvidia debugger & give time to see the glitches
2015-08-20 23:01:20 +02:00
refractionpcsx2 561fa8a95e GSdx-dx: Workaround for NVidia Win10 Issues, possibly? at least seems to fix it.. 2015-08-19 23:01:39 +01:00
Gregory Hainaut 6b84a89b6a gsdx-ogl: remove old ati hack for point sampler
Was never used on openGL

In the future absolute coordinate will be use anyway
2015-08-18 19:09:45 +02:00
Gregory Hainaut ed21d88735 gsdx-ogl: add support of Intel GPU on Windows
It requires at least an Ivy Bridge GPU.
2015-08-18 19:06:43 +02:00
refractionpcsx2 8539805691 Merge pull request #690 from micove/VS_universal_sln
VS Now uses a universal solutions file - VS 2012 and below dropped due to incompatibility with C++11
2015-08-18 11:40:53 +01:00
refractionpcsx2 a4f8c6d5b3 Merge pull request #770 from micove/Lintian_Fixes
Fix things found using lintian by micove. Grammatical changes only.
2015-08-18 10:19:37 +01:00
Gregory Hainaut 37661f3a86 gsdx-ogl: fix blending regression (VP2)
Negative factor must be disabled in negative accumulation "-Cs*As + Cd"
Shader must output Cs*As and blending unit will do the Cd - C subtraction
2015-08-18 09:14:11 +02:00
Miguel A. Colón Vélez a1de0614d7 Remove vs2012 files.
It does not support several things from C99/C++11 that are
used in the project.
2015-08-18 01:15:51 -04:00
Miguel A. Colón Vélez f22bc63fee Disable 8,000+ warnings.
Someone can try renaming v,a,b,m,t but since they are
shadowed one mistakes can mess too much hence the warning.
2015-08-18 00:45:14 -04:00
Miguel A. Colón Vélez 277217353e Rename files. 2015-08-18 00:44:35 -04:00
Miguel A. Colón Vélez 1fe5aceded Enable round-tripping.
- Remove ToolsVersion
- Use $(DefaultPlatformToolset)_xp until XP support is dropped.
Note: opencl had no XP support and was not enabled in VS2012.
2015-08-18 00:44:19 -04:00
Miguel A. Colón Vélez f52988b93c Run devenv /upgrade
This ensures the solution can do round-tripping.
2015-08-18 00:44:02 -04:00
Miguel A. Colón Vélez 21c4e6caa6 Fix things found by lintian.
I: pcsx2: spelling-error-in-binary usr/lib/i386-linux-gnu/pcsx2/libGSdx-1.0.0.so allows to allows one to
I: pcsx2: spelling-error-in-binary usr/lib/i386-linux-gnu/pcsx2/libGSdx-1.0.0.so Allow to Allow one to
.
Apparently lintian checks grammar too (most common ones).
2015-08-17 22:00:07 -04:00
Gregory Hainaut 260c12756a gsdx-ogl: accelerate Cd - Cs * Alpha in sw blending
It is similar as Cd + Cs * Alpha except the operator

It would help to emulate other color clipping case correctly in basic
mode at full speed
2015-08-16 18:12:34 +02:00
Jonathan Li 6580f4922f gsdx-ogl: correct fbmask conversion on texture shuffle
Fbmask is RGBA8 and must be converted to RGB5A1
=> bit 31 must be moved to bit 15

Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-08-16 14:06:10 +02:00
Gregory Hainaut c32f1dfc23 gsdx-ogl: fix blend clear regression
Field selector are very dangerous to use.

Fix #764
2015-08-15 20:06:34 +02:00
Gregory Hainaut 0e3491bd58 gsdx-ogl: always do RW RT check
Jak uses it with triangle rendering.
2015-08-15 20:06:34 +02:00
Gregory Hainaut c7b2f9d1d2 gsdx-ogl: setup fbo to always write to first buffer
GL_NONE was kind of useless because nothing was attached anyway
2015-08-15 20:06:34 +02:00
Gregory Hainaut 87f497af0a gsdx-ogl: remove an useless variable 2015-08-15 20:06:34 +02:00
Gregory Hainaut 2e9ff045e1 gsdx-ogl: try another implementation for uniform buffer
It is slower but keep it for a bindless trial
2015-08-15 20:06:34 +02:00
Gregory Hainaut 3145031c05 gsdx-ogl: add glBindBufferRange function pointer 2015-08-15 20:06:34 +02:00
Jonathan Li 63c26c45ec gsdx: Clean up Wild Arms hack cruft
The Wild Arms Offset hack can only be on or off. There is no third
state. Convert the three-state checkbox into a two-state checkbox, fix
the description and remove a leftover.
2015-08-15 10:54:03 +01:00
Jonathan Li 1915bf1a61 gsdx:linux: Fix tooltip and clarify/fix 2 labels
Half-pixel offset option now uses the correct tooltip.
Offset Hack -> Half-pixel Offset Hack
Wild arm Hack -> Wild Arms Hack
2015-08-15 09:53:48 +01:00
Gregory Hainaut 87dcb9336f gsdx-ogl: don't bind the 0 texture to be compatible with the Nvidia debugger 2015-08-13 09:57:51 +02:00
Gregory Hainaut 84744d429e gsdx: allow to test glsl shader without replayer
This way users can test it too.
2015-08-13 08:48:05 +02:00
Gregory Hainaut 2f9d5334ee gsdx:EGL: prefer EGL over GLX + add some error messages 2015-08-13 08:48:05 +02:00
Gregory Hainaut 84e6fb45e8 gsdx-replayer:linux: allow to use env variable as default parameter
GSDUMP_SO <= the so plugin
GSDUMP_CONF <= the dir that contains the ini
2015-08-13 08:48:05 +02:00
Gregory Hainaut 6046d6c417 Merge pull request #749 from PCSX2/gsdx-micro-optimization
Gsdx micro optimization
2015-08-12 08:54:36 +02:00
Gregory Hainaut 98c74879bf Merge pull request #718 from PCSX2/depth-color-direct-write
Depth color direct write
2015-08-10 15:50:48 +02:00
Gregory Hainaut 0663501d6f gsdx-linux: disable perf monitor on release build
Code is rather slow on linux. Expect a 5-10% perf increase
2015-08-10 08:35:16 +02:00
Gregory Hainaut 9f92f63194 gsdx-ogl: Use GetAlphaMinMax to limit the scope of FULL accurate blending
Provide a massive speed up in this level.
2015-08-09 13:44:31 +02:00
Gregory Hainaut 61694013a5 gsdx-ogl: compact blending parameter structure
Save 656B of data. It is good for the cache.
2015-08-09 13:44:30 +02:00
Gregory Hainaut df3ade896b gsdx-ogl: use integer for blend factor
Integer argument&comparison might be lighter

V2: Forget to change one OMSetBlendState call
2015-08-09 13:44:05 +02:00
nE0sIghT e1272dc2f9 Use global compiler optimization flags instead of defining them for every plugin/binary 2015-08-08 16:25:17 +03:00
Gregory Hainaut 5b57405517 gsdx-ogl: blend management cleanup
* reorder the blend function
* remove OM bsel object
* add a bit to support pabe (miss the glsl part)
2015-08-08 09:18:09 +02:00
Gregory Hainaut 4d12410707 gsdx-ogl: latch constant buffer in rendering object
* Initialization of the object is done once
* Avoid to reupload it when an useless parameter toggle
 => -10% of UBO update
2015-08-08 09:18:09 +02:00
Gregory Hainaut bd0de8fbaf glsl: (colclip) HDR doesn't need wrapping neither clamping
Might save a couple of instruction in the PS
2015-08-08 09:18:09 +02:00
Gregory Hainaut 8a4c0e9782 cmake: drop extra alignment on GSdx
It requires extensive tests
2015-08-08 09:18:09 +02:00
Gregory Hainaut 1557f82b11 gsdx:clut: comment old unused clut code 2015-08-08 09:17:21 +02:00
Gregory Hainaut d822b6bd1a gsdx-ogl: add some comments for the future 2015-08-08 09:17:06 +02:00
Gregory Hainaut b17803bb34 gsdx-ogl: wipeout of GL_ARB_bindless_texture
Code is completely broken. It doesn't help to improve speed.

Remove 200 lines ;)
2015-08-08 09:16:49 +02:00
Gregory Hainaut b3919fde95 gsdx-linux: remove an old delay that pollute my benchmark mode
Also add a glFinish to ensure rendering is done
2015-08-08 09:16:13 +02:00
gabest11 d826d925db gsdx: eliminated a few bugs in the texture size changer algorithm 2015-08-07 02:08:29 +02:00
Jonathan Li c09501ad9a gsdx:linux: Add GSDrawingContext.cpp to CMakeLists.txt
Fixes the missing symbol error.
2015-08-06 18:17:28 +01:00
Gregory Hainaut 39ce8835f7 gsdx:linux: use unordered hash
It seems a bit faster on 'perf' tool
2015-08-05 22:55:12 +02:00
Gregory Hainaut 921b22ac31 gsdx-ogl: drop useless parameter of OMSetDepthStencilState 2015-08-05 22:55:12 +02:00
Gregory Hainaut b7e16b5989 gsdx-ogl: clean the blending management
Intially GSBlendStateOGL was an alias of the m_blendMapD3D9 array

The object was replaced by an index in the array. Save 2k of memory duplication.
And too much useless code.

v2: push/pop blending state in DATE stuff
v3: remove m_state which is useless now
2015-08-05 22:55:12 +02:00
Gregory Hainaut 717f0fcb4d gsdx-ogl: optimize fbmask setup 2015-08-05 22:55:12 +02:00
gabest11 49b3acea72 gsdx: texture size reduction in sw mode, fixes Stolen, less memory usage in general. 2015-08-05 19:11:41 +02:00
Gregory Hainaut 73e2ff6ff6 gsdx-ogl: change PrimitiveOverlap algo from O(n^2) to O(n)
+ only enable this optimization when it is useful (date or sw blending)

Less impact on the perf even for big vertex array
2015-08-05 17:59:55 +02:00
Miguel A. Colón Vélez 6462393aaf Introduce end-of-line normalization
Signed-off-by: Gregory Hainaut <gregory.hainaut@gmail.com>
2015-08-04 23:52:48 +02:00
Miguel A. Colón Vélez a42a236961 Gsdx: Move the stdext namespace declaration.
This will eventually lead to
error C2871: 'stdext' : a namespace with this name does not exist.
might as well fix it now.
2015-08-04 22:16:15 +02:00
Miguel A. Colón Vélez 30c6389ed9 VS2015: Fix compilation
Error   C2338   The C++ Standard forbids containers of const elements
because allocator<const T> is ill-formed. (compiling source file GS.cpp)
2015-08-04 22:16:04 +02:00
Miguel A. Colón Vélez d45676b478 Merge local changes to xbyak 4.84 2015-08-04 22:15:52 +02:00
Miguel A. Colón Vélez 41094ac22e Update from xbyak 4.00 to 4.84. 2015-08-04 22:15:46 +02:00
Gregory Hainaut 9d1674db99 gsdx-gui: remove useless linux ifdef 2015-08-04 22:08:55 +02:00
Gregory Hainaut 36554c3375 Merge branch 'hdr-colclip-32bits' 2015-08-04 21:55:40 +02:00
Gregory Hainaut 45bb27d6db gsdx-ogl: extend HDR colclip to 32 bits texture
Unfortunately 16 bits wasn't enough for Castlevania.
2015-08-04 21:54:27 +02:00
Gregory Hainaut c6ff7531fb gsdx-ogl: performance boost on virtuafighter 2015-08-04 21:26:03 +02:00
Gregory Hainaut d80aa0b0bd gsdx-ogl: remove 2 printfs
GL_INS is a better tracing solution
2015-08-04 20:47:02 +02:00
Gregory Hainaut 744f9ebc09 gsdx-ogl: rare corner case when both texture shuffle and date are enabled
In texture shuffle mode the texture data is either RG or BA. It means
that DATE must either checks MSB of G or A.

Close #693
2015-08-04 20:10:44 +02:00
Gregory Hainaut 6cb0443227 gsdx: disable depth rendering if rt == depth
I used to disable the RT but it doesn't work well with 50cents. It seems
texture writes weren't propagated correctly to the depth buffer. Besides
the game write an alpha value whereas depth is 24 bits only...
2015-08-04 19:39:29 +02:00
Gregory Hainaut 3784ea768f gsdx: check null pointer when doing a texture clear 2015-08-04 19:26:17 +02:00
gabest11 42f51591df gsdx: lupin 3 fix, texture addressing outside the limits, only for sw and opencl yet 2015-08-04 13:27:08 +02:00
gabest11 d631030608 gsdx: fixed some of the renames where it made no sense, also added a commend about lupin 3rd. 2015-08-04 03:36:42 +02:00
gabest11 e010004f1f gsdx: _isnan was not reliable, rewrote it as GSVector4::replace_nan, it uses cmpps and the result as the mask to blend the original value and FLT_MAX. No jumps or function calls. 2015-08-03 14:35:47 +02:00
gabest11 85117ecbdd gsdx: simplified isnan test, it compiles to an inline sse instruction and a flag test, silent hill dump still looks fine. 2015-08-03 11:27:14 +02:00
Gregory Hainaut 6e1cd077a9 gsdx-debug: push ubo in a group 2015-08-03 08:46:25 +02:00
Gregory Hainaut e972f4f4dd gsdx-ogl: extend device to support an offset for normal draw 2015-08-02 21:30:19 +02:00
Gregory Hainaut cabd7409e5 gsdx-ogl: don't validate the pipeline
Too noisy in debugger trace. Never catch any errors anyway.
2015-08-02 21:30:19 +02:00
Gregory Hainaut 59cdf77784 gsdx-ogl: create a new function to set the blending state 2015-08-02 21:30:19 +02:00
Gregory Hainaut 1da611fb75 gsdx-ogl: clean PS selector 2015-08-02 21:30:19 +02:00
gabest11 542dd33169 Merge branch 'master' of https://github.com/pcsx2/pcsx2 2015-08-02 20:27:33 +02:00
gabest11 a1a842b07f gsdx: date/datm fix for 16-bit frame buffer in sw rendering mode 2015-08-02 20:21:49 +02:00
Gregory Hainaut 8424c18e9f Merge pull request #688 from PCSX2/hdr-colclip
Hdr colclip
2015-08-02 18:13:28 +02:00
Gregory Hainaut 1f402b1b56 gsdx-ogl: fix bad detection of overlapping
avoid rendering corruption with SW blending
2015-08-01 13:29:25 +02:00
Gregory Hainaut ec007ac8d0 gsdx-ogl: support accurate blending without geometry shader
For the Mesa driver
2015-08-01 13:26:15 +02:00
Gregory Hainaut 4a3c145c72 gsdx-ogl: depth support: better support of 16 bits z buffer
Fix issue in socom2
2015-08-01 01:28:41 +02:00
Gregory Hainaut eb0fa8c7dc gsdx-ogl: fix bad detection of overlapping
avoid rendering corruption with SW blending
2015-08-01 01:27:22 +02:00
Gregory Hainaut 8452d2ccfe gsdx-ogl: fbmask regression! don't use bit operation with integer 2015-07-31 21:10:58 +02:00
Gregory Hainaut fff59f547d gsdx-ogl: fbmask regression! don't use bit operation with integer 2015-07-31 19:43:06 +02:00
Gregory Hainaut a0edcb58af gsdx-ogl: extend cclip blending level with destination alpha blending
The purpose is to emulate correctly destination alpha factor

An alpha channel of 128 is 1.0 in the GS but only ~0.5 in the GPU

I think few draw call use destination alpha so impact on perf must remains small.
2015-07-31 09:45:28 +02:00
Gregory Hainaut 97b38d9e1b gsdx-ogl: directly set impossible mode in the blending table
Avoid to hack it in the creation

Allow in the future to reuse the table directly instead of converting
in a blend object
2015-07-31 09:45:28 +02:00
Gregory Hainaut 8554f32086 gsdx-ogl: clean the blend table
Remove old shader define
Prefix macro with BLEND_
Add some notes to explain the special symbol
2015-07-31 09:45:28 +02:00
Gregory Hainaut cfd0fd6cc8 gsdx-ogl: remove old colclip algo 2015-07-31 09:45:28 +02:00
Gregory Hainaut 93c47feb7c gsdx-ogl: replace old colclip algo with the HDR algo
Similar speed but more accurate

Allow to clean the code
2015-07-31 09:45:28 +02:00
Gregory Hainaut 83f874db93 gsdx-ogl: remove bsel.ps
Just clear bsel.abe to disable blending
2015-07-31 09:45:28 +02:00
Gregory Hainaut 25298c70f7 gsdx-ogl: move blending management into a separate function 2015-07-31 09:45:28 +02:00
Gregory Hainaut 25bd5f5e85 gsdx-ogl: request texture barrier to emulate accurate date
Actually it can partially be done with GL_ARB_shader_image_load_store
extension. However all drivers that support shader_image have
texture barrier too.
2015-07-31 09:45:28 +02:00
Gregory Hainaut 2901e94ebc gsdx-ogl: always bind the RT as input texture
To avoid code duplication
2015-07-31 09:45:28 +02:00
Gregory Hainaut 1fe3e04ce3 gsdx-ogl: don't alias m_env/m_context variable
It is cumbersome to move code
2015-07-31 09:45:28 +02:00
Gregory Hainaut 8f27a5a92b gsdx-ogl: only enable fast accurate colclip in level3
Until we drop the old method
2015-07-31 09:45:05 +02:00
Gregory Hainaut 83dfc6b633 gsdx-ogl: clean a bit selector code
Use countof macro (avoid to duplicate the size)
Fix the size of array
Remove useless alpha_stencil case
2015-07-30 18:36:05 +02:00
Gregory Hainaut e026f1bac6 gsdx-ogl: implement a fast accurate colclip algo
The idea is to use a floating texture to accumulate the data and
then do a final postprocessing pass to apply the modulo

v2:
* use bounding box to
* fix vertex corruption issue
* use negative number in shader which allow to use half float (+12
  fps@4x)
2015-07-30 18:34:52 +02:00
Gregory Hainaut aa8f5848d1 gsdx-ogl: always issue a barrier when requested
Safer this way
2015-07-30 18:24:36 +02:00
refractionpcsx2 28fbae4791 gsdx-gui: Tidy up GUI options 2015-07-30 18:24:32 +02:00
Gregory Hainaut 88bd0996f5 gsdx-ogl: only print same tex/rt message when prims overlaps
Avoid most of the false positive
2015-07-30 18:24:32 +02:00
Akash 350e373e3f gsdx-gui: Remove Aggressive CRC hack.
The option is pretty much useless, CRC hack level controls the usage of hacks already.
2015-07-30 18:24:28 +02:00
Akash 68833e10d1 gsdx-gui: Accurate blending unit for Windows.
The following patch merges all the Accurate options related to the blending unit into a single one.
2015-07-30 18:24:19 +02:00
Gregory Hainaut d191ae4aba glsl: use rounding in convert 4 shader
It will avoid texture rouding error with negative number
2015-07-30 18:22:59 +02:00
Gregory Hainaut 7b9fa8fbe5 gsdx-ogl: add an assertion that will save me 2015-07-30 18:22:59 +02:00
Gregory Hainaut 46a1525668 gsdx-ogl: support various texture format creation
Such as GL_RGBA32F/GL_RGBA16F/GL_RGBA16UI/GL_RGBA16I/GL_RGBA16

Not yet used
2015-07-30 18:22:59 +02:00
Gregory Hainaut ee9edb0b19 gsdx-ogl: create a copy rect with conversion function
Previous CopyRect function does a memcopy without conversion.

This function will allow to use different format for input/output. Just a
possibility for the future
2015-07-30 18:22:59 +02:00
Gregory Hainaut ae8df002af gsdx-ogl: optimize Cs * As + Cd and Cs * Af + Cd blending
Basically the code does the alpha multiplication in the shader therefore
the blend unit only does a pure addition. This way the multiplication is
accurate and accurate_blending doesn't requires a costly barrier.

This code also avoid variable duplication to make the code more separated.
Hopefully blending can be done in a separated function

It is preliminary work to support fast color clipping with HDR

v2: fix assertion compilation failure

v3: fix regression in not accurate mode

v3: Cs * As/Af is not an accumulation

Those cases don't need the Cd addition and were already optimized anyway

Fix a regression on GoW2
2015-07-30 18:22:59 +02:00
Gregory Hainaut 12fdc37599 gsdx-ogl: reorganize blending in the renderer
Do DATE algo selection before blending. This way we can detect bad
interaction.

Regroup all blending/colclip in a single block.  Avoid to check abe &&
rt multiple times.

v2: only enable sw blending when abe is true
2015-07-30 18:21:01 +02:00
Gregory Hainaut caadc73e1b gsdx-ogl: add a new level for accurate blending
The updated medium level will run for all sprites. It helps sotc blooming effect and it remains
fast enough to be enabled by default (at least on 3D games)
The new high level will run for all sprites + color clipping
2015-07-30 18:21:01 +02:00
Gregory Hainaut 95c374bbcc glsl: Round 0.95+ to 1 for texel colors
It improves SotC blooming. Suikoden seems to be fine too.
2015-07-30 18:21:01 +02:00
Gregory Hainaut 01a1b1a5e6 gsdx-ogl: add the code to handle point and line in SW blending 2015-07-30 18:21:01 +02:00
Gregory Hainaut a85894e159 gsdx-ogl: move texture shuffle and fbmask into a dedicated function
DrawPrims is really too big now
2015-07-30 18:21:01 +02:00
Gregory Hainaut b632b2a478 gsdx-linux: add a new combo box to select the blend accuracy level 2015-07-30 18:21:00 +02:00
Gregory Hainaut 5c1b8986c6 gsdx-ogl: use SW blending when no barrier is required
Speed penality is small (only GPU) but it is more accurate
2015-07-30 18:21:00 +02:00
Gregory Hainaut 8c8fe633a5 gsdx-ogl: merge 3 accurate* option into a nice combobox
It is much easier to configure this way
2015-07-30 18:21:00 +02:00
Gregory Hainaut 8da63cf95a gsdx-ogl: try to enable sw blending for sprite rendering
The idea is that sprites are often use for post-processing effect (ofc except 2D games)

Most of the time post-processing supports SW blending with a small speed penality. SW
blending is more accurate so it is better to use it.
2015-07-30 18:21:00 +02:00
Gregory Hainaut f4e881ad30 gsdx: always set texture shuffle flag
Avoid bad effects in 16 bits RT games
2015-07-30 09:15:04 +02:00
Miguel A. Colón Vélez e4ab71abf3 Add authors comment that suggest public-domain license.
Sourceforge was dead for more than a week therefore add the license
information. I could not find the original TGM source (dead link) so I'm not
even sure if this still applies or if the glsl was totally rewritten. None
of the glsl files have a copyright header so it's hard to tell.
2015-07-27 14:21:29 -04:00
Gregory Hainaut f2c77ffa08 gsdx:tc: detect texture shuffle in previous frame
GoW2 uses the effect at the start of a new frame and therefore need the
state of the previous frame. (Note 1 issue remains)

Ricky need to be tested.
2015-07-26 10:14:07 +02:00
Gregory Hainaut cb4af8fe83 gsdx-ogl: small optimization for the GPU
Gain: 1% at 4x on SotC (it partially compensates recent additions)

When the color is constant and equal to 128, the MODULATE mode is
equivalent to the DECAL mode. It saves 5 instructions on the FS.
2015-07-21 08:19:36 +02:00
Gregory Hainaut 7ca463bf75 gsdx: NaN is likely not well supported for S & T
Add also a comment to explain the NaN issue on Q
2015-07-21 08:19:36 +02:00
Gregory Hainaut 223b7daa1d gsdx-ogl: fix fbmask regression
I forget to remove an useless 255.0f factor
2015-07-19 23:55:27 +02:00
Gregory Hainaut a54e636364 gsdx-linux: add a tooltip for the filtering option 2015-07-19 23:27:45 +02:00
Gregory Hainaut 5c740ff41e gsdx-ogl: wipeout AlphaStencil & Alpha hack
Accurate options do a better jobs. Technically it can still
be useful for old gpu/driver that doesn't support the GL4.5 extension.

On Windows, you can still rely on Dx

On linux, free driver support it (except Intel)
2015-07-19 22:43:48 +02:00
Gregory Hainaut 759e75091a gsdx-gui: yes openGL support correctly 8 bits texture 2015-07-19 17:29:25 +02:00
Gregory Hainaut 6719fc89a6 gsdx-sw: Nan is not well supported in Vertex
It fixes the bad light on Silent Hill with the SW renderer.

Full story
if Q is NaN, m_vt.m_eq.q becomes wrongly true
/Q will wrongly be optimized in the "Vertex Shader" of the SW

Note: Add an assert for the STQ handler

Code path is quite hot so no need to add extra check for nothing
2015-07-19 16:41:05 +02:00
Gregory Hainaut 7f76883b98 Merge pull request #658 from ssakash/patch-34
Add Accurate Frame Buffer mask for Windows [GUI] and remove some old options.
2015-07-19 09:07:13 +02:00
Gregory Hainaut 38c086008d glsl: round blending as SW renderer
Better tone on God of War with ultra accurate mode
2015-07-18 17:16:46 +02:00
Gregory Hainaut 88cd333839 gsdx-ogl: don't enable both HW&SW blending 2015-07-18 16:15:52 +02:00
Gregory Hainaut c4e165067d glsl: use signed integer when working with substraction...
It mostly fixes rendering of GoW with ultra blending

Color is still a bit wrong but rounding is likely incorrect
2015-07-18 14:41:03 +02:00
Gregory Hainaut c701ab4368 glsl: don't use normalized value for color range
Globally shader uses less intruction (except blending part)

It would also allow to improve the rounding of color
2015-07-18 14:41:03 +02:00
Gregory Hainaut 57394a03e0 partially revert: glsl: disable computing of extra alpha coeff in SW blending
It generates undefined data in screen. Maybe blending isn't switch off properly.
I need to investigate it.
2015-07-18 14:41:03 +02:00
Gregory Hainaut 5f5266ba45 gsdx-ogl-debug: don't optimize alpha channel in dump
Allow to dump AEM part of the shader
2015-07-18 14:40:57 +02:00
Gregory Hainaut 036cb229a3 glsl: add various comment for future idea
For example GL4 GPU supports special bit operation
2015-07-18 14:40:57 +02:00
Gregory Hainaut 6c1c857024 gsdx-ogl-debug: properly detect start of instruction in dump 2015-07-18 14:40:46 +02:00
Akash 37897eb922 add accurate framebuffer mask for windows. 2015-07-18 11:24:00 +05:30
Akash 7c4f3d28ce remove is_gsopen stuffs since old GUI is deprecated. 2015-07-18 10:50:34 +05:30
Gregory Hainaut 698dda2310 gsdx-ogl: remove subroutine from the gui too 2015-07-17 22:28:59 +02:00
Gregory Hainaut 36e83b42ce glsl: round texture and fragment color as the SW renderer
GS uses integer value and does integer operation too.

This commit trunc the sampled texture, the interpoled fragment color
and the product of the 2.

It impacts negatively the perf of about 3/4% (GPU) but it fixes rendering on
suikoden and potentially some others games too.
2015-07-17 21:08:49 +02:00
Gregory Hainaut 5f247a6e16 glsl: rewrite tfx function to ease future update
No need to put lots of ifdef, compiler will optimize everything
It increases a bit the readability
2015-07-17 21:08:49 +02:00
Gregory Hainaut ea9e608288 gsdx-ogl: fix texture palette mask 2015-07-17 21:08:49 +02:00
Gregory Hainaut b4c04ed00a gsdx-ogl: wipeout subroutine code
Code was completey bitrotten
Code was a partial test (and yet 500 lines already)
Shader is more and more complex and multithreading support greatly
reduce the cost of shader switch
2015-07-17 21:08:49 +02:00
Gregory Hainaut e3751f6cd9 glsl: disable computing of extra alpha coeff in SW blending
Hum, I'm curious of the impact to enable only this code when it is actually used.
2015-07-17 21:08:49 +02:00
Gregory Hainaut 784822a5c2 glsl: redo blending management to use A/B/C/D directly
1/ Code is much more readable
2/ It will allow to round differently the operation in the future
2015-07-17 21:08:49 +02:00
Gregory Hainaut e245b27c97 gsdx-ogl-debug: allow to dump various ps shader
Nvidia allows to get the ASM of the shader of the compiled shader. It is useful
to check the performance.

It also allow me to compile most of shader code path for QA

Dump is enabled in linux replayer + debug_glsl_shader = 2
2015-07-17 21:08:48 +02:00
Jonathan Li 6c300288f9 gsdx: windows: Make GSReplay work for OpenGL
On Windows, GSReplay does not work with the OpenGL hardware and software
renderer. Make it work.
2015-07-15 20:40:47 +01:00
Gregory Hainaut 6ed137dc9c gsdx-ogl: log openGL driver version 2015-07-13 12:35:55 +02:00
Gregory Hainaut c9d6ce3b63 Merge pull request #653 from PCSX2/texture-shuffle-again
gsdx: texture shuffle detection
2015-07-12 18:48:00 +02:00
Gregory Hainaut 8be32e4661 gsdx-tc: fix a memory leak when depth isn't fully supported
Fix issue #642
2015-07-12 17:57:42 +02:00
Gregory Hainaut f6f28042bd gsdx: texture shuffle detection
Don't check rt 32 bits state, it give false positive on suikoden
2015-07-12 15:21:04 +02:00
Gregory Hainaut c660ea858b gsdx: move some CRC hacks to full level 2015-07-11 15:14:11 +02:00
Gregory Hainaut 5f8d3b9e4b gsdx-tc: remains in the memory
avoid a crash with kungfu panda
2015-07-11 14:35:35 +02:00
Gregory Hainaut a4bad8fdbc gsdx-ogl: avoid a bad conflict between accurate option 2015-07-11 14:35:35 +02:00
Gregory Hainaut 15b934eb2a gsdx-ogl: remove useless colclip message 2015-07-11 14:35:35 +02:00
Gregory Hainaut 91fbe6f108 gsdx-ogl: add some code to fix black netting on some renderings
Code is not yet enabled because it requires extensive test

The idea is to replace point by a 1 pixels sprite with the help of
a geometry shader. In 4x, point will be replaced by a 4x4 sprite.
2015-07-11 14:35:35 +02:00
Gregory Hainaut 5e7ce63ed1 glsl: add a geometry shader to upscale GS_POINT
The purpose is to avoid upscaling issue on POINT rendering (black netting on some FMVs)
2015-07-11 14:35:34 +02:00
Gregory Hainaut 2ccf108534 gsdx-ogl: add back a selector for the Geometry Shader 2015-07-11 14:35:34 +02:00
Gregory Hainaut 7f7f6c3b51 Merge pull request #640 from turtleli/gs-frame-title-fixes
GS frame title fixes
2015-07-11 09:47:27 +02:00
Gregory Hainaut 5ed45b6806 Merge pull request #644 from PCSX2/improve-texshuffle-detection
Improve texshuffle detection
2015-07-11 09:34:33 +02:00
Gregory Hainaut ec61ad3667 gsdx-tc: Add some code for the future
Partially invalidate RT when there is a write in the middle of it (actually 2 pages below)

Code is not yet enabled because
1/ I want to stabilize latest update
2/ not sure of the impact of the code
3/ maybe it need a more generic version
2015-07-10 22:35:26 +02:00
Gregory Hainaut 5888913052 gsdx-debug: don't print any "notify" message
Too verbose
2015-07-10 22:35:26 +02:00
Gregory Hainaut 6f9a89dcf2 gsdx-debug: print memory usage of all textures pools
It is a bit crude but it allow to see the impact of code and options.
2015-07-10 22:35:26 +02:00
Gregory Hainaut 350db223d3 gsdx: only propagate texture shuffle detection if tex shuffle is detected 2015-07-10 14:06:39 +02:00
Gregory Hainaut 22f11958e9 gsdx: better detection of texture shuffle
Some effects were missed on Wallace & Gromit
2015-07-09 23:05:07 +02:00
Gregory Hainaut ad86bb5faa gsdx-tc: clear 32 bits state after vsync
Avoid issue on game that uses only 16 bits RT
2015-07-09 23:03:55 +02:00
Jonathan Li bff1b2a3bf GSdx: Show plugin info in title bar when paused
When GSdx is paused by opening the config panel, GSdx does not pass any
info back to PCSX2. Pass the plugin name and renderer even when paused.
2015-07-09 16:11:26 +01:00
Gregory Hainaut 4fcf460447 gsdx: fix DoC black screen video
The game also set both depth and rt buffer at the same location
but disable the depth test (ZTE is 0)
2015-07-09 16:20:43 +02:00
Akash a02a9aac8f Fix a Function name typo. 2015-07-07 21:26:04 +05:30
Gregory Hainaut 345efed473 Merge pull request #633 from ssakash/patch-22
Update the variable name and region of the CRC hack used for Superman
2015-07-07 15:27:08 +02:00
Akash f39aa181cc Update the variable name to suit the game's original name and change to accurate region of the game. 2015-07-06 00:59:35 +05:30
Gregory Hainaut 986754bde7 glsl: don't declare gl_FragDepth
Fix compilation issue on Mesa driver

(hope it doesn't break Catalyst)
2015-07-05 18:12:36 +02:00
Gregory Hainaut edc9d23566 gsdx: fix a crash with UserHacks_ColorDepthClearOverlap 2015-07-05 14:13:24 +02:00
Gregory Hainaut e1144d7a18 gsdx:hack: add a CRC for SuperMan
Extracted from the GS dump
2015-07-05 14:11:35 +02:00
Gregory Hainaut 95e1cd9ea8 gsdx-tc: don't considerer frame as a 32 bits RT
Frame is always 32 bits but game can reuse it later as a 16 bits RT.

Fix half screen issue with Ricky Ponting Cricket

Unfortunately it triggers texture shuffle wrongly. I hope there is no
regression.
2015-07-04 11:00:32 +02:00
Gregory Hainaut 8640b44e02 gsdx-hack: implement a hack for SuperMan (need CRC to enable it)
Fix depth issue.

First issue: RT and Depth are located at the same address.
=> solution, just lookup the depth (done for any games)

Second issue: Instead to draw a X,Y rectangle, they draw a 32 pix, 4096 pix
rectangle with a FBW of 1.
=> solution, don't bother just write the depth directly

Please someone add some CRC to enable the code
2015-07-04 10:59:21 +02:00
Gregory Hainaut 0a07762f6b gsdx-tc: only track 32 bits fmt if the texture is not a palette fmt
Fix a regression on ricky ponting cricket (texture shuffle was triggered without any valid reason)
2015-07-03 23:04:48 +02:00
Gregory Hainaut b9bc5b5c60 gsdx: add UserHacks_ColorDepthClearOverlap to test some new code
debug only
2015-07-03 22:13:35 +02:00
Gregory Hainaut 621d1d93db gsdx-linux: drop the logz option
logz will only enabled if GL_ARB_clip_control is not found.

Note: logz will likely break depth support. Be sure to use a recent driver
2015-07-03 21:29:49 +02:00
Gregory Hainaut 82ed6eac13 gsdx-linux: remove alpha hack from the GUI
Normally you don't need it anymore on OpenGL :)

You can still use this option from the ini file for debug purpose
2015-07-03 21:24:17 +02:00
Gregory Hainaut abec4bd760 gsdx-ogl: don't enable aout when using accurate fbmask 2015-07-03 21:21:56 +02:00
Gregory Hainaut d71b2c1ded gsdx: update accurate fbmask tooltip 2015-07-03 21:21:08 +02:00
Gregory Hainaut 4dbe71cba8 gsdx-ogl: disable SW blending when running DATE GL42
// GL42 interact very badly with sw blending. GL42 uses the primitiveID to find the primitive
// that write the bad alpha value. Sw blending will force the draw to run primitive by primitive
// (therefore primitiveID will be constant to 1)
2015-07-03 20:34:52 +02:00
Gregory Hainaut 705c88f193 gsdx-ogl: disable blending when cleaning integer texture
Avoid a warning message on Nvidia
2015-07-03 20:26:56 +02:00
Gregory Hainaut c6f026ee68 gsdx-tc: keep 32 bits status when converting from/to depth
Partially fix conan effect
2015-07-03 19:02:44 +02:00
Gregory Hainaut 0c12f232ca gsdx-ogl: don't write depth in first step of DATE 42
Fix shadows in Fifa
2015-07-02 21:08:47 +02:00
refractionpcsx2 193f47ebb1 Merge pull request #616 from ssakash/patch-22
swap value functions for Round sprite hack.
2015-07-02 19:33:03 +01:00
Gregory Hainaut 28815db7cc gsdx: fix depth option 2015-07-02 19:13:38 +02:00
Akash 6f515b220e update the description text 2015-07-02 01:39:55 +05:30
Gregory Hainaut de644c5437 Merge pull request #628 from PCSX2/gsdx-depth-and-16-bits-support
Gsdx 1.0
2015-07-01 20:50:09 +02:00