Commit Graph

4450 Commits

Author SHA1 Message Date
James Benton
8ca28654b5 glsl: Add new line after gl_PerVertex struct. 2016-07-05 11:25:25 +01:00
James Benton
9351d2637a glsl: Only use op2.SRC{0,1}_ABS when it is an OP2 instruction. 2016-07-05 11:17:03 +01:00
James Benton
40919b2dd9 opengl: Remove unused Texture struct. 2016-07-05 11:08:53 +01:00
Brett Lawson
a503649f54 Remove unused shader compilation variable. 2016-07-05 00:29:08 -07:00
Brett Lawson
7fcf27b367 Improve shader PPC->Host mapping to account for non-pgm variables. 2016-07-05 00:29:05 -07:00
Brett Lawson
28e78ddd93 Remove unused mTextures array (we use mSurfaces now). 2016-07-05 00:23:53 -07:00
Brett Lawson
61b7cdf6b7 Update debuggable bitfield to be slightly less hacky. 2016-07-04 23:26:37 -07:00
Brett Lawson
7f529f06d7 Refactored bitfields to allow debugger inspection. 2016-07-04 16:50:46 -07:00
Brett Lawson
9b25ce3b75 Add further assertions to GPU surface buffer allocation/retrieval. 2016-07-04 11:30:55 -07:00
Brett Lawson
d98ba3a69d Implement dmae.rpl to perform DMA memory copies and fills.
Note that our implementation does not perform those transfers
asynchronously using GPU DMA as the real WiiU would.
2016-07-04 11:21:41 -07:00
Brett Lawson
9fb72c9f60 Implement a stub for AXSetDeviceVolume.
This stops some games from panic'ing due to an invalid
return value from the function.
2016-07-04 11:21:40 -07:00
Brett Lawson
885407f2d3 Fix bug where Uniform Buffers fetched using array indexing. 2016-07-04 11:21:40 -07:00
James Benton
1b15abfb5e Change GPU Debug Markers to trace log level.
They are annoying.
2016-07-04 19:10:39 +01:00
James Benton
f0347951ab kernel: Add kernel call trace filtering.
This allows you to specify kernel trace filters in your config.json
in the format of "[+-]ModuleName::FunctionName", where:

+: enable tracing for all functions which match this filter,
-: disable tracing for all function swhich match this filter,
ModuleName: Can use trailing wildcard.
FunctionName: Optional, can use trailing wildcard.

Example:
  "kernel_trace_filters": [
    "-*", // Disable tracing for every module and every function
    "+coreinit::LC*", // Enable tracing for functions in coreinit module which match LC*
    "+*::AX*" // Enable tracing for functions in any module which match AX*
  ],

