Commit Graph

4388 Commits

Author SHA1 Message Date
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
Gregory Hainaut bccc3ef253 Merge pull request #1770 from np511/gcc-cleanup
Cleanup GCC warnings - still needs some work
2017-01-30 15:28:33 +01:00
np511 e5e601eb75 Use GResources API instead of deprecated inline 2017-01-29 09:06:22 -05:00
np511 936d9edc4c Remove old/pointless code 2017-01-29 09:06:21 -05:00
np511 de6216b37b Remove warnings about ISO C++11 conformance 2017-01-29 09:06:10 -05:00
Gregory Hainaut 9393b20e13 Merge pull request #1791 from turtleli/remove-old-cdvd
Remove old cdvd plugins
2017-01-27 11:10:07 +01:00
Jonathan Li 754045b6f7 gsdx:windows: Remove SSSE3 and AVX configurations 2017-01-27 11:06:30 +01:00
lightningterror f0393e50c2 GSdx: Windows gui updates (#1768)
* Rename CRC Hack Level "Full (Safest)" to "Full (Direct3D Recommended)"
* add link/info of AMD driver epic fail status
2017-01-27 11:00:23 +01:00
Jonathan Li 625c4a9a05 Merge pull request #1751 from FlatOutPS2/Lily
LilyPad: Another GUI update and add more new functions
2017-01-27 00:22:44 +00:00
FlatOutPS2 8d00ae25c4 LilyPad: UI restructure
UI restructure and improvements.
2017-01-26 19:46:37 +01:00
FlatOutPS2 6074d60a90 LilyPad: Replace Turbo hack
The "L3 Toggles Turbo" hack has been removed and been replaced by a
bindable Turbo button on the Pad tabs. The Turbo function in the input
configuration has been renamed Rapid Fire.
2017-01-26 19:46:36 +01:00
FlatOutPS2 6e54dfe5ba LilyPad: Remove outdated hacks
Removes Ignore Key(hasn't functioned since LilyPad 0.9.9 (PCSX2 0.9.6)),
and "Send escape on window close" hack (unnecessary for PCSX2 and caused
issues with other emulators).
2017-01-26 19:46:36 +01:00
FlatOutPS2 9163ed351c LilyPad: Add Exclude Input option
This new option on the pad tabs disables an input so it will be ignored
when trying to bind another input. This is helpful when binding controls
for a device with an input that's difficult to center like an
accelerator, or just always active like a faulty button or analog stick.
2017-01-26 19:46:36 +01:00
FlatOutPS2 f8a79e5d40 LilyPad: Add neGcon support
Adds neGcon as a new pad type.

For use with several PS1 and PS2 games like the Ridge Racer and Ace
Combat series.
2017-01-26 19:46:19 +01:00
lightningterror 1cf30584f0 CP update
Replace Gregory's name with PCSX2 Dev Team
2017-01-26 17:12:13 +01:00
lightningterror 1ecb5aed0f Update Copyright v2
Revernt changes , update Gregory's name
2017-01-26 17:12:13 +01:00
lightningterror 0b93aa5d12 Revert "Update Copyright notices/disclaimers 2017"
This reverts commit fc5bdb771f.
2017-01-26 17:12:13 +01:00
lightningterror 3d4e1c1246 Update Copyright notices/disclaimers 2017
Update all Copyright notices/disclaimers in scripts to 2017
2017-01-26 17:12:13 +01:00
Gregory Hainaut 096c9316b8 gsdx cl: fix various compilation issues and a couple of warnings
I didn't fix all the warnings (purpose was to realign code with "recent" update)

Linux note: only miss 2 major items
* res/tfx.cl loading
* device descriptor
* And various bug fixes ;)
2017-01-24 19:38:31 +01:00
Gregory Hainaut d67b9cba14 gsdx tc: merge page coverage code
A function was already done for openCL. Use the same for others renderers
2017-01-24 19:38:16 +01:00
Gregory Hainaut 5c7c9452d6 onepad|gsdx: remove useless debug messages 2017-01-22 21:47:05 +01:00
Gregory Hainaut 1e7fd83ac5 gsdx|spu2x: fix %d/%u in printf (cppcheck) 2017-01-22 21:10:40 +01:00
Gregory Hainaut 077ae2e6a0 gsdx: use (void)(0) for empty statement
Reduce warning in cppcheck
2017-01-22 21:10:40 +01:00
Gregory Hainaut 1d2ce62b2c gsdx tc: comment dead code 2017-01-22 16:52:14 +01:00
Gregory Hainaut 701743a4ec gsdx boost queue: init all states 2017-01-22 16:43:35 +01:00
Gregory Hainaut 9183d1d2c6 gsdx osd: set m_face to null in case of error 2017-01-22 16:42:01 +01:00
Gregory Hainaut 9120c3bfb1 onepad: init all fields of objects 2017-01-22 16:34:27 +01:00
Gregory Hainaut 33a7672196 spu2x: use default contructor of the compiler 2017-01-22 16:06:54 +01:00
Gregory Hainaut 81adc3ef4d gsdx ogl: don't use per buffer blending
It increases the number of state that driver must handle.
2017-01-20 18:22:52 +01:00
Jonathan Li 03acb22212 plugins: Remove cdvdlinuz
Superseded by PCSX2 internal ISO reader and cdvdGigaherz.
2017-01-20 00:04:14 +00:00
Jonathan Li 9b110d8c3c plugins: Remove CDVDisoEFP
Superseded by PCSX2 internal ISO reader and cdvdGigaherz.
2017-01-20 00:04:14 +00:00
Jonathan Li cb64cb6abe plugins: Remove CDVDiso
Superseded by PCSX2 internal ISO reader.
2017-01-20 00:04:14 +00:00
Jonathan Li 6aef44271e plugins: Remove CDVDolio
Superseded by PCSX2 internal ISO reader and cdvdGigaherz.
2017-01-20 00:04:14 +00:00
Akash 0d659a1b46 GSdx: Improve captured screenshots naming
Previously, when F8 was triggered multiple times in a single second, the latest captured image would replace the previous captured one as it has the same name as the previous image.

The following patch detects such cases and adds a number along with the filename when new image capture is requested under the same time as the previous capture.
2017-01-19 23:47:34 +00:00
Gregory Hainaut 21612cafc1 Merge branch 'greg/mtvu-mtgs-lockless' 2017-01-18 19:12:26 +01:00
Gregory Hainaut e4f4350bb4 boost ring queue: dedicate cache line for atomic variable
Bad for data cache ! But it might be better for atomic operation.
2017-01-18 19:07:01 +01:00
Gregory Hainaut 8779583bdb boost ring queue: use % to wrap the index
For power of 2, it is replaced with a single and instruction. If it potentially faster
than branch. But it worths a benchmark
2017-01-18 19:07:01 +01:00
Gregory Hainaut 725aaccf5c boost ring queue: extend the interface to ease replacement of dequeue class in core 2017-01-18 19:07:00 +01:00
FlatOutPS2 fffd829f88 Revert "gsdx tc: partial support of pseudo depth for Dx"
This reverts commit
d6383e6c21

It created a regression in Everybody's Golf 4/Hot Shots Golf 4, breaking the renderering when depth emulation is disabled/when using a Direct3D Hardware renderer.
2017-01-16 19:15:46 +01:00
Gregory Hainaut f9c2025149 gsdx tc: avoid any pitfall with 1 << 31
Based on Turtleli feedback
"1 << 31 is undefined in C++11, but defined in C++14"
2017-01-15 20:11:34 +01:00
Gregory Hainaut 87cf7b6d30 gsdx tc: implement a safe RemoveAt
The code is now a mirror of the ::add. So 1 insert == 1 erase

This way it won't crash on future update. And it will support future GS
memory wrapping improvement.
2017-01-15 20:11:34 +01:00
Gregory Hainaut d1315b6187 gsdx tc: save list iterator to allow fast removal
ZoE2:
RemoveAt overhead plummet to 0.5%. It was 17% !

However insertion is a bit slower. Due to the begin() after the push_front

v2: use std:: for lists and arrays
2017-01-15 20:11:34 +01:00
Gregory Hainaut 87fc4c1e44 gsdx tc: skip draw call when input texture can't be fetched
Avoid garbage on Full Spectrum Warrior
2017-01-15 20:09:39 +01:00
Gregory Hainaut 2f972b91a3 gsdx tc: allow a hit on older depth buffer
Avoid an issue when rendering take some shortcut (Full Spectrum Warrior)

Close #1757
2017-01-15 20:09:39 +01:00
FlatOutPS2 3acac3203b GSdx: Remove/move CRC hacks
Removes Alpine Racer 3 hack. Issue has been resolved.

Moves NanoBreaker hack. Issue has been resolved for OpenGL and hack has
been moved to DX only.

Moves Tri-Ace games hacks. Hacks are also necessary for OpenGL with "Partial" CRC Hack Level to prevent massive slowdown.

Move Tales Of Legendia hack back as it's also necessary for OpenGL with "Partial" CRC Hack Level to prevent graphical issues.
Close: https://github.com/PCSX2/pcsx2/issues/1698

Added PAL and NTSC-U CRC's for Ar tonelico II.
2017-01-15 20:07:10 +01:00
Jonathan Li 52ec143a92 gsdx:windows: Fix deprecated ATL attributes warning 2017-01-13 23:52:25 +00:00
Jonathan Li fe1947ea48 gsdx: Fix minor user visible typos
Well. it should be better; but my grammar is questionable at times,
2017-01-13 23:52:02 +00:00
Gregory Hainaut 8cf3a83dd7 gsdx: try to ask GCC to generate not dumb code
Unfortunately it requires at least GCC6. If a nice guy can check the generated code on GCC6.
I don't know clang status.

Here the only example, I have found on the web
https://developers.redhat.com/blog/2016/02/25/new-asm-flags-feature-for-x86-in-gcc-6/

Current generated code in GSTextureCache::SourceMap::Add

    38b3:	bsf    eax,esi
    38b6:	add    esp,0x10
    38b9:	test   esi,esi
    38bb:	jne    387e <GSTextureCache::SourceMap::Add(GSTextureCache::Source*, GIFRegTEX0 const&, GSOffset*)+0x6e>

BSF already set the Z flag when input (esi) is 0. So it would be better
to not put a silly add before the jump and to skip the test operation.
2017-01-11 21:36:05 +01:00
Gregory Hainaut 1fbee92044 gsdx tc: add a comment for a potential "ASM" optimization
I'm not sure it worth it yet. But a generic function would be nice for
future.
2017-01-11 20:13:53 +01:00
Gregory Hainaut ced2dd9200 gsdx: hidden option disable_hw_gl_draw
OMG, Zone of Ender got a speed boost from 11 fps to 45 fps

Seriously, the goal is to allow benchmarking GSdx without too much overhead of the main renderer draw call

Note: unlike the null renderer, texture/vertex uploading, 2D draw, texture conversions are still done.
2017-01-11 18:54:36 +01:00
Gregory Hainaut 6dabc68c16 gsdx linux gui: compact the GUI for Nx768 display (seriously guy it is time to upgrade !)
* move the post-processing frame into the OSD tab
* Rename Global Settings to Renderer Settings
* put monitor and indicator check box on the same line

At least we have a similar number of options by tab
2017-01-11 18:32:02 +01:00
Gregory Hainaut f5fbfe98bd gsdx: fix warning: variable ‘success’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] 2017-01-11 18:23:34 +01:00
Jonathan Li 791dc84d49 gsdx:gtk: Update GUI
Set slider ranges to 0-100, which matches what Windows uses.
Add OSD maximum log messages option and tooltips.
2017-01-10 20:47:33 +00:00
FlatOutPS2 6a7c38f30d GSdx: Minor update to GS Settings Dialog
Update a few parts of the GS Shader dialog to reflect the improvements
from the OSD dialog code.
2017-01-10 20:07:29 +00:00
FlatOutPS2 da57014eb8 GSdx OSD: Add Windows UI and new option
Adds Windows UI and option to limit the amount of log messages on the
screen at the same time/in the buffer.
2017-01-10 20:07:29 +00:00
refractionpcsx2 b02cc6ecbe Whoops, over zealous with removing things. 2017-01-09 22:37:15 +00:00
refractionpcsx2 b0baa8d8f9 Revert CLUT change, seems it causes more problems than it solves. Leaving the comment for future investigation 2017-01-09 22:30:54 +00:00
Gregory Hainaut 7c4a952ee0 Revert "gsdx tc: always clear a new depth buffer"
This reverts commit f77c1900fa.

