Commit Graph

305 Commits

Author SHA1 Message Date
Unknown W. Brackets
9aa1b15569 softgpu: Fix black objects with bilinear filtering.
Dividing by 256 gives us a range of 0-253, and incorrectly gets zero for
some components (guessing alpha, primarily?) in some games.

Dividing by 255 has a speed hit, so a slight bias to the top left seems
like a decent performance compromise (and it's a very slight bias.)
2013-12-15 11:59:25 -08:00
Unknown W. Brackets
96d6f52a13 softgpu: Retain accuracy in depth for tests.
Fixes intro/menu issues in Phantasy Star Portable 1/2, and text in the
first, both of which now look correct.
2013-12-15 11:59:25 -08:00
Unknown W. Brackets
6ca5662b03 softgpu: Properly swizzle 16 bit textures.
Fixes for example the graphics in Fieldrunners.
2013-12-15 11:59:24 -08:00
Unknown W. Brackets
da1224bb57 softgpu: Use the display, not current, framebuffer.
Fixes blinking in save dialogs and probably other bugs.
2013-12-15 11:59:23 -08:00
Unknown W. Brackets
2f0c8c2877 softgpu: Attempt to implement GE_PROJMAP_UV.
Looks okay, not sure if it's fully correct.
2013-12-15 11:59:22 -08:00
Unknown W. Brackets
13bf4d83fa Add memchecks for common HLE copy operations.
Better to catch some than miss everything.
2013-12-14 14:56:05 -08:00
Henrik Rydgard
d4eee74b54 SoftGPU: Prepare for mipmapping. Getting the uv deltas seems tricky though... 2013-12-10 15:33:59 +01:00
raven02
2e7609b084 Cleanup ClearmodeDepthMask 2013-12-10 20:48:20 +08:00
Henrik Rydgård
20873f2985 Remove unnecessary ifdef 2013-12-09 16:53:46 +01:00
raven02
75492719e8 std::bind build fix for VS2012 2013-12-09 21:06:38 +08:00
Henrik Rydgård
68b08ffb9f SoftGPU: Quick and dirty lines and points implementation
No line/point texturing support yet.
2013-12-09 12:43:49 +01:00
Unknown W. Brackets
c6a441965e Move shared clut check to gstate. 2013-12-08 23:11:56 -08:00
Unknown W. Brackets
cdccf06b62 softgpu: Avoid some ScreenToDrawing() overhead. 2013-12-08 22:38:09 -08:00
Unknown W. Brackets
30394df775 softgpu: Make texture lookups do less math. 2013-12-08 22:37:45 -08:00
Henrik Rydgard
bd1d4e2d92 As if softgpu wasn't slow enough already, implement bilinear filtering. 2013-12-09 01:44:23 +01:00
Unknown W. Brackets
637a9de75d Optimize out some clear mode checks.
Since it's really common and the rasterizer is slow for large draws.
2013-12-08 14:24:17 -08:00
Unknown W. Brackets
598d509fb9 Use multiple threads if available for softgpu.
VIVA OVERHEAD.  But it's actually generally faster this way, even with
only 2 cores running (but not a huge improvement then.)

On an i7, this improves things ~2.5x with 8 cores.
2013-12-08 13:41:20 -08:00
Unknown W. Brackets
d227b13f36 softgpu: Advance vertex/index address on prim.
Fixes some broken graphics in a lot of places.
2013-11-20 21:59:45 -08:00
Henrik Rydgård
428b27903b Merge pull request #4556 from unknownbrackets/ctrl-timing
Adjust ctrl timing (sample and wake after vblank)
2013-11-18 05:06:58 -08:00
Unknown W. Brackets
7a9fe955f8 softgpu: Only check clear mode once for depthtest.
Small, small optimization.  It's only called outside clear mode.
2013-11-17 19:32:21 -08:00
Unknown W. Brackets
dfadb67ea1 Avoid some operator overloads.
Causing ambiguity.
2013-11-17 14:42:58 -08:00
Unknown W. Brackets
1311d71455 softgpu: Fix reversed stencil test funcs.
LESS applies to the ref compared to the stencil, not the stencil compared
to the ref.

With this, stencil testing is finally being done properly in Star Ocean.
2013-11-10 03:21:01 -08:00
Unknown W. Brackets
2db98b8669 softgpu: Don't apply logic op to stencil value.
Also, they were not at all applying correctly.
2013-11-10 03:21:00 -08:00
Unknown W. Brackets
438928de40 softgpu: Apply stencil op even when depth disabled. 2013-11-10 03:21:00 -08:00
Unknown W. Brackets
5327ce80d5 softgpu: throughmode doesn't disable any tests. 2013-11-10 03:20:59 -08:00
Unknown W. Brackets
5751e0a0a4 softgpu: Simplify color clamping. 2013-11-10 03:20:58 -08:00
Unknown W. Brackets
21deaef35a Invert gstate.getClearModeColorMask().
It makes more sense matching gstate.getColorMask().
2013-11-10 03:20:58 -08:00
Unknown W. Brackets
5817684e28 softgpu: Never write alpha, only stencil. 2013-11-10 03:20:57 -08:00
Unknown W. Brackets
be9fe9ad9a softgpu: Fix stencil read/write in some formats. 2013-11-10 03:20:56 -08:00
Unknown W. Brackets
b62e36e997 Support frameskip in softgpu. 2013-10-27 16:50:03 -07:00
Unknown W. Brackets
98e257c95d Add GPU cycle estimation to the softgpu. 2013-10-27 15:05:57 -07:00
Henrik Rydgard
f5a63d7d41 Better fix for the UINT_64 define issue on android 2013-10-20 13:52:31 +02:00
Unknown W. Brackets
c1897b9e54 Compare stencil correctly based on bitdepth.
All sorts of funny rules.  See comments here:
https://github.com/hrydgard/ppsspp/pull/4150
2013-10-12 22:20:38 -07:00
Unknown W. Brackets
b9811c7c97 Use the slow way to get the softgpu texture.
So that it actually shows what the softgpu is using.
2013-10-07 01:26:48 -07:00
Unknown W. Brackets
5c2d418d95 Read softgpu stencil using existing funcs.
Slower but at least it's the same.
2013-10-07 01:02:58 -07:00
Unknown W. Brackets
b9453f82ca Use the full alpha bits for stencil in softgpu.
It works to increment and set the stencil, so it can't be high bits only.
2013-10-07 01:00:43 -07:00
Unknown W. Brackets
31171cc044 Grab the stencil buffer in softgpu debugging. 2013-10-07 00:50:15 -07:00
Unknown W. Brackets
d49ad5f114 Use an accessor for depth/frame addresses. 2013-10-06 22:17:53 -07:00
Unknown W. Brackets
32f2f045e4 Don't report a loadclut of 0. 2013-10-05 15:41:44 -07:00
Unknown W. Brackets
eae6e87620 Simplify lighting clamping in softgpu. 2013-10-05 13:05:32 -07:00
Unknown W. Brackets
013e3f3be2 Add very basic and slow DXT decoding to softgpu. 2013-10-05 12:25:18 -07:00
Unknown W. Brackets
2eb10c3b3f Add basic GetCurrentTexture() to softgpu. 2013-10-05 11:37:14 -07:00
Unknown W. Brackets
e79781b1a3 softgpu: Skip the stencil/depth tests in a clear. 2013-09-28 12:15:07 -07:00
Unknown W. Brackets
da1d700904 Attempt to support rendering depth/stencil.
But no interface yet.  I can't tell if it works, I just get black...
2013-09-28 02:38:05 -07:00
Unknown W. Brackets
14efcbcc9b Add an interface to grab the depth/stencil buffers.
Not sure yet how to show in UI, not well tested...
2013-09-28 02:23:07 -07:00
Unknown W. Brackets
81e71dd8d7 Add a way to get to the current texture as well. 2013-09-27 22:46:08 -07:00
Henrik Rydgard
424b4cbd5f Move GE_CMD_BJUMP to GPUCommon. Add the flag. (no actual bbox impl yet) 2013-09-24 14:14:04 +02:00
Unknown W. Brackets
6af44910c1 Add an interface to return the current framebuffer. 2013-09-22 19:03:31 -07:00
Unknown W. Brackets
eabd8b5302 Add GPU debugging hooks to Host, not yet in use. 2013-09-22 08:14:55 -07:00
Henrik Rydgard
82e5787bbe Preparation for proper spline/bez: Convert control points to a simple format.
The bezier/spline code will no longer need to handle morph and splines,
when it's finally written. This is done by pre-skinning in software and
pre-decoding to get rid of the morph.
2013-09-21 23:37:14 +02:00
Henrik Rydgard
82a2f6443d Oops (last commit) 2013-09-21 21:05:15 +02:00
Henrik Rydgard
34341b0373 Minor optimization in swrast 2013-09-21 21:03:43 +02:00
Henrik Rydgard
48aac7cf9f Softgpu: Wrap textures in through mode to avoid crashes in texturing. 2013-09-21 20:28:26 +02:00
The Dax
d102baacd0 Prep PPSSPP for Visual Studio 2013. 2013-09-17 10:27:06 -04:00
Unknown W. Brackets
ad4bd8ed74 softgpu: small optimization, precompute tex info. 2013-09-15 21:39:28 -07:00
Unknown W. Brackets
f43997a47f Update bufw handling in all gpus.
This fixes the softgpu as well, at least.
2013-09-15 21:27:13 -07:00
Unknown W. Brackets
26f935bbe5 Bypass vertex decoder z scaling.
Everything is compared against the u16 value.  This should be correct for
throughmode at least.
2013-09-14 15:48:11 -07:00
Unknown W. Brackets
242879b0ea Remove a bunch of debug logs, sync with gles.
This may fix bad vertex/index addresses, or crashes from the matrix
arrays.  The debug logging is better replaced with "dump this frame".
2013-09-14 14:28:37 -07:00
Unknown W. Brackets
8ddbc0a9ab Don't allow boneMatrixNumber to go outside bounds.
Just from the GLES code.

Fixes the Monster Hunter 3rd demo crash, but not sure why it's trying to
use crazy numbers in the first place...
2013-09-14 14:10:50 -07:00
Unknown W. Brackets
dc81547d32 Use less pointer math in softgpu buffer access. 2013-09-14 11:36:56 -07:00
Unknown W. Brackets
7b2dea4429 Use accessors for offsetx/y. 2013-09-14 11:06:48 -07:00
Unknown W. Brackets
40e3e8e930 Use a gstate enum, report unhandled blend mode. 2013-09-14 07:36:43 -07:00
Unknown W. Brackets
1a7e0e40cf Refactor the logic op into a func like the others. 2013-09-14 07:21:58 -07:00
Henrik Rydgard
c88920be4b Bail more gracefully if no real OpenGL driver is installed on XP 2013-09-11 21:35:44 +02:00
Henrik Rydgard
5e6c837ced Fix issue where the SoftGPU would render double size if "antialiasing" was on. 2013-09-10 22:27:05 +02:00
Unknown W. Brackets
c3839a53e5 Fix some minor warnings. 2013-09-07 22:40:08 -07:00
Henrik Rydgard
78d3ee3d6a Misc cleanup, mostly logging code 2013-09-07 13:01:19 +02:00
Unknown W. Brackets
2e8b475789 Don't ignore the low bits of the framebuf pointer. 2013-09-07 02:01:01 -07:00
raven02
59599a62d3 Build fix 2013-09-05 16:00:11 +08:00
Unknown W. Brackets
2006bdc6a3 Fix negative texel wrapping in softgpu.
No longer crashes in Jeanne d'Arc, still looks awful.
Also faster on x64 at least.
2013-09-02 21:29:19 -07:00
Unknown W. Brackets
8d16b76c15 Add some reporting to the software GPU. 2013-09-01 01:15:07 -07:00
Unknown W. Brackets
7349de55d1 Fix some initialization/sprintf warnings. 2013-09-01 01:15:07 -07:00
raven02
eca79d35a7 softgpu : use switch case for texture format 2013-08-27 16:26:01 +08:00
raven02
bfd60e95a4 softgpu: Use switch case for different texture mapping mode 2013-08-27 16:15:53 +08:00
Henrik Rydgård
99c1ab38d7 Merge pull request #3224 from raven02/patch-5
softgpu : Fix depth issue in FF Type-0
2013-08-24 16:10:33 -07:00
Unknown W. Brackets
6e8d318322 Bugger typo. 2013-08-24 11:36:01 -07:00
Unknown W. Brackets
cd70250d8c Use more accessors, simplify softgpu colortest. 2013-08-24 11:34:38 -07:00
Unknown W. Brackets
5ab04a3076 Centralize CLUT handling form gstate values. 2013-08-24 11:34:37 -07:00
Unknown W. Brackets
7f6cf3ec29 Add a few gstate accessors for texture type stuff. 2013-08-24 11:34:37 -07:00
Unknown W. Brackets
0a217a1254 Use accessors better for block transfers. 2013-08-24 11:34:36 -07:00
Unknown W. Brackets
c141e94fe9 Use gstate.* accessors in a few more places. 2013-08-24 11:34:35 -07:00
Unknown W. Brackets
55e02369a5 Workaround an ICE in some versions of gcc. 2013-08-24 11:33:49 -07:00
Unknown W. Brackets
12c5f5e1e6 Use constants for other uv gen mode usages.
And also change them to treat 3 as coords as well.
2013-08-19 00:43:54 -07:00
raven02
87434e8dad softgpu : Fix depth issue in FF Type-0 2013-08-18 22:58:23 +08:00
Unknown W. Brackets
ff9cff08ed Fix softgpu's 4444 color conversion.
And use the standard 4->8 swizzling funcs (more self documenting.)
2013-08-17 17:33:10 -07:00
Henrik Rydgård
52940abf31 Merge pull request #3212 from unknownbrackets/softgpu
Software GPU width tweak
2013-08-17 10:58:54 -07:00
Unknown W. Brackets
92dbfd177a Render the display width properly in softgpu. 2013-08-17 10:57:08 -07:00
Unknown W. Brackets
90affa2203 Remove very questionable DrawSync override. 2013-08-17 09:53:10 -07:00
Unknown W. Brackets
a4bea9c878 Add support for multithreading in softgpu. 2013-08-17 09:52:35 -07:00
Unknown W. Brackets
f501c98a5d Report "Software" for sw GPU engine. 2013-08-17 09:48:06 -07:00
raven02
758cc878fb softgpu : should be vreader.ReadColor1 2013-08-17 22:21:14 +08:00
raven02
8ff2a1bb35 softgpu : fix v_color0 to use MaterialAmbient 2013-08-17 22:05:50 +08:00
Henrik Rydgard
9f3848b49c swrast warning fixes 2013-08-17 12:37:47 +02:00
Tony Wasserka
74eafcab1a softgpu: Process rasterization in screen space, rather than drawing space. 2013-08-16 23:49:15 +02:00
Tony Wasserka
c707140512 softgpu: Implement normal reversal. 2013-08-16 23:49:15 +02:00
Tony Wasserka
d0c05b78d6 softgpu: Fix some stencil testing related bugs. 2013-08-16 23:49:15 +02:00
Tony Wasserka
67f95d38e5 softgpu: Some cleanups in SoftGpu.cpp 2013-08-16 23:49:15 +02:00
Tony Wasserka
45577507f3 softgpu: Disable clipping if it's not requested by the game. Also fix some clipping-related bugs. 2013-08-16 23:49:14 +02:00
Tony Wasserka
fc336772e6 softgpu: Fix normal-mode rectangle drawing. 2013-08-16 23:49:14 +02:00
Tony Wasserka
838d22d120 softgpu: Implement memory transfers. 2013-08-16 23:49:14 +02:00
Tony Wasserka
2962d242cb softgpu: Implement skinning. 2013-08-16 23:49:14 +02:00
Tony Wasserka
9bc3e8bf07 softgpu: Generate texture coordinates for environment mapping even if lighting is disabled altogether. 2013-08-16 23:49:13 +02:00
Tony Wasserka
6b90aa250d softgpu: Polish some helper function signatures. 2013-08-16 23:49:13 +02:00
Tony Wasserka
11a94e1d14 softgpu: Implement spline surface drawing (without patch subdivision). 2013-08-16 23:49:13 +02:00
Tony Wasserka
f4cb929073 softgpu: Fix a lighting bug. 2013-08-16 23:49:13 +02:00
Tony Wasserka
ad8449c382 softgpu: Add some safety checks. 2013-08-16 23:49:13 +02:00
Tony Wasserka
f6feb874ed softgpu/Rasterizer: Structure some code more clearly. 2013-08-16 23:49:12 +02:00
Tony Wasserka
1450157e09 softgpu: Implement environment mapping. 2013-08-16 23:49:12 +02:00
Tony Wasserka
d2f30961af softgpu: Make perspective correct uv mapping code more readable and implement projection mapping. 2013-08-16 23:49:12 +02:00
Tony Wasserka
104feea8eb softgpu: Restructure texture sampling code a bit. 2013-08-16 23:49:12 +02:00
Tony Wasserka
bacadefde4 softgpu: Optimization, part 3. 2013-08-16 23:49:12 +02:00
Tony Wasserka
b22a82d350 softgpu: Optimization, part 2. 2013-08-16 23:49:11 +02:00
Tony Wasserka
0c6a9dcf50 softgpu: Optimization, part 1. 2013-08-16 23:49:11 +02:00
Tony Wasserka
002ab3e3ad softgpu: Hackfix CLUT4 texture deswizzling. 2013-08-16 23:49:11 +02:00
Tony Wasserka
62b384e052 softgpu: Lots of clearmode fixes. 2013-08-16 23:49:11 +02:00
Tony Wasserka
f35e085859 softgpu: Change framebuffer writes to act on actual 16 bit pixels if that's the framebuffer format. 2013-08-16 23:49:11 +02:00
Tony Wasserka
917dc276dc softgpu: Small cleanup in Clipper. 2013-08-16 23:49:10 +02:00
Tony Wasserka
2ea7162962 softgpu: Implement depth range test. 2013-08-16 23:49:10 +02:00
Tony Wasserka
e1216e91cc softgpu: Implement texture scaling, texture offset and texture coordinate wrapping/clamping. 2013-08-16 23:49:10 +02:00
Tony Wasserka
44035df446 SoftGpu: Add support for triangle fans. 2013-08-16 23:49:10 +02:00
Tony Wasserka
c8f1819179 softgpu: Fix triangle borders not fitting together properly. 2013-08-16 23:49:09 +02:00
Tony Wasserka
4e1d2f0cb2 softgpu: Implement logic ops. 2013-08-16 23:49:09 +02:00
Tony Wasserka
c957574f90 softgpu: Implement color masking. 2013-08-16 23:49:09 +02:00
Tony Wasserka
a013aad6f1 softgpu: Fix incorrect depth buffer write base address.
softgpu: Implement framebuffer pixel formats different than RGBA8888.
softgpu: Move texel decoding functions to a separate header.
2013-08-16 23:49:09 +02:00
Tony Wasserka
b2d4df2ddf Fixes for CLUT decoding 2013-08-16 23:49:08 +02:00
Tony Wasserka
ccb487cbae softgpu: Clip primitives when one of their vertices is outside the screen coordinate range (the code really needs a cleanup though).
softgpu: Fix triangle strip rendering.
softgpu: Implement CCW cullmode.
2013-08-16 23:49:08 +02:00
Tony Wasserka
37ef488f83 softgpu: Support RGB565, RGBA5551 and RGBA4444 CLUT formats. 2013-08-16 23:49:08 +02:00
Tony Wasserka
54c9303f4a softgpu: static inline everything. 2013-08-16 23:49:08 +02:00
Tony Wasserka
dedb3de5c3 softgpu: Add support for 32 bit and 16 bit index texture formats.
softgpu: Move texture function emulation to a helper function.
2013-08-16 23:49:08 +02:00
Tony Wasserka
2336f4cd8c softgpu: Assign texture alpha value to 255 when no alpha channel is present. 2013-08-16 23:49:07 +02:00
Tony Wasserka
88348a3d73 softgpu: Fix rgba texture function.
softgpu: Reorder pixel pipeline steps to match hardware order (without caring about performance loss, should be optimized later!).
softgpu: Implement alpha and color testing.
softgpu: Change CLUT lookup code a bit, still need to make some sense out of this.
2013-08-16 23:49:07 +02:00
Tony Wasserka
c549ee0d12 softgpu: Fix some alpha blending bugs. 2013-08-16 23:49:07 +02:00
Tony Wasserka
e7ac41c4bc softgpu: Possibly fix a bug. Or make things worse. I don't know :/ 2013-08-16 23:49:07 +02:00
Tony Wasserka
90b868d1ef softgpu/Rasterizer: Clean up texture sampling code. 2013-08-16 23:49:07 +02:00
Tony Wasserka
e1cc2540cd softgpu: Fix fast texture storage mode and use correct texture buffer pitches. 2013-08-16 23:49:06 +02:00
Tony Wasserka
df141ffe6b softgpu: Implement stencil testing. Add some TODOs. Disable alpha blending when clear mode is active.
GPUState: Fix incorrect stencil enum.
2013-08-16 23:49:06 +02:00
Tony Wasserka
0dbe5c5cc1 softgpu: Cleanup CLUT lookup code and fix a critical bug related to it. Also added semi-working fast texture storage mode support. 2013-08-16 23:49:06 +02:00
Tony Wasserka
84425aafef softgpu: Fix (?) interpolation method for z and color values. 2013-08-16 23:49:06 +02:00
Tony Wasserka
40c83dee03 softgpu: Fix vertex order when drawing rectangles. 2013-08-16 23:49:05 +02:00
Tony Wasserka
8929b0c248 softgpu/Rasterizer: Fix (or rather workaround) a critical integer overflow issue. 2013-08-16 23:49:05 +02:00
Tony Wasserka
27414c0be0 softgpu/Rasterizer: Fix decal texfunc. 2013-08-16 23:49:05 +02:00
Tony Wasserka
3ccc0c1fdc softgpu/Rasterizer: Warning fixes. 2013-08-16 23:49:05 +02:00
Tony Wasserka
3f9633e1cb softgpu: Fix a dumb mistake in the alpha blending code. How did this even compile before?! 2013-08-16 23:49:05 +02:00
Tony Wasserka
602e0e5358 softgpu: Add working CLUT support. 2013-08-16 23:49:04 +02:00
Tony Wasserka
26d80c16fe softgpu/TransformPipeline: Clean up VertexData::Lerp by using Math3D effectively. 2013-08-16 23:49:04 +02:00
Tony Wasserka
06290c53de softgpu: Fix an issue where texture coordinates were not initialized correctly for quads. 2013-08-16 23:49:04 +02:00
Tony Wasserka
f447957263 softgpu: Use the actual z coordinate of a triangle in through mode, too. 2013-08-16 23:49:04 +02:00
Tony Wasserka
b0d3848dc7 softgpu: Don't draw pixels which lie on the right side of a triangle. 2013-08-16 23:49:04 +02:00
Tony Wasserka
4231264008 softgpu: Clean up Rasterizer code by using Math3D's Vec4 functionality. 2013-08-16 23:49:03 +02:00
Tony Wasserka
ce953f1293 softgpu: Use Vec4 instead of our own Color4 class for color handling. 2013-08-16 23:49:03 +02:00