Commit Graph

8850 Commits

Author SHA1 Message Date
Gregory Hainaut 5cf2688c0c common: remove useless x86_intrin.h
Yeah one less licence in the project :)
2016-07-22 18:47:51 +02:00
Gregory Hainaut 7d35e15fea Merge pull request #1444 from PCSX2/atomic-relax
Atomic relax
2016-07-22 18:36:02 +02:00
Gregory Hainaut 0f62bccb0b Merge pull request #1470 from ssakash/spu2_x_nitpicks
SPU2-X: Align GUI elements on debug dialog
2016-07-22 18:18:20 +02:00
Gregory Hainaut 9182a287e2 Merge pull request #1469 from PCSX2/valgrind-memleak
Valgrind memleak
2016-07-22 18:17:37 +02:00
Akash 8e2b19ada7 SPU2-X: Align GUI elements on debug dialog 2016-07-22 19:29:45 +05:30
Gregory Hainaut 55a408edad debugger: init resolvePointerStrings to a default value
Fix valgrind issue:

==3560== Conditional jump or move depends on uninitialised value(s)
==3560==    at 0x81F7949: CtrlRegisterList::OnDraw(wxDC&) (CtrlRegisterList.cpp:291)
==3560==    by 0x47826DE: wxAnyScrollHelperBase::HandleOnPaint(wxPaintEvent&) (in /usr/lib/i386-linux-gnu/libwx_gtk2u_core-3.0.so.0.2.0)
==3560==    by 0x4785969: wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) (in /usr/lib/i386-linux-gnu/libwx_gtk2u_core-3.0.so.0.2.0)
==3560==    by 0x426CA0E: wxEvtHandler::SafelyProcessEvent(wxEvent&) (in /usr/lib/i386-linux-gnu/libwx_baseu-3.0.so.0.2.0)
==3560==    by 0x4710BAE: wxWindowBase::HandleWindowEvent(wxEvent&) const (in /usr/lib/i386-linux-gnu/libwx_gtk2u_core-3.0.so.0.2.0)
==3560==    by 0x44EF67D: wxWindow::GTKSendPaintEvents(_GdkRegion const*) (in /usr/lib/i386-linux-gnu/libwx_gtk2u_core-3.0.so.0.2.0)
2016-07-22 10:13:54 +02:00
Jonathan Li fee374b0e9 Merge pull request #1462 from turtleli/tidy-vs-projects
Tidy Visual Studio project files
2016-07-22 00:30:52 +01:00
Jonathan Li 259a39ef0c windows: Update VS solution configurations
Use portaudio devel build for devel config - it fixes a warning that
occurs due to incompatible linker settings (incremental vs whole program
optimisation)

Also add 64-bit configurations.
2016-07-21 23:59:41 +01:00
Gregory Hainaut 53a70d9018 onepad: use modal dialog instead of frame
Avoid various pitfall such as #1387

v2:
* use stack object
2016-07-21 09:51:16 +02:00
Gregory Hainaut 1e3c46a6bb gsdx ogl: purge debug message in destructor
Allow to see latest error and avoid noise in Valgrind log
2016-07-21 09:51:16 +02:00
Gregory Hainaut b6a55f50ab gsdx ogl: fully initialise PSConstantBuffer structure 2016-07-21 09:51:16 +02:00
Gregory Hainaut b322ef286e CDVD: initialize a temporary buffer
I'm not sure to understand why Valgrind reports it as we populate the buffer
during the ReadAsync. Maybe Valgrind doesn't like async IO from the kernel.

In doubt, the init will avoid those warnings

==19897== Thread 6 EE Core:
==19897== Conditional jump or move depends on uninitialised value(s)
==19897==    at 0x80FE9E1: BlockdumpFileReader::DetectBlockdump(AsyncFileReader*) (BlockdumpFileReader.cpp:40)
==19897==    by 0x8109EE5: InputIsoFile::Open(wxString const&, bool) (InputIsoFile.cpp:229)
==19897==    by 0x810939E: ISOopen(char const*) (CDVDisoReader.cpp:57)
==19897==    by 0x810194E: DoCDVDopen() (CDVDaccess.cpp:359)
==19897==    by 0x80B651C: SysCorePlugins::OpenPlugin_CDVD() (PluginManager.cpp:1219)
2016-07-21 09:51:16 +02:00
Gregory Hainaut 3c0a97354c pcsx2:linux: leaking allocation isn't necessary 2016-07-21 09:51:15 +02:00
Gregory Hainaut 8b91aefd49 gui: add a destructor to CtrlRegisterList object
So we can free allocated memory
2016-07-21 09:51:15 +02:00
Gregory Hainaut 11e5fe8879 pcsx2 gui: fix a pseudo memory leak on SavestateEntryPack
It is a pseudo leak as it is a global object. Nevertheless it pollutes
the valgrind log.