Conflicts:
	plugins/GSdx/GSTextureCache.cpp

Another fix was done later for Jak cut scene (or FMV). One game got a regression (don't remember which)
2017-01-09 10:21:23 +01:00
Gregory Hainaut 3fab287e8d onepad: don't load joyid_map from the ini
Old option from the older GUI can cause issue.

Close #1139
2017-01-07 16:38:13 +01:00
Jonathan Li c2e21fa30e gsdx: Don't use atomic for exit variable
All accesses are protected by locks, so there's no need for it to be
atomic.
2017-01-07 13:54:45 +01:00
Jonathan Li cb2c9ce4e6 gsdx: Don't use separate count variable
It's only ever updated after the queue is updated, so its state will
always lag slightly behind it. It's sufficient to just use empty().

This seems to fix some caching issues that were noticeable on Skylake
CPUs (#998).
2017-01-07 13:54:45 +01:00
Jonathan Li a583fafa37 gsdx: Use lock instead of loop to terminate threads 2017-01-07 13:54:45 +01:00
Jonathan Li b244de73ca gsdx: Use separate mutex for waiting
In the previous code, the worker thread would notify the MTGS thread
while the mutex is still locked, which could cause the MTGS thread to
wake up and immediately go back to sleep again since it can't lock the
mutex.

Use a separate mutex for waiting, which avoids the issue.
2017-01-07 13:54:45 +01:00
Akash 09c72375ab GSDX: Pass total height of framebuffer on GetOutput()
Some PSX games seem to store image data of the drawing results in an undeterminate area out of range from the current context buffer. At such cases, calculate the height of both the frame memory rectangles combined.

What happens on "Crash bash" -

* At first draw, scissoring is limited to SCAY0- 0 & SCAY1- 255
* At second draw, scissoring is limited to SCAY0- 255 & SCAY0-511

Previously, we limited the height to the value of one single output texture, so instead of that let's calculate the total height of both the two buffers combined to prevent such issues.
2017-01-04 22:17:26 +05:30
refractionpcsx2 98e8d93fa3 Merge pull request #1728 from ssakash/custom_regression
GSDX-TextureCache: Fix corner cases on custom resolution scaling
2017-01-04 16:21:18 +00:00
Jason Brown fce2814735 Added callbacks for OSD Log and Monitor. Added wrappers in PCSX2 main for callbacks. Added some basic info calls (e.g. Saving loading FPS) 2017-01-03 10:43:56 +01:00
Jason Brown 248ad0ddde Added config page to linux setting dialog 2017-01-03 10:43:56 +01:00
Jason Brown b8a84d170a Added OSD Manager which depends on FreeType2. Added functions into GSDeviceOGL to render OSD and a point shader. 2017-01-03 10:43:56 +01:00
Jason Brown 4c084391fc Changed the GSBufferOGL interface from map and upload to map and unmap. This allows rendering directly into the OGL buffer instead of having to do copy at some point. 2017-01-03 10:43:56 +01:00
FlatOutPS2 048b657c8f GSdx: Prevent FMV crash
Fixes FMV crashing PCSX2 in The Simpsons: Road Rage.
2017-01-03 00:46:38 +01:00
Akash 6c521c36dd GSdx-TC: Remove some old hacks
Previously, we only calculated the width of a single output circuit which lead to missing a single pixel from the other output circuit which in turn causes offset issues in Persona games, I have customized GetDisplayRect() to now also calculate the dimensions of the merged rectangle when both the output circuits are enabled through the PMODE register, so this hack is no longer needed. :)

TL;DR - The above commit of mine accurately handles the offset issues by calculating union of the rects, removing this stupid hack. (not insulting any other developers, this stupid hack was mine :)
2017-01-02 14:43:17 +05:30
Akash b56ff3fce7 GSDX-TC: Pass merged output size for scaling
Passes the merged output circuit as the base size for texture cache scaling code. Helps fixing scaling issues where games use both of the output circuits for rendering.

Future Note: Alter the behavior of IsEnabled() check always preferring the second output circuit for some weird reason. I plan on changing it to a better auto-output circuit selection mechanism but that could probably be done some time in the future.
2017-01-02 14:42:32 +05:30
Gregory Hainaut 9d1b27cde8 miss a ;
I don't know what I compiled for my previous push !
2016-12-31 17:42:38 +01:00
Gregory Hainaut 1be3f48017 gsdx sw: minor fix on the thread management
* Upgrade the counter to signed 32 bits. 16 bits is too small to contains the 64K value.
* Read ThreadProc/m_count when the mutex is locked
* Use old value of the fetch instead to read back the new value
2016-12-31 16:59:38 +01:00
Gregory Hainaut 14a76a8499 cmake: don't use SSE2 suffix on libgsdx.so file
In debug build, SIMD is disabled, so it is dangerous (use wrong binary) to debug
2016-12-31 13:37:43 +01:00
refractionpcsx2 7a61dc2c88 GSDX: CLUT temp old regression fix for the Romance of the Three Kingdoms games, until somebody who knows what they are doing fixes it properly :P 2016-12-30 22:00:54 +00:00
refractionpcsx2 8fecd3512c refractionpcsx2
GSdx Merge Circuit: Fix regression and issue
2016-12-27 12:08:18 +00:00
Akash 8038ce1aa9 GSDX: Cleanup warnings on MSVC (#1694)
Explicitly cast some bitfields/local loop variables to uint8 as these functions have uint8 as the parameter datatype.
2016-12-21 23:21:07 +00:00
FlatOutPS2 9b6c3bd106 GSdx Merge Circuit: Fix regression and issue
Avoids graphical issues in EA NASCAR games and a regression in Time Crisis 2/3 split screen mode.
2016-12-21 01:28:43 +01:00
Jonathan Li 5a63a62454 cdvdgigaherz: Fix read past the end of the buffer 2016-12-19 23:56:48 +00:00
Jonathan Li f2edc50675 cdvdgigaherz: Improve prefetch logic
Avoid reading past the end of the disk.
Avoid waiting when there are prefetches remaining.
Fix the maths so that the first prefetch after a request attempts to
read the next block of sectors and not the block of sectors that was
just read (which will just be skipped anyway because the data has just
been cached).
Avoid potential prefetch after disk is swapped (though disc swap doesn't
work properly if you just eject and insert a different disk).
Stop prefetching on disk read failure (Suikoden hits this case - 2048
byte reads are requested, but only 2352 byte reads will succeed).

Also reduce the read retry count to 2.
2016-12-19 23:56:48 +00:00
Jonathan Li c1160f40d0 cdvdgigaherz: Rename variables/parameters in cdvdDirectReadSector
s/sector/sector_block
s/first/sector
2016-12-19 23:56:48 +00:00
Jonathan Li 3f89f4bd32 cdvdgigaherz: Use constant for sectors per read 2016-12-19 23:56:48 +00:00
Jonathan Li 0708d7c539 onepad: Fix variable type
Fixes a type limits warning on a 64-bit build.
2016-12-18 14:32:13 +00:00
Jonathan Li 61669d1f3f gsdx:png: Fix accidental resource leak
Oops.

Unfortunately it'll reintroduce the clobbering warning on gcc 4.9.
2016-12-12 23:08:30 +00:00
Jonathan Li b178423166 gsdx-replayer:cmake: Reduce build time/filesize
Avoid building GSdx twice if the replayer is being built.
2016-12-12 18:54:54 +00:00
Jonathan Li 2c3fd160c3 gsdx-replayer:linux: Fix strict-aliasing warnings
Use a reinterpret_cast instead of casting the function pointer address
to a void** and dereferencing it.

Also remove an unnecessary (void) and avoid including stdafx.h.
2016-12-12 18:14:38 +00:00
Jonathan Li d4a6e18c01 gsdx:png: Fix gcc clobber warnings
Don't adjust 'image' and just use an additional offset.
'success' was kinda unnecessary when true or false could just be
directly returned.
Move 'compression' clamping out to GSPng::Save instead.

And throw in a whole bunch of const for good measure.
2016-12-12 17:39:05 +00:00
FlatOutPS2 947b6b5503 LilyPad: Add Device Select option
Adds a device select option that hides bindings and disables binding new
inputs from all non-selected devices on the bindings list. This also
avoids input conflict issues when one controller is recognized as
several devices through different APIs.
2016-12-10 12:16:44 +00:00
FlatOutPS2 872ab9d2b1 LilyPad: Add Configure on bind option
Part of the GUI update, this function switches to the configuration page
immediately after binding an input instead of staying on the bindings
page.
2016-12-10 12:16:44 +00:00
FlatOutPS2 1f8608f6dd LilyPad: GUI update
Updates the UI by reducing the height of the plugin window. This has
been achieved by removing some buttons below the diagnostics and
bindings list and incorporating those functions into the
lists(accessible by right-clicking in the list). The binding
configurations on the Pad tabs have been moved to a separate page, like
the Forcefeedback bindings, to separate the configuration from the
bindings.
2016-12-10 12:16:44 +00:00
FlatOutPS2 deaceb6b08 LilyPad: Add skip deadzone option
Adds a skip deadzone option to the Pad tabs.

With the normal deadzone, if the control input value is below the
deadzone threshold, the input is ignored.
However, some controllers also benefit from shortening the input range
by skipping a deadzone.
2016-12-10 12:16:44 +00:00
Akash 61a6fe9cd9 GSDX: Apply saturation only to interlaced video mode
JMMT uses a bigger display height on NTSC progressive scan mode, which is not really unusual hence adjust the saturation hack to only take effect on interlaced NTSC mode.

However, the whole double screen issue on FMV still exists. As a bit of information, this game has the second output disabled but seems to have some valid data inside of it, maybe the second output data is leaked into the first one? most likely a bug in the frambuffer data management rather than a CRTC issue (needs to be investigated)
2016-12-10 11:29:10 +01:00
Gregory Hainaut 0453e5cad8 cmake: improve vtune integration
Year is included in the path so search in order 2018/2017/2016

Not ideal but at least all logic is inside the FindVtune module
2016-12-09 09:28:19 +01:00
Akash 07d7905896 GSDX: Fix output texture height calculation
Previously, the height of the frame offset was also considered for the total height of the texture which was obviously wrong as the portion before the offset value isn't part of the frame memory.
2016-12-08 22:14:05 +01:00
Jonathan Li ac78688a32 gsdx: Make GSJobQueue non-inheritable
In the previous code, the threads were created and destroyed in the base
class constructor and destructor, so the threads could potentially be
active while the object is in a partially constructed or destroyed state.
The thread however, relies on a virtual function to process the queue
items, and the vtable might not be in the desired state when the object
is partially constructed or destroyed.

This probably only matters during object destruction - no items are in
the queue during object construction so the virtual function won't be
called, but items may still be queued up when the destructor is called,
so the virtual function can be called. It wasn't an issue because all
uses of the thread explicitly waited for the queues to be empty before
invoking the destructor.

Adjust the constructor to take a std::function parameter, which the
thread will use instead to process queue items, and avoid inheriting
from the GSJobQueue class. This will also eliminate the need to
explicitly wait for all jobs to finish (unless there are other external
factors, of course), which would probably make future code safer.
2016-12-08 01:18:17 +00:00
Jonathan Li cdeed349e3 gsdx: Replace platform-specific threads with std::thread
GSThread now doesn't seem to have a purpose, so it's been removed.
2016-12-08 00:36:32 +00:00
Jonathan Li 592d4b024a cdvdgigaherz:linux: Swap Ok and Cancel button order
This now matches the usual GTK GUI button order.

Also bump the version number.
2016-12-07 01:40:44 +00:00
Jonathan Li 1d634f9b44 cdvdgigaherz:linux: Use pread instead of lseek + read
It'll make it unnecessary to use a lock when reading disc sectors.
2016-12-07 00:54:11 +00:00
Gregory Hainaut 704776027b gsdx linux: update gui to add a HPO v2 checkbox
Sort std hack & upscaling hack
2016-11-29 17:22:02 +01:00
Gregory Hainaut a95adcb999 gsdx-ogl: correct texture coordinate by 0.5 when vertex position is -0.5
Avoid ghosting in Captain tsubasa
2016-11-29 17:22:02 +01:00
Gregory Hainaut 61a7c747e1 gsdx-ogl: alternate implementation of half pixel offset
The previous implementation of HPO adds an offset on vertex position. It
doesn't always work beside it moves the rendering window.

The new implementation will add a texture offset so that instead to sample
the middle of the GS texel, we will sample the middle of the real texture texel.

It must be manually enabled with
* UserHacks_HalfPixelOffset_New = 1 (keep a small offset as intended by GS effect)
* UserHacks_HalfPixelOffset_New = 2 (no offset)

v2: always apply a 0.5 offset in case of float coordinates (Tales of Abyss)
Might break other games but few of them uses float coordinates to read
back the target
2016-11-29 17:22:02 +01:00
Gregory Hainaut c2229e3c0b gsdx-ogl: add a texture offset uniform parameter to vertex shader
It would be used for a new implementation of the half pixel offset hack

Hopefully it doesn't badly impact the perf on low end iGPU
2016-11-29 17:22:02 +01:00
Gregory Hainaut f6cad2235b gsdx: defer GSScanlineConstantData init
Avoid AVX instruction in the middle

Issue #1677
2016-11-28 19:40:25 +01:00
Gregory Hainaut c9db1c6c4b vtune: plug PCSX2 core + add missing profiling (VU/VIF/TLB)
Doesn't fully work yet
* Unknown stack frame
* Outside any known module

Potential root cause:
* Nvidia driver
* VU code as ebp is required for emulation so likely no frame
2016-11-28 19:07:04 +01:00
Gregory Hainaut e4516ac9b8 cmake: add extra SSE4 and AVX2 build of GSdx when DISABLE_ADVANCE_SIMD is enabled
It will provide a speed boost on distribution that only enable SSE2
2016-11-25 16:35:40 +01:00
Gregory Hainaut 8431299b92 gsdx sw: port code to the new constant object 2016-11-24 23:03:26 +01:00
Gregory Hainaut 3b5bc9c38d gsdx sw: create a constant buffer
* Use POD type to avoid SSE/AVX compilation dependency
* global object to reduce cache miss
* dynamically object so give a chance to allocate below 2GB (allow x64
  optimization)
2016-11-24 23:03:26 +01:00
Gregory Hainaut 0f5529be18 gsdx sw: s/g_cpu/m_cpu/ 2016-11-24 23:03:25 +01:00
Gregory Hainaut c3e38e46c7 gsdx sw x64: disable mipmap support on AVX
Until it is implemented (might never happen)
2016-11-24 23:03:25 +01:00
Gregory Hainaut 608bb5ccb2 gsdx sw x64: add AVX2 implementation for VS
FS was copied from 32 bits (require massive update)
2016-11-24 23:03:25 +01:00
Gregory Hainaut 15220c386a gsdx sw x64: setup prim miss some optimizations 2016-11-24 23:03:25 +01:00
Gregory Hainaut e3bfa2be88 gsdx sw: factorize common draw scanline code
Ymm inherite from Xmm so it is useless to duplicate the code

Add a parameter to alltrue to test the good register
2016-11-24 23:03:25 +01:00
Gregory Hainaut 211c7745de gsdx: don't try to correct depth in primitive trace
Avoid to go above the maximum size allowed by the format

Issue #1674
2016-11-24 22:24:00 +01:00
FlatOutPS2 417d0a3606 GSdx Merge Circuit: Fix regressions
Fixes screen shaking in Tenchu: Wrath Of Heaven, and graphical issues in
NASCAR 09.
2016-11-23 22:14:44 +01:00
Jonathan Li 483b3d6368 cdvdgigaherz: Avoid holding lock during thread sleep
Fixes Coverity CID 127721: Program hangs

Change the sleep to a condition variable wait, which has the added
benefit of allowing the plugin to close ever so slightly faster if
there's no disc in the drive.
2016-11-22 21:26:41 +01:00
Jonathan Li 29c2ccb310 cdvdgigaherz: Use a queue to manage sector requests
Fixes a data race.

Also avoid copying from the cache when it's unnecessary to do so.
2016-11-22 21:26:41 +01:00
Jonathan Li 3919a32dc3 cdvdgigaherz: Avoid race condition by reading from cache/disk
Instead of reading from a buffer shared by multiple threads, just read
the correct data from the cache or disk instead.
2016-11-22 21:26:41 +01:00
Jonathan Li 31b0b53394 cdvdgigaherz: Read correct sector type in keepalive thread
It'll prevent errors messages when raw sector reading is used.
2016-11-22 21:26:41 +01:00
Jonathan Li a34942c882 cdvdgigaherz: Only update cache if the read succeeds 2016-11-22 21:26:41 +01:00
Jonathan Li bb25ce1c6a cdvdgigaherz: Add cache entry check function
Useful when you don't actually want the cached data.
2016-11-22 21:26:41 +01:00
Jonathan Li 23f48e07ed cdvdgigaherz: Change signs
Avoid some unnecessary casting.
2016-11-22 21:26:41 +01:00
Jonathan Li 008fea5d89 common|cdvdgigaherz: Fix API sign mismatch
The typedef and function declaration don't quite match.
2016-11-22 21:26:41 +01:00
Gregory Hainaut 0d275868a5 gsdx x64: quick fix for windows
Until we got a full implementation
2016-11-21 18:18:09 +01:00
Gregory Hainaut 37379d5d1d gsdx sw x64: shuffle memory allocation
tex address is a3
vm address is a1

Could help to avoid REX prefix
Reduce prologue/epilogue register copy

Byte code size 41893 => 38912 (on my testcase)
2016-11-20 20:19:13 +01:00
Gregory Hainaut b76305a0d2 gsdx sw x64: keep the copy of top in the stack for dthe
An extra stack access by pixel won't impact perf (only 16 bits game with dithering)
Allow to save 2 registers (a1/a3)
2016-11-20 20:19:13 +01:00
Gregory Hainaut 994274623b gsdx sw x64: use rip addressing on draw scan line
byte code 41997 => 41893

However it will allow to save 2 registers as future optimization
2016-11-20 20:19:12 +01:00
Gregory Hainaut 7c06e87d59 gsdx sw x64: use rip addressing on setup prim
byte code: 9017 => 8736

Save a register
2016-11-20 20:19:12 +01:00
Gregory Hainaut 923c297dfc gsdx sw: vinsert128 opcode require an XMM register
Reported as an error on lastest Xbyak
2016-11-20 20:19:12 +01:00
Gregory Hainaut e674518c4e Update from xbyak 4.84 to 5.11
* bin2hex.h is removed
* vptest/vpblendvb YMM support integrated upsteam
* better support of rip for 64 bits
* AVX512 support (only miss the CPU now)

Local change: add BSD3 clause
2016-11-20 13:21:11 +01:00
Gregory Hainaut 681c09f25c gsdx sw: catch xbyak exception 2016-11-20 12:58:07 +01:00
Gregory Hainaut 0fd5346860 gsdx x64 linux: only mmap in lower 2GB code segment
Allow to use rip addressing
2016-11-20 10:38:15 +01:00
Gregory Hainaut 2252ba1bb7 gsdx: add the detected ISA on the name
As a SSE build could potentially uses AVX operations.
2016-11-20 10:38:15 +01:00
Jonathan Li ef25502491 gsdx build: don't exclude AVX files.
Thanks for the patch :)
2016-11-19 17:01:36 +01:00
Gregory Hainaut cc6d193e1d gsdx: Relax SSE/AVX constraint on 64 bits
The JIT will automatically select the best ISA (only AVX1 so far)
2016-11-19 17:01:29 +01:00
Gregory Hainaut 8fd46e96aa gsdx sw JIT: dynamically select ISA for SetupPrim 2016-11-19 17:00:33 +01:00
Gregory Hainaut 574a2c774e gsdx sw JIT: dynamically select between AVX1 and SSE code path (scanline) 2016-11-19 17:00:33 +01:00
Gregory Hainaut 6b78b8f9ce gsdx sw JIT: dynamically select SSE41 at runtime even on SSE2 build (scanline)
It won't give the full SSE41 speed boost but it is better than nothing
2016-11-19 17:00:33 +01:00
Gregory Hainaut 322473c295 gsdx sw: add a code example for gather instruction
It will requires a generic (register naming) linear interpolation to use it properly
Gather instruction requires an extra mask register therefore all registers name will be shuffled

Perf wise, initial haswell implementation seems to be microcode emulated.
2016-11-19 17:00:33 +01:00
Gregory Hainaut 2e20693583 gsdx sw x64: restore read texel optimization 2016-11-19 17:00:33 +01:00
Gregory Hainaut e728a14c19 gsdx sw: factorize color split in split16_2x8 2016-11-19 17:00:33 +01:00
Gregory Hainaut d58e43edbf gsdx linux: plug vtune as Windows 2016-11-19 17:00:32 +01:00
Gregory Hainaut 8abf242e2c gsdx: small x64 printf warning fixes 2016-11-19 17:00:32 +01:00
Gregory Hainaut 051c5c4bf7 gsdx sw x64: small stack optimization on linux
mov with the stack pointer require less bytecode
2016-11-19 17:00:32 +01:00
Gregory Hainaut 141c9e9c86 gsdx sw x64: prefer faster 32 bits operation when possible 2016-11-19 17:00:32 +01:00
Gregory Hainaut a281bda9a6 gsdx sw x64: port the scanline generator on AVX
Based on Gabest's work.

* Miss mipmap

Note: dithering info
It is a bit tricky as a2 on linux was rdx register which overlap with fzm (dh/dl)
It might require dedicated windows code
2016-11-19 17:00:32 +01:00
Gregory Hainaut 8e29e09943 gsdx sw x64: update setup prim generator x64 SSE&AVX 2016-11-19 17:00:32 +01:00
Gregory Hainaut 4a47224ac1 gsdx: define the linux x64 ABI 2016-11-19 17:00:32 +01:00
Gregory Hainaut e31ce87bb3 gsdx: SW JIT debug helper
Allow to compare 32/64 bits (and all ISAs too)
Allow to breakpoint (int3)
Print selector info
Print size of buffer and start (disabled by default)
2016-11-19 17:00:32 +01:00
Gregory Hainaut 633f7a1db9 xbyak: add int3 instruction
Very useful to stop the JIT
2016-11-19 17:00:32 +01:00
Gregory Hainaut 43b4cfc215 gsdx: separate dump directory for 32/64 bits 2016-11-19 17:00:32 +01:00
Gregory Hainaut 82d12691e1 gsdx: properly check SSE support
1/ Check all "levels"
2/ requires AVX for 64 bits
2016-11-19 17:00:32 +01:00
FlatOutPS2 8db9a27970 fix2 2016-11-14 13:55:55 +01:00
FlatOutPS2 d1788ac1e9 fix 2016-11-13 10:56:35 +01:00
FlatOutPS2 de8d3fb1eb LilyPad: Add PS mouse support
Adds Playstation Mouse as a new pad type.

For use with PS1 games only.
2016-11-13 01:23:59 +01:00
FlatOutPS2 a3478e02f4 LilyPad: Add tooltips (#1653)
Adds informational tooltips to several UI options.
2016-11-12 23:52:56 +00:00
Jonathan Li f513ca2a28 cdvdgigaherz:linux: Check ioctl return value
Fixes Coverity CID 172718: Unchecked return value

Also avoid adding the sector leadout descriptor info to the TOC since it
actually isn't used.
2016-11-12 23:28:17 +00:00
Gregory Hainaut 49d5c4260f gsdx state: post fix depth tracing
The main FindMinMax methods is perf critical so instead I created a separate function
to ensure the constness of the depth

Fix letter regression on Xenosaga3
2016-11-11 23:39:34 +01:00
Jonathan Li 1530effb29 gsdx: Catch bad_alloc exceptions 2016-11-09 22:41:02 +00:00
Jonathan Li ae6f26f3ef gsdx: Skip texture cache read if any dimension is 0
Fixes a crash at the PSX logo if either the DX9 or DX11 hardware
renderer is used.
2016-11-09 22:39:53 +00:00
Gregory Hainaut f3e1ba5251 onepad gui: always assume rumble is supported on the GUI
close #1497
2016-11-08 21:23:56 +01:00
Gregory Hainaut 31b32d3b11 gsdx linux: don't require to hit enter for Texture Offset text entry
close #1292
2016-11-08 20:28:42 +01:00
Gregory Hainaut ed3052dea5 gsdx: remove various assertion
Useless or wrong assertion
2016-11-08 18:58:10 +01:00
Jonathan Li a283e95fed cmake: Add cdvdgigaherz and dependencies
Only new dependency is libudev.
2016-11-07 00:08:23 +00:00
Jonathan Li 16b6cc41a4 cdvdgigaherz:linux: Add config and GUI code 2016-11-07 00:08:23 +00:00
Jonathan Li 747f4dc3fe cdvdgigaherz:linux: Add initial IOCtlSrc implementation 2016-11-07 00:08:23 +00:00
Jonathan Li f13f50779c cdvdgigaherz: Export plugin interface when using gcc/clang 2016-11-07 00:08:23 +00:00
Jonathan Li 363b581926 cdvdgigaherz: ifdef Windows specific stuff 2016-11-07 00:08:23 +00:00
Jonathan Li 1573f513ce cdvdgigaherz: Move lba_to_msf to header
Also use proper inline keyword.
2016-11-07 00:08:23 +00:00
Jonathan Li ae0577bc16 cdvdgigaherz: Fix write-strings warnings
Too bad I can't change PS2Edef.h to use a const char*.

Also remove SVN_MOD ifdef from version string.
2016-11-07 00:08:23 +00:00
Jonathan Li cccf216dbb cdvdgigaherz: Use C++11 threads instead of Win32 threads 2016-11-07 00:08:23 +00:00