Commit graph

200 commits

Author SHA1 Message Date
bunnei b2c55bf772 Rasterizer: Implemented alpha testing. 2015-01-27 14:39:17 -05:00
bunnei ff83d23ed5 GPU: Implement the remaining depth testing functions. 2015-01-25 23:34:14 -05:00
Yuri Kunde Schlesner 5961a2852d GSP: Update framebuffer info on all interrupts
Hardware testing determined that the GSP processes shared memory
framebuffer update info even when no memory transfer or filling GX
commands are used. They are now updated on every interrupt, which isn't
confirmed correct but matches hardware behaviour more closely.

This also reverts the hack introduced in #404. It made a few games
behave better, but I believe it's incorrect and also breaks other games.
2015-01-14 05:20:12 -02:00
bunnei 93f36c49f7 Merge pull request #473 from archshift/pp3ports
Pica/Rasterizer: Add ETC1 texture decompression support.
2015-01-13 18:11:18 -05:00
Tony Wasserka f2b74b4fb3 Pica/Rasterizer: Add ETC1 texture decompression support. 2015-01-13 14:42:40 -08:00
bunnei 99c0716d4d Merge pull request #478 from archshift/pp3ports4
Pica/VertexShader: Implement the MAD instruction.
2015-01-12 21:55:35 -05:00
Tony Wasserka 2b9a9a45b7 Pica/VertexShader: Implement JMPC/JMPU/CALLC/CALLU. 2015-01-12 15:47:21 -08:00
Tony Wasserka e02db3904b Pica/VertexShader: Implement the MAD instruction. 2015-01-12 15:34:36 -08:00
bunnei f7a3f45f1e GSP: Toggle active framebuffer each frame 2015-01-07 18:06:00 -05:00
Tony Wasserka bc187be0c1 Pica/Rasterizer: Remove some redundant casts. 2014-12-31 16:32:56 +01:00
Tony Wasserka 9675d19b47 Pica/Rasterizer: Make orient2d a free function and rename it to SignedArea. 2014-12-31 16:32:56 +01:00
Tony Wasserka 47543d62cf Pica: Cleanup color conversion. 2014-12-31 16:32:55 +01:00
Tony Wasserka 614baa39d1 VideoCore: Remove some unused functions. 2014-12-31 16:32:55 +01:00
Tony Wasserka d13bd327ba Pica/Rasterizer: Fix a bug related to multitexturing and texture wrapping. 2014-12-31 16:32:55 +01:00
Tony Wasserka 195d73a385 Pica/Rasterizer: Clean up long code lines. 2014-12-31 16:32:55 +01:00
Tony Wasserka 40c7200841 Pica/VertexShader: Coding style fixes. 2014-12-31 16:32:55 +01:00
Tony Wasserka 323a56f898 Pica/CommandProcessor: Cleanups. 2014-12-31 16:32:55 +01:00
Tony Wasserka b2d461020d Pica/CommandProcessor: Workaround games not setting the input position's w component. 2014-12-31 16:32:55 +01:00
Tony Wasserka 0f49424022 Pica/Rasterizer: Implement backface culling. 2014-12-31 16:32:55 +01:00
Tony Wasserka 3b78af904e Pica/Rasterizer: Textures seem to be laid out flipped vertically.
Not sure if this is a correct fix. Probably should instead change the decoding logic itself.
2014-12-31 16:32:55 +01:00
Tony Wasserka 3da52ead9b Pica/DebugUtils: Fix a bug in RGBA4 texture decoding. 2014-12-31 16:32:55 +01:00
Tony Wasserka a7ae0330b1 Pica/Rasterizer: Implement alpha blending. 2014-12-31 16:32:55 +01:00
Tony Wasserka e229ff8c83 Pica/Rasterizer: Implement depth testing. 2014-12-31 16:32:55 +01:00
Tony Wasserka 77bb58afeb Pica/Rasterizer: Further enhance Tev support. 2014-12-31 15:35:54 +01:00
Tony Wasserka 36291bc3f6 Pica: Add output merger definitions. 2014-12-31 15:35:54 +01:00
Tony Wasserka 632655e292 Pica: Fix A4, IA4 and IA8 texture formats.
Both IA4 and IA8 had their component order mixed up. Additionally, IA4 used the wrong number of nibbles per texel. A4 skipped every second texel.
2014-12-31 15:35:24 +01:00
Tony Wasserka b7a48c422a Pica/CommandProcessor: Add support for integer uniforms. 2014-12-31 15:33:09 +01:00
Yuri Kunde Schlesner 8369ee5803 Rasterizer: Pre-divide vertex attributes by W
Execute the division-by-W for perspective-correct interpolation of
values in the clipper, moving them out of the rasterization inner loop.
2014-12-29 02:08:11 -02:00
Yuri Kunde Schlesner fe186d3a59 GPU: Bitwise texture swizzling
Replace the loop-based texture address swizzling code by a bit-twiddling
implementation, providing a very small speed up. Also simplify
addressing code.
2014-12-29 02:08:11 -02:00
Yuri Kunde Schlesner 2012e1420f Rasterizer: Common sub-expression elimination
Move the computation of some values out of loops so that they're not
constantly recalculated even when they don't change.
2014-12-29 02:08:10 -02:00
Yuri Kunde Schlesner 7e9bc85cc8 Clipper: Compact buffers on each clipping pass
Use a new buffer management scheme in the clipper that allows using a
bounded minimal amount of buffer space. Even though it copies more data
it is still slightly faster likely due to using less cache.
2014-12-29 02:08:10 -02:00
Yuri Kunde Schlesner a320d1a5b4 Clipper: Avoid dynamic allocations
The triangle clipper was allocating its temporary input, output and work
buffers using a std::vector. Since this is a hot path, it's desirable to
use stack allocation instead.
2014-12-29 02:08:09 -02:00
Yuri Kunde Schlesner d151d797b1 Vertex Shader: Zero OutputVertex to avoid denormals
Unused OutputVertex attributes were being left un-initialized. The
leftover garbage sometimes decoded as floating-point denormalized
values, causing fallbacks to microcode and massive slowdowns in the rest
of the rasterization pipeline even though the results were unused. By
zeroing the structure we ensure these attributes only contain harmless
zeros.
2014-12-29 02:08:09 -02:00
bunnei 3b9d181b8e GPU: Implement frameskip and remove forced framebuffer swap hack. 2014-12-28 22:14:05 -05:00
bunnei 01c675685e Merge pull request #327 from Apology11/master
Fix visual studio ambiguous symbol error
2014-12-26 21:43:59 -05:00
bunnei 2188af4a65 Merge pull request #322 from chinhodado/master
More warning cleanups
2014-12-22 00:12:43 -05:00
bunnei 0de6a08d75 Merge pull request #291 from purpasmart96/license
License change
2014-12-21 16:05:44 -05:00
Apology11 8d81e23d6e Fix visual studio ambiguous symbol error 2014-12-21 18:34:20 +01:00
Chin 0199a7d9ef More warning cleanups 2014-12-21 10:58:55 -05:00
purpasmart96 ebfd831ccb License change 2014-12-20 21:20:24 -08:00
Tony Wasserka 08f42c2b8c Pica/VertexShader: Promote a log message to critical status. 2014-12-20 18:06:56 +01:00
Tony Wasserka 17f31de364 Pica/VertexShader: Small optimization. 2014-12-20 18:06:56 +01:00
Tony Wasserka a664574ecb Pica/VertexShader: Be robust against invalid inputs.
More specifically, this also fixes crashes by Citra trying to load a src2 register even if the current instruction does not use that.
2014-12-20 18:06:56 +01:00
Tony Wasserka ad5db467d7 Pica/VertexShader: Clarify a comment. 2014-12-20 18:06:56 +01:00
Tony Wasserka 871418e62b Pica/DebugUtils: Further cleanups to LookupTexture. 2014-12-20 18:06:56 +01:00
Tony Wasserka 88e9efe4b8 Pica/DebugUtils: Fix two warnings. 2014-12-20 18:06:56 +01:00
Tony Wasserka 6e275778c9 Pica/DebugUtils: Better document LookupTexture. 2014-12-20 18:06:55 +01:00
Tony Wasserka e4e9710d18 Pica/Rasterizer: Get rid of C-style casts. 2014-12-20 18:06:55 +01:00
Tony Wasserka d81370682f Pica/DebugUtils: Make a number of variables static.
Makes for cleaner and faster code.
2014-12-20 18:06:55 +01:00
Tony Wasserka 6bd41de276 Pica/VertexShader: Cleanup flow control logic and implement CMP/IFU instructions. 2014-12-20 18:06:55 +01:00