Closes #151.
2016-07-04 19:10:38 +01:00
James Benton
37a5394845 gx2: Basic tiling aperture implementation. 2016-07-03 22:58:02 +01:00
James Benton
f3bd86795f glsl: Warn about unusual shaders which have fully masked exports. 2016-07-03 22:57:57 +01:00
James Benton
b41e86e1ba debugger: Implement GX2 Texture/Shader dump menu items.
Whilst I was at it cleaned some formatting nearby, not going to do the
whole file because it is fucking huge.
2016-07-03 22:13:15 +01:00
James Benton
47b3de1d78 Remove left over pragma optimize off.
These were for debugging purposes and committed by mistake.
2016-07-03 22:02:45 +01:00
James Benton
07345e87d7 glsl: Add support for ALU_ELSE_AFTER.
I'm fairly sure this is just a PUSH ALU ELSE, but I might be wrong...
2016-07-03 22:00:56 +01:00
James Benton
7fdfa226d5 Add DRC touch input. 2016-07-03 22:00:48 +01:00
James Benton
e3e1643779 glsl2: Implement SAMPLE_LZ instruction.
Used in Duck Tales Remastered.
2016-07-04 12:41:04 +01:00
James Benton
0ca85c173e gx2/opengl: Standardise naming of "count" for index count everywhere.
In gx2 func args it was even called numVertices, u fkin wot m8?
2016-07-04 12:41:04 +01:00
James Benton
0c0a60b5e8 opengl: auto everywhereererererererrr. 2016-07-04 12:41:04 +01:00
Brett Lawson
d4f2fa8e2c Implement GX2GetSurfaceMipPitch in gx2 HLE.
NSMBU was crashing due to a loop which ran forever trying
to copy data out of a texture.
2016-07-04 04:26:46 -07:00
Brett Lawson
ff9c22ecb0 Fix issue with EXP and SAMPLE source swizzling.
This also adds a new method insertSelectVector which will
automatically generate the appropriate GLSL selection
for a particular set of SQ_SEL's.  It also tries to use
a trivial GLSL swizzle when possible.
2016-07-04 02:29:53 -07:00
Brett Lawson
a4a914c6a6 Set SDL SwapInterval to 0 when debugging.
This will stop the GL driver from halting GPU processing while
we are in force_sync.
2016-07-04 02:28:13 -07:00
James Benton
b3dcf08949 decaf-sdl: Set OpenGL 4.5 core profile.
Closes #150.
2016-07-03 21:46:49 +01:00
James Benton
9c1b0eeba2 New simpler shader decompiler.
The previous shader decompiler tried to be very clever in reversing control flow,
that was a bit unreliable as it made a few assumptions which turned out to not
always be true. I believe in the future we could still write a proper decompiler
which correctly reverses control flow by inspecting the stack, but for now let's
keep it very simple and use a basic bitch decompiler which uses an actual shader
stack similar to how the GPU itself works.
2016-07-03 21:46:48 +01:00
Brett Lawson
2c7a431927 Fix usage of sysFree on a non-system-allocated pointer. 2016-07-03 03:44:20 -07:00
Brett Lawson
613e1bcf79 Improve force_sync behaviour to use a single thread.
This is required in order to allow Nsight to permit shader
debugging.  Otherwise, the nsight thread is not able to execute
any further shader calls inside the GPU thread properly.
2016-07-03 03:44:19 -07:00
Brett Lawson
9bbb346d2b Remove old, unused fs callback handler. 2016-07-03 03:44:19 -07:00
Andrew Church
8fc910d801 Don't try to decrement past the beginning of a map.
This crashes with a null dereference on Linux with Clang/libc++.
2016-07-02 04:31:30 +09:00
James Benton
3b710f4248 opengl: Remove debug message about texture alignment.
This will get spammed for any texture which uses swizzle bits!
2016-07-01 18:49:48 +01:00
James Benton
8fe74b0e62 opengl: Align texture address to surface format alignment.
Thanks to hydr8gon for the bug report:
https://www.reddit.com/r/DecafEmu/comments/4qj9ja/super_mario_3d_world_and_nsmbu_showing_results/d4vjo9q
2016-07-01 18:46:51 +01:00
James Benton
44064ae6aa kernel_fibers: Add missing include to wfunc_call. 2016-06-30 22:10:08 +01:00
James Benton
36fb56b7a6 decaf-sdl: Initialise SDL context before graphics thread context.
Seems like glbinding is a bit racey on Linux.
2016-06-30 22:10:08 +01:00
Bleizo
07c075041c Remove unnecessary usage of std::bind.
Because std::thread's constructors take copies of the arguments to be
used in the specified function, it is unnecessary to use std::bind to
bind the arguments of the functions to the function call.
2016-06-28 18:19:39 -04:00
James Benton
40529c946a opengl: Remove invalidate mode restrictions. 2016-06-28 20:35:45 +01:00
James Benton
48b2704d5a jit: Fix woopsy when i refactored a while loop into for loop. 2016-06-28 20:35:45 +01:00
James Benton
4c9c4b3f56 opengl: Include swizzle bits in texture address. 2016-06-28 20:35:45 +01:00
Andrew Church
6fc4c7d18f Save and restore CIA across calls from native to PPC code.
Failure to do this caused an assertion failure (core->cia != cia) in
cpu::interpreter::step_one() when an HLE-implemented KC function called
a PPC subroutine before returning (observed with ghs_mtx_init).
2016-06-28 18:54:57 +09:00
Andrew Church
37e4646671 Fix Linux build.
- Add missing #include <cstdlib> for malloc().
- Add missing diagnosic pragma for GCC/Clang.
- Fix ambiguous lambda signature.
2016-06-28 00:28:05 +09:00
James Benton
20d95ca9b5 opengl: Disable scissor test for clearing buffers. 2016-06-26 23:41:12 +01:00
James Benton
2016d1d78b Formatting. 2016-06-26 22:31:43 +01:00
James Benton
e5fa4fb15f Revert "Disable asynchronous FS for now as it breaks ShoKni."
No game specific hacks allowed :).

This reverts commit 2e713d4f40.
2016-06-26 22:05:39 +01:00
Brett Lawson
15613c5169 Significantly improved kernel context-switching.
This patch brings two major changes to our handling of context
switching.  The first is that we now switch context's based on
soely the OSContext.  This allows the kernel to be get closer
to no longer depending on coreinit.  I have also updated the
behaviour surrounding the actual host platform fiber switch so
that the semantics are easier to follow.  Lots of comments too!
2016-06-25 04:16:26 -07:00
Brett Lawson
e7d5a4ba2b Improved thread active list management accuracy. 2016-06-25 04:16:26 -07:00
Brett Lawson
e02eed0353 Improved OSJoinThread emulation accuracy. 2016-06-25 04:16:25 -07:00
Brett Lawson
0b25d31d7e Make sure use of run quantums causes an immediate failure. 2016-06-25 04:16:25 -07:00
Brett Lawson
995818319a Ensure that only correct thread specific IDs are used. 2016-06-25 04:16:25 -07:00