Commit Graph

4150 Commits

Author SHA1 Message Date
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