v2:
* use an array of unique pointer
* use ArraySize instead of a constant
2016-07-21 09:50:28 +02:00
trostboot dbda9292d8 Add EE clamp modes for Shadow Hearts (#1463)
GameDB: Full EE clamping is required in Shadow Hearts for characters to appear correctly in
various scenes throughout the game.
2016-07-20 11:56:10 +01:00
Jonathan Li e271932f41 bin2cpp: Tidy VS project
Group common properties. This removes some of the optimisation
properties, which aren't really essential since bin2cpp is only used as
a tool to convert images to header files.
Add 64-bit configurations.
2016-07-19 23:25:12 +01:00
Jonathan Li e25e8bc580 plugins: Tidy/standardise VS projects
Combine all the different configurations together so the project files
are more generic and maintainable.

Also standardise the layout so all the project files will be similar and
all have the same standard elements (even if empty).

Add 64-bit configurations.

Additional specifics:
spu2-x: FLOAT_SAMPLES preprocessor definition removed since it's unused.
2016-07-19 23:25:12 +01:00
Jonathan Li f8605dda61 common|pcsx2: Tidy/standardise VS project
Combine all the different configurations together so the project files
are more generic and maintainable.

Also standardise the layout so all the project files will be similar and
all have the same standard elements (even if empty).

Add 64-bit configurations.
2016-07-19 23:25:12 +01:00
Jonathan Li 97e268e5a5 3rdparty: Tidy/standardise VS projects
Combine all the different configurations together so the project files
are more generic and maintainable.

Also standardise the layout so all the project files will be similar and
all have the same standard elements (even if empty).

Add 64-bit configurations.

Additional specifics:
wxWidgets: Common stuff into the property sheets.
pthreads: Fixes the LNK4068 warning.
portaudio: Devel config added.
libjpeg: Non-existent file removed.

Side note: libjpeg is barely used - wxWidgets uses it but doesn't have
to, ZeroGS uses it but we don't develop that anymore.
2016-07-19 23:25:12 +01:00
Jonathan Li 7c3cee0624 spu2-x: Rearrange lowpass.cpp header order
It allows VS to use the precompiled header for that file too.
2016-07-19 23:25:12 +01:00
Jonathan Li 296ef4184f 3rdparty: Use SolutionDir instead of SvnRootDir in property sheet
It's part of Visual Studio, and more importantly, I don't need to
specify a build output directory in the libpng project file.
2016-07-19 23:25:12 +01:00
Jonathan Li 7277074d9e windows: Fix incremental linking property sheet
Don't use "-dbg" target suffix - both Devel and Debug builds use the
property sheet, so it's incorrect.

Also don't set optimise references to false - it's incompatible with
incremental linking and causes compile failures.
2016-07-19 23:25:12 +01:00
Lena 5a17b95901 x86_intrin.h: fix build using GCC (#1468)
__GNUG__ is not defined while compiling this file,
this causes the build to fail.

Replacing this with __GNUC__ fixes this.
2016-07-19 23:13:24 +01:00
Akash 1e92c24847 SPU2-X: Convert inline assembly to intrinsics (#1464) 2016-07-19 23:11:12 +01:00
ramapcsx2 ddc68626d8 Merge pull request #1442 from ssakash/Counters
PCSX2-Counters: Improve video mode detection
2016-07-18 19:28:24 +02:00
Gregory Hainaut e680a90e90 Merge branch 'intrinsic-cleanup' 2016-07-17 11:33:06 +02:00
Gregory Hainaut 6e306ee44f common: move _xgetbv with cpuid intrin
Besides, code comes from Gabest and not reactOS
2016-07-17 10:25:00 +02:00
Gregory Hainaut e872552fdc spu2x|common: s/jASSUME/pxAssume/ allow to remove code and __debugbreak intrinsic 2016-07-17 10:24:29 +02:00
Gregory Hainaut c56ca4a0fa common: include cpuid.h on unix
I tested both clang and gcc.
2016-07-17 10:24:29 +02:00
Gregory Hainaut f9ebc0ba70 Merge pull request #1459 from frantisekz/master
Degrade GTK3 Fatal Error to Warning
2016-07-15 09:35:36 +02:00
Gregory Hainaut 25bc2dff07 gsdx: dump and log EE texture read
It gives a visual opportunity to detect a bad read of the texture cache
2016-07-14 19:45:06 +02:00
Gregory Hainaut f76bf9dddc gsdx: dump and log EE texture read
It gives a visual opportunity to detect a bad read of the texture cache
2016-07-14 19:41:21 +02:00
Gregory Hainaut 10ea05bc6f common: remove old atomic wrapper
Use cross-platform std::atomic instead
2016-07-14 18:29:41 +02:00
Gregory Hainaut 812e41d578 common: relax atomic of m_IsBeingDeleted
Avoid the memory fence in the constructor
2016-07-14 18:29:41 +02:00
Gregory Hainaut 086dfc8a14 gsdx sw: use acquire/release semantics for atomic operation
* Avoid the generation of memory barrier (mfence)
2016-07-14 18:29:41 +02:00
Gregory Hainaut 567976e822 MTVU: port vuCycles to std::atomic
V2: use relaxed order as the variable doesn't carry load/store dependency
It is only used as a counter for the speed hack
2016-07-14 18:29:41 +02:00
Gregory Hainaut 3f0655c821 MTVU: port write pointer to atomic and optimize atomic access
Write pointer can be relaxed-read from the EE thread
Read pointer can be relaxed-read from the VU thread

Warning: AtomicExchange calls were replaced by release-store
However AtomicExchange generates a memory barrier (at least on linux)
So either it is useless and it will be faster, or it will explode ;)
2016-07-14 18:29:41 +02:00
Gregory Hainaut ca46921796 MTVU: use acquire/release semantics for atomic operation
* Avoid the generation of memory barrier (mfence)
* Based on the fact that it used to work on previous code without any
  barrier

v2:
* keep basic code in reset path
* use relaxed access for isBusy. The variable doesn't carry load/store
  dependency but is instead an hint to optimize semaphore post
2016-07-14 18:29:40 +02:00
Gregory Hainaut 3b4c357aaa MTGS: avoid a potential very rare deadlock 2016-07-14 18:29:40 +02:00
Gregory Hainaut 4cdf05efac MTGS: use private member for RingBufferLock
Easier to understand the purpose of the 2nd lock
2016-07-14 18:29:40 +02:00
Gregory Hainaut 5913ff1bd8 MTGS: port read/write pointer to full atomic + optimize atomic access
Read pointer is only written by the MTGS thread so it can be relaxed-read
by the MTGS thread

Write pointer is only written by the EE thread so it can be relaxed-read
by the EE thread

Remove volatile stuff
2016-07-14 18:29:40 +02:00
Gregory Hainaut 6fb7beb58a MTGS: use acquire/release semantics for atomic operation
* Avoid the generation of memory barrier (mfence)
* Based on the fact that it used to work on previous code without any
  barrier

v2:
* keep "slow" and safe atomic on reset path
* use relaxed atomic for m_RingBufferIsBusy
The signal doesn't carry dependency with others load/store. Instead it is used
as an hint to awake the semaphore
As a side, there is a potential thread bug

T1 do
* wait sema
* busy = true;
* while (!queue.empty) do work...
* busy = false;
* go back to wait sema

T2 do
* post sema even if busy is false

If T1 stop after the while queue but before the busy, T2 won't post the
event. When T1 will wake up, it will block on the semaphore
2016-07-14 18:29:40 +02:00
Gregory Hainaut d855bc5ca8 gsdx sw: improve exit condition of SW extra thread
Use a relaxed atomic to read the exit variable in the hot path

Wait that exit is deasserted in the destructor, so we are sure the
thread will "soon" return
2016-07-14 18:29:22 +02:00
Gregory Hainaut abc9f7d096 gsdx tc: log unsupported LookupDepthSource 2016-07-14 18:29:22 +02:00
František Zatloukal 2c74ff1e54 Degrade GTK3 Fatal Error to Warning 2016-07-13 02:08:14 +02:00
ramapcsx2 093704f073 Merge pull request #1456 from NZJenkins/master
Zero out the skip bp
2016-07-12 12:15:09 +02:00
NZJenkins b491f5cdc5 Zero out the skip bp
Fixes #1453
2016-07-12 17:51:56 +12:00
Gregory Hainaut e642bbc426 gsdx sw: add extrathreads_height to control the quantity of pixels processed by a thread
Value could range from 1 to 9. Default is 4 and it is potentially the
best option.  Feel free to test some values on your system, behavior
might depends on the core number and thread number

Value is exponential so 4 is 2 times more pixels than 3.

Small value increased thread overhead, big value increase wait/sync latency
2016-07-10 17:48:10 +02:00
Gregory Hainaut 91eccb7bab gsdx sw: increase the size of the ring buffer 256 => 65536
memory overhead by thead is only 256KB

However it will reduce the probability to block the push thread to nearly 0

I tested a couple of dumps and only manage 4000 element with 1 extrathread.
2016-07-10 10:49:06 +02:00