Commit Graph

4450 Commits

Author SHA1 Message Date
Brett Lawson
49cb58e864 Added some helpful assertions to wfunc_call. 2016-06-25 04:16:25 -07:00
Brett Lawson
67348549c1 Updated libcpu to handle fibers switching between cores. 2016-06-25 04:16:25 -07:00
Brett Lawson
7266a25be9 Implemented Contains method for our Queue altering function. 2016-06-25 04:16:25 -07:00
Brett Lawson
3a336711e2 Inject some NOP's at the beginning of JIT instruction stream.
This is neccessary to allow debuggers to sync their displays
up to the correct location in the instruction stream.
2016-06-25 04:16:25 -07:00
Brett Lawson
f802f04c1d Make sure CPU tracing functions are included in all builds. 2016-06-25 04:16:24 -07:00
Brett Lawson
ece258aa56 Added some host stack tracing functionality to libcommon. 2016-06-25 04:16:24 -07:00
Brett Lawson
59c1de200a Don't crash when printing traces without tracing. 2016-06-25 04:16:24 -07:00
Brett Lawson
25ea79e1c7 Implemented active thread checking on reschedule. 2016-06-25 04:16:24 -07:00
Brett Lawson
2b54b3e5ad Implemented a stub for GX2CalcColorBufferAuxInfo 2016-06-25 04:16:24 -07:00
Brett Lawson
7dcf6be411 Improve StackObject's error message to include addresses. 2016-06-25 04:16:24 -07:00
Brett Lawson
a059af8299 Ensure that thread-id's are assigned atomically. 2016-06-25 04:16:24 -07:00
Brett Lawson
2e713d4f40 Disable asynchronous FS for now as it breaks ShoKni. 2016-06-25 04:16:23 -07:00
ImaProgrammer
c87cfc34c4 Changed NULL in FiberEntryPoint to nullptr 2016-06-24 22:47:36 +12:00
James Benton
5aa2cd814e gx2: Add missing enum values for GX2AAMode. 2016-06-24 11:35:45 +01:00
James Benton
a0e9486d92 gx2: Rename gx2::internal::isInited to isInitialised. 2016-06-24 02:13:42 +01:00
James Benton
5ed453032d Fix alphabetical order in gx2_enum. 2016-06-24 02:13:41 +01:00
Brett Lawson
cc3e12df30 Properly implement fully asynchronous file system operations. 2016-06-23 17:56:42 -07:00
Brett Lawson
e46494e044 Use memory hashing to decide whether to reupload a texture to GPU. 2016-06-23 03:43:09 -07:00
Brett Lawson
e7fe7bd62c Do not overwrite cpuMemEnd every time a surface is fetched. 2016-06-23 03:43:05 -07:00
Brett Lawson
c06fd669c7 Improve warning message for GX2Invalidate on GPU memory. 2016-06-23 03:43:00 -07:00
Brett Lawson
71ada94a7c Update the JIT runtime to avoid using a mutex unless needed.
Previously the runtime would lock a mutex any time an allocation
was neccessary.  I have updated this such that it only locks the
mutex if there needs to be more memory allocated.  This should
improve JIT performance considerably for code which requires many
JIT generation cycles.
2016-06-23 03:42:55 -07:00
Brett Lawson
b77ead2de6 Enable the TV. We've always indicated it is disabled.
Interestingly, most games still render to the TV even if there
is no TV connected.  More recently tested games actually wait
for the TV to be turned on though.
2016-06-23 03:42:51 -07:00
Brett Lawson
f155b02c6e Fix GX2WaitForFlip so that if there are no flips, it returns.
This is how gx2.rpl appears to handle the case where the user
calls GX2DrawDone, and then immediately calls GX2WaitForFlip.
In this case, we block until after the flip, which means no
more flips are pending or will ever occur.
2016-06-23 03:42:46 -07:00
Brett Lawson
426b6bd488 Do not crash if user calls GX2Invalidate before GX2Init.
In a real WiiU, invalidation occurs outside the scope of the PM4
stream.  For us we shove it in there, but before GX2Init there is
no command buffers allocated, so we crash.
2016-06-23 03:42:41 -07:00
Brett Lawson
b70303d8cd Handle some common 'edge-case' symbol types so they don't log errors. 2016-06-23 03:42:28 -07:00
Brett Lawson
43c5bd89d0 Added some better error logging to the loader. 2016-06-23 03:42:15 -07:00
Brett Lawson
3ee1f9e70c Add glFinish to decafSwapBuffers so we don't trample our buffers.
If a buffer was mapped and used in the current frame, and we allow
the GPU to start processing the next frame before we OpenGL completes
we may trample data still pending to be used by the previous frame
before the host GPU is able to read it out.
2016-06-23 03:31:17 -07:00
Brett Lawson
f60249c700 Write a debug marker when we swap our scan buffers.
This should probably be made into a configuration option
in the future along with a whole bunch of other useful
markers like GX2Invalidate, GX2Set___Shader, pretty much
anything that passes information pointing to CPU memory.
2016-06-23 03:31:17 -07:00
Brett Lawson
35aad14817 Ensure SRESET is always received and handled. 2016-06-23 03:31:16 -07:00
Brett Lawson
7349f87c82 Added support for PM4 debug markers to correlate CPU and GPU. 2016-06-23 03:31:16 -07:00
Brett Lawson
6d82d53dd5 Implemented memory invalidation for textures. 2016-06-23 03:31:15 -07:00
Brett Lawson
837c2765e7 Fix issue with shaders that were sourced from gx2r buffers. 2016-06-23 03:31:15 -07:00
Brett Lawson
23cea13491 Fix error with automatic index ordering.
Who knows why this was set to invert the ordering, I
checked the 3 games that 'run' on Decaf and they all
work with the correct ordering.
2016-06-23 03:31:15 -07:00
Brett Lawson
fca38448c3 Include better error messages when shaders are not configured. 2016-06-23 03:31:14 -07:00
Brett Lawson
06b79abeb9 Properly handle SAMPLE instruction masking.
Previously we were generating the masks backwards, where
the fetch mask and store mask were inverted.  This fix
also tries to fix masking cases.  More work needs to be
done on this as noted in the TODO comment in TEX.
2016-06-23 03:31:14 -07:00
Brett Lawson
5f9f9fb00d Fix VS samplers being sourced from PS sampler registers. 2016-06-23 03:31:13 -07:00
James Benton
f8d398bf1d opengl: Remove unused AttributeBuffer->stride. 2016-06-22 12:30:43 -07:00
Brett Lawson
21b98ab1f3 #152 Use PA_CL_CLIP_CNTL to control Z range.
This commit also properly handles the remaining clip control
registers which are set by the GX2 clip control function.
2016-06-22 02:46:32 -07:00
Brett Lawson
1b9c0afef0 Refactor CPU breakpoints to avoid share_ptr.
Note that this means that we leak memory if breakpoints are
used now.  This is a neccessary tradeoff for performance at
the moment.  In the future we can use instruction invalidation
and powerpc breakpoint instructions.
2016-06-21 02:21:58 -07:00
Brett Lawson
2356a0112d Fix build error caused by recent tracer changes. 2016-06-21 01:18:00 -07:00
Brett Lawson
928823e6cd Remove tracer offsetof hack.
It is no longer needed now that the CPU register file
is stored as a separate structure now.
2016-06-21 14:12:33 -07:00
Brett Lawson
50af6faacd Better handle different sizing cases for Copy__ToScanBuffer. 2016-06-21 14:12:32 -07:00
Brett Lawson
758f1c5abf Fail instead of crashing when a shader stage is missing. 2016-06-21 14:12:32 -07:00
Brett Lawson
0c54fcf6ef Handle the creation of memory for some additional texture dims. 2016-06-21 14:12:32 -07:00
Brett Lawson
971f47d91a Fix Access Violations to point NIA to the right instruction. 2016-06-21 14:12:31 -07:00
Brett Lawson
764af90d8b Fix bug causing thread spinlock counter to be inaccurate. 2016-06-21 14:12:31 -07:00
Brett Lawson
46696a7245 Implement FSGetAsyncResult using new OSMessage handling. 2016-06-21 14:12:30 -07:00
Brett Lawson
05d9b5fcfa Add missing instruction lwsync (lightweight sync) to CPU. 2016-06-21 14:12:30 -07:00
Brett Lawson
a908b990f8 Update FSxxAsync to use App I/O threads for callbacks. 2016-06-21 14:12:29 -07:00
Brett Lawson
761e6e2a13 Implement App I/O threads. 2016-06-21 14:12:29 -07:00