Commit Graph

2363 Commits

Author SHA1 Message Date
Unknown W. Brackets
e3b7ddb258 Clarify enum usage. 2015-01-18 13:26:26 -08:00
Unknown W. Brackets
ee1085b060 Oops, deleted too early. 2015-01-18 13:18:17 -08:00
Unknown W. Brackets
3fcf695159 Fix an unlikely leak on error. 2015-01-17 18:45:03 -08:00
Unknown W. Brackets
795088001c Avoid passing a GPUstate by value.
Only used by Qt GE debugger thing anyway.
2015-01-17 18:21:04 -08:00
Henrik Rydgard
c2500744e1 D3D9 rectangle rendering fix (maxindex) 2015-01-15 23:58:07 +01:00
Unknown W. Brackets
d663cda2de Transform rects using indices.
Not a hge difference.  Minor cleanup.
2015-01-15 12:26:35 -08:00
Henrik Rydgard
df62bc42b7 D3D shader generator: Fix an issue with 4x3 vs 4x4 matrices that caused warnings to be reported (I think).
Make the GL code for this case (skinning without normal) more similar.
2015-01-12 20:37:33 +01:00
Unknown W. Brackets
f311d4008d Leave VBOs and index buffers bound for reuse. 2015-01-11 17:03:45 -08:00
Unknown W. Brackets
40ea889b6a Cache the VBO/index buffer to avoid redundancy.
Well, mostly just redundant unbinds.
2015-01-11 16:56:29 -08:00
Unknown W. Brackets
c37d41c88c Assert state on first frame.
This won't matter much for games, but makes tests run more sanely.
2014-12-30 15:26:16 -08:00
Henrik Rydgård
f74add91e2 Merge pull request #7202 from unknownbrackets/cpu-thread
Allow switching cpu thread on/off ingame
2014-12-24 19:15:51 +01:00
Unknown W. Brackets
d097999fad Avoid killing textures unless we have several mb. 2014-12-21 17:00:55 -08:00
Unknown W. Brackets
0a6a70f53f Allow switching cpu thread on/off ingame. 2014-12-20 17:39:42 -08:00
Unknown W. Brackets
962d8c5224 dx9: Take screenshots (fixes #7197.) 2014-12-20 08:31:56 -08:00
Henrik Rydgård
a9be90229a Merge pull request #7140 from AbandonedCart/master
use libc++ for iOS to avoid additional directives
2014-12-18 22:38:14 +01:00
xebra
1a6102178c [spline/bezier]Remove unnecessary initialization of array. 2014-12-16 22:30:06 +09:00
Henrik Rydgard
d9e543fdd2 Reduce PowerVR blockiness problems on older GPU revisions. #7153 #7150 2014-12-15 01:16:07 +01:00
Henrik Rydgard
f424bf73ae GLES: Implement a custom modulo function for PowerVR. Fixes blockiness, see #7153 and #7150 2014-12-14 20:59:21 +01:00
Henrik Rydgard
e2d2950865 Add a sanity check for shader linking, active in debug mode 2014-12-14 20:17:29 +01:00
Henrik Rydgard
b4b7cd0722 GLES: Merge the two ShaderID classes as they are identical.
I don't expect the number of bits required to grow or shrink massively for either type of shader in this backend.
2014-12-14 19:24:11 +01:00
Unknown W. Brackets
31ba44bc5d dx9: Clean up some differences in spline code.
Hmm, the spell effects look wrong.  Maybe a separate bug.
2014-12-14 09:26:12 -08:00
Henrik Rydgard
8974cd675e Workaround silly PowerVR driver bug, prevent mipmapping on framebuffer textures
Not sure if these actually help anything in practice though. At least gets rid of debug log spam from the driver..
2014-12-14 01:24:01 +01:00
Henrik Rydgård
a767c8e704 Merge pull request #7176 from xebra/spline_bezier2
Fix huge bezier patch issue
2014-12-13 18:14:59 +01:00
xebra
7577a49832 [spline/bezier]Fix huge bezier patch issue related to #5500 2014-12-14 01:49:48 +09:00
Henrik Rydgård
5d6d552e57 Merge pull request #7175 from xebra/spline_bezier
Improve spline/bezier tesselation
2014-12-13 17:45:15 +01:00
xebra
5659361d51 [spline/bezier]Control points don't need big memory size than tesselated vertices. 2014-12-14 01:33:40 +09:00
xebra
43e3028add [spline/bezier]Writing vertices to the buffer directly. 2014-12-14 01:08:00 +09:00
Lioncash
dc436aebe8 GPU: Get rid of unused variable warnings 2014-12-12 09:29:41 -05:00
xebra
96bb991e45 [spline/bezier]Temporary fix to avoid a crash when bezier u/v counts are less than 4. Reported on #4888. 2014-12-09 02:24:46 +09:00
Unknown W. Brackets
5538452e2a Fix a warning.
I want to keep the default missing for warnings.
2014-12-07 15:41:11 -08:00
Henrik Rydgard
308e45420a GLES: Add some currently unused information to the opcode table. Keep downcount in a local as much as possible. 2014-12-06 11:35:02 +01:00
TwistedUmbrella
3f4d58b0b2 use libc++ for iOS to avoid additional directives 2014-12-05 19:47:02 -05:00
Henrik Rydgard
ff68e32f88 Try to fix flat/smooth shade mode issue (caused shader mismatches) 2014-12-02 01:13:26 +01:00
Henrik Rydgard
da1352c924 Don't bother specifying smooth shading, it's the default. 2014-12-02 00:57:51 +01:00
xebra
f032936575 Fix flat shading for unsupported hardware. 2014-12-01 19:16:20 +09:00
xebra
fe051f30a2 [spline/bezier]Fix surface normal at flat shading. 2014-11-29 21:58:11 +09:00
xebra
34fe8300ab Support flat shading. 2014-11-28 18:59:14 +09:00
xebra
b0ab0295ba [spline/bezier]Fix decoded buffer access violation. 2014-11-27 19:01:07 +09:00
xebra
368ebf7da3 [spline/bezier]Fix order of quad indices. 2014-11-25 23:48:22 +09:00
xebra
8cc7d8c71a [spline/bezier]Fix patch subdivision counts correctly. 2014-11-25 23:47:29 +09:00
xebra
ab0eeb18f3 [spline/bezier]Support drawing primitives lines and points. 2014-11-25 22:32:50 +09:00
level99procrastinator
52d6f40ec8 Make sure no NaN goes into projection matrix. 2014-11-09 20:34:23 +08:00
level99procrastinator
6fa0fe48a4 Move the hack from GPU/GLES/StateMapping.cpp to GPU/GLES/ShaderManager.cpp 2014-11-09 01:26:24 +08:00
level99procrastinator
a98980d28b Workaround for graphics glitch in Phantasy Star Portable 2 2014-11-08 20:31:17 +08:00
Unknown W. Brackets
59c1485e64 Fix typo. 2014-11-06 08:51:15 -08:00
Unknown W. Brackets
ebb9f68c3e u_lightpos is always set when lights are available.
Tiny optimization.
2014-11-05 00:57:22 -08:00
Unknown W. Brackets
c0804427ef Merge remote-tracking branch pull/7047.
And fix the whitespace + optimize the pngs.
2014-11-04 01:46:00 -08:00
TwistedUmbrella
07f0478425 Xcode 6 / iPhone 6 compatibility updates 2014-11-04 03:37:40 -05:00
Unknown W. Brackets
416182b4ba Update to xBRZ 1.1.
Keeping the channel swap stuff and other changes, though.
2014-11-02 14:17:24 -08:00
Henrik Rydgard
1fe2af3421 Fix D3D NFSU crash #7030 in a cleaner way than #7033 :) 2014-10-29 23:51:23 +01:00
Unknown W. Brackets
2b16b5b79b Use XXH64 on 64-bit systems.
I'm not able to reproduce any real performance difference, but I know
there are some games which do more hashing and it may help there.
2014-10-26 17:49:24 -07:00
Henrik Rydgard
d17aa4738a Some more GetPointer cleanup 2014-10-19 23:19:51 +02:00
Henrik Rydgard
c62255f1d9 GetPointerUnchecked is ok around display list pc, checked elsewhere 2014-10-19 23:13:54 +02:00
Henrik Rydgard
e22fed8b9f Use unordered_map where it makes sense. Very tiny speed boost?
Also some microoptimizations.
2014-10-19 21:12:25 +02:00
Henrik Rydgard
7cb5e7f53f Some very minor optimizations. Remove little-used stat counter. 2014-10-19 21:12:25 +02:00
Unknown W. Brackets
67a54504c7 Oops, left the comment in the wrong one. 2014-09-24 23:11:47 -07:00
Unknown W. Brackets
d1e992736b Simplify the viewport code a bit. 2014-09-24 23:09:09 -07:00
Henrik Rydgård
abb294ff7d Merge pull request #6940 from unknownbrackets/blend-logicop
d3d9: Emulate some logic ops with blending
2014-09-24 09:30:58 +02:00
Unknown W. Brackets
81592e9cf5 gles: Avoid pow(<= 0, 0) entirely, undefined.
Should work on more driver versions.  Fixes #6941.
2014-09-23 23:59:32 -07:00
Unknown W. Brackets
c88b66b308 d3d9: Emulate some logic ops with blending.
This makes Brave Story's intro visible.  Also add for GLES2/GLES3, but
doesn't seem to work on GLES2.
2014-09-23 21:13:47 -07:00
Unknown W. Brackets
4e50eed85b d3d9: Specify tex stage for binding framebuf color. 2014-09-21 12:11:17 -07:00
Unknown W. Brackets
6e34fe1c4b d3d9: Fix fbo tex clamp (usually shadows.) 2014-09-21 11:07:02 -07:00
Unknown W. Brackets
e3d6f19a2e d3d9: Update some not-yet-used ps uniforms. 2014-09-21 10:41:44 -07:00
Unknown W. Brackets
6f38c21ccc d3d9: Make the vertex shaders more similar. 2014-09-20 23:55:48 -07:00
Henrik Rydgard
07c7687052 More code deduplication. Also normalized some line endings. 2014-09-18 00:45:11 +02:00
Henrik Rydgard
6c313385ab Reduce the diff between the two draw engines 2014-09-18 00:40:25 +02:00
Henrik Rydgard
5e2c30c640 Move GetCurrentSimpleVertices to DrawEngineCommon 2014-09-17 21:37:53 +02:00
Unknown W. Brackets
01bdb6e160 Cleanup some minor vertex cache stuff. 2014-09-15 07:08:55 -07:00
Henrik Rydgård
b7a54a23d0 Merge pull request #6910 from unknownbrackets/d3d9
d3d: Fix some vertex cache glitches, enable bounding box test
2014-09-14 23:38:33 +02:00
Unknown W. Brackets
64d955ea49 d3d: Share the bounding box code. 2014-09-14 14:04:09 -07:00
Unknown W. Brackets
f0c37e3f61 d3d: Use minihashing in the vertex cache. 2014-09-14 13:50:57 -07:00
Unknown W. Brackets
dc1013ad67 d3d: Add a not-working experiment to blit depth. 2014-09-14 11:54:55 -07:00
Unknown W. Brackets
afd9d864be Clear alpha only when clearing stencil.
Not sure if this will fix anything.
2014-09-14 08:00:35 -07:00
Unknown W. Brackets
71e310aff8 d3d: Initial attempt to upload stencil. 2014-09-14 02:21:41 -07:00
Henrik Rydgård
2b4ff04c32 Merge pull request #6902 from unknownbrackets/gpu-convergence
d3d: Handle block transfers
2014-09-14 11:06:15 +02:00
Unknown W. Brackets
d48fb04a18 d3d: Declare a couple overrides. 2014-09-14 00:34:52 -07:00
Unknown W. Brackets
8c4c9e554e d3d: Cache offscreen surfaces. 2014-09-13 22:28:39 -07:00
Unknown W. Brackets
ec4e96b870 d3d: Expliticly bind after fbo_create().
In GLES, this is a tiny call that checks a cache, but it's necessary in
Direct3D 9.
2014-09-13 18:46:59 -07:00
Unknown W. Brackets
b9d7ffe484 d3d: Support the Danganronpa hack. 2014-09-13 16:47:23 -07:00
Unknown W. Brackets
7f89723d2b d3d: Initial implementation of framebuf download.
Not working, or not working properly...
2014-09-13 16:37:59 -07:00
Unknown W. Brackets
2463074530 d3d: Converge block transfer logic. 2014-09-13 15:40:55 -07:00
Unknown W. Brackets
971dd5df1e d3d: Unify BlitFramebuffer() as well. 2014-09-13 15:12:59 -07:00
Unknown W. Brackets
a4d33d77b7 d3d: Unify ReadFramebufferToMemory() signature. 2014-09-13 15:09:30 -07:00
Unknown W. Brackets
f33515723b Move ForgetLastTexture() into DrawPixels(). 2014-09-13 14:58:05 -07:00
Unknown W. Brackets
3dfdddfc5f d3d: Move UpdateFromMemory() to common. 2014-09-13 14:44:18 -07:00
Unknown W. Brackets
9af3befc59 d3d: Add RebindFramebuffer(). 2014-09-13 14:26:39 -07:00
Unknown W. Brackets
6f991a1042 d3d: Add FlushBeforeCopy(). 2014-09-13 14:23:18 -07:00
Unknown W. Brackets
d60fd955d6 Vertex cache a bit more frequently.
Rely upon the minihashing a bit more.
2014-09-13 14:03:13 -07:00
Unknown W. Brackets
456b2613f0 Avoid full rehashes when failures are frequent. 2014-09-13 14:03:13 -07:00
Unknown W. Brackets
c8e6a809c3 Use a more frequent mini hash in the vertex cache. 2014-09-13 14:03:12 -07:00
Unknown W. Brackets
37b9af75b1 Refactor vertex caching a little. 2014-09-13 14:03:12 -07:00
Unknown W. Brackets
bcc6b4027a Limit unreliable vertexes uncached per frame.
Remember them longer, and avoid slamming too many in the same frame.
2014-09-13 14:03:11 -07:00
Henrik Rydgard
a4ae0f951a Move spline generation to SplineCommon, make SplineDX9.cpp identical to Spline.cpp (merge later somehow) 2014-09-13 15:13:34 +02:00
Henrik Rydgard
19a9c4481f Move GLES' SoftwareTransform to Common 2014-09-13 13:27:42 +02:00
Henrik Rydgard
4212bbb51e Cleanup SoftwareTransform a bit more 2014-09-13 13:15:18 +02:00
Henrik Rydgard
ca3ed34b44 Move most GL code out of GLES/SoftwareTransform.cpp 2014-09-13 13:03:37 +02:00
Henrik Rydgard
b4690b23d6 Make D3D TransformDrawEngine more similar to GL 2014-09-13 12:27:20 +02:00
Henrik Rydgard
9b587bb144 Make the D3D backend cmd processing work more similar to the GL backend 2014-09-13 12:11:34 +02:00
Unknown W. Brackets
77cd49622b d3d: Fix switching between rendering modes. 2014-09-11 23:30:42 -07:00
Henrik Rydgard
37e3cf362f Move vertexdecoder files into GPU/Common 2014-09-12 02:00:32 +02:00
Henrik Rydgard
1f9c1719e3 Delete the DX9 vertex decoder, use the "GL" one instead (now common) 2014-09-12 02:00:32 +02:00
Henrik Rydgard
7cf05e44a2 Add option to vertexdecoder to expand UVs to floats 2014-09-12 02:00:31 +02:00
Henrik Rydgård
432bdef368 Merge pull request #6879 from unknownbrackets/gpu-minor
Bind the alphatest tex after we know vert alpha
2014-09-11 09:36:59 +02:00
Unknown W. Brackets
f7b669a740 Fix infinite recursion in framebuf create upload.
Needs to be done *after* currentRenderVfb_ is set.

Fixes #6872.
2014-09-10 23:59:12 -07:00
Unknown W. Brackets
33ac30218a Bind the alphatest tex after we know vert alpha.
Before we sometimes thought alpha test was trivially true when it wasn't.
2014-09-10 23:43:48 -07:00
Unknown W. Brackets
e9b87104ef Move FBO_OLD_AGE to the common header.
Guess it's fine here.
2014-09-09 23:11:25 -07:00
Unknown W. Brackets
e2a4a50511 d3d: Centralize framebuf creation/switch logic. 2014-09-09 22:58:43 -07:00
Unknown W. Brackets
ae2e8c5c7c d3d: Migrate a few more things into common code. 2014-09-09 22:58:11 -07:00
Unknown W. Brackets
8c229e00b4 d3d: Begin centralizing framebuffer management. 2014-09-09 08:12:42 -07:00
Unknown W. Brackets
9af40cb14f d3d: Update the texture cache to mostly match.
Now we can reduce the differences down.
2014-09-09 00:53:01 -07:00
Unknown W. Brackets
bc6a67babf d3d: Use unsigned Z in throughmode. 2014-09-08 21:06:26 -07:00
Unknown W. Brackets
b45711ba94 d3d: Centralize parts of the texture cache.
Should merge these.
2014-09-08 20:55:56 -07:00
Unknown W. Brackets
04147827ee Account for texel offsets in the frag test lookup.
Darn, thought this wouldn't be necessary but it is is for 1/255 and other
values.

Without cache:
PowerVR: temp, add, mul, fract, mul, compare
Other: mul, add, floor, compare

With cache: mul, add, texture lookup, compare
2014-09-08 19:04:44 -07:00
Unknown W. Brackets
ac97f1ed96 Avoid a very unlikely fbo leak. 2014-09-08 07:41:23 -07:00
Unknown W. Brackets
7e248376f8 Track the last drawn width/height/format.
This way we can apply render-to-self effects more correctly.
2014-09-08 07:40:43 -07:00
Unknown W. Brackets
76d5f67796 Arg, fix color testing from frag test cache. 2014-09-07 23:21:22 -07:00
Unknown W. Brackets
2532639f70 Refactor fbo binding into DrawPixels(). 2014-09-07 21:53:22 -07:00
Henrik Rydgård
1985e6db9a Merge pull request #6853 from unknownbrackets/testcache
Cache fragment test results using a texture
2014-09-07 23:55:53 +02:00
Unknown W. Brackets
072e9c3a0d Use a more logical name for the test tex creator. 2014-09-07 14:52:22 -07:00
Unknown W. Brackets
c0908421ba Skip binding when the test won't be used. 2014-09-07 10:06:57 -07:00
Unknown W. Brackets
95a620695b Actually cache the last bound test texture. 2014-09-07 10:06:23 -07:00
Unknown W. Brackets
94c1271761 Add an experiment with using a texture for tests.
Using an option for now so it's easy to test, if it works well we can
maybe remove the option.
2014-09-07 10:04:57 -07:00
Unknown W. Brackets
b20cd3cba2 Clear stencil on switch from 565 buffer.
Fixes #2094, shadows in Kingdom Hearts in some scenes.

Not a complete solution, but should be a relatively safe one.
2014-09-07 08:47:46 -07:00
Unknown W. Brackets
47e98f972d Try to simplify alpha replace for poor compilers. 2014-09-07 08:25:39 -07:00
Unknown W. Brackets
de2c951665 Detect EXT_gpu_shader4 to use bitwise ops pre-3.3.
This may allow it to work on more cards, and should fix a (probably driver
bug) error we've had reported in GL 3.0 / GLSL 1.3.
2014-09-04 00:39:54 -07:00
Unknown W. Brackets
514772e18e Avoid some magic numbers. 2014-08-30 22:06:25 -07:00
Unknown W. Brackets
337b34ef6a Eat cycles during block transfers.
Tests show this takes a number very close to 1.9 times the number of bytes
in cycles @222.

Using that value caused a tiny fps drop in one area of the God of War
demo, which may be correct but might also cause complaints.  A lot of our
other timing is not accurate, so using a lower value (1.6) to be on the
safer side.

This may cause things to reschedule more accurately when games drawsync,
and improves the gpu/commands/blocktransfer test.
2014-08-30 22:02:28 -07:00
Unknown W. Brackets
5e07a40a83 Oops, buildfix Android/etc.
This is not declared there.
2014-08-30 07:13:36 -07:00
Unknown W. Brackets
361b9a2572 Use 8888, always, for Danganronpa's FBOs.
This should fix dithering on draw causing problems for Adreno 3xx devices.
2014-08-30 02:05:51 -07:00
Unknown W. Brackets
5a3a972d95 Perform intra-buffer blits directly.
As far as I can tell, this doesn't need a temp fbo.
2014-08-27 23:13:08 -07:00
Unknown W. Brackets
9cab344026 Rebind the fbo after inter-buffer copy.
Might be needed if the list is stalled, a copy is done, list unstalled,
and then something happens to flush a pending prim.
2014-08-27 23:10:07 -07:00
Unknown W. Brackets
fc5d62804e Avoid unbinding the draw fbo where possible.
If we're just going to bind another one, no need to trade around.
2014-08-27 23:08:17 -07:00
Unknown W. Brackets
77e050d044 Only unbind the read fbo id draw can be skipped. 2014-08-27 23:07:11 -07:00
Unknown W. Brackets
a8b78a46bd Forget the bound texture on fbo_create().
Just in case, since it overrides the texture.
2014-08-27 23:05:21 -07:00
Unknown W. Brackets
b4b81744ee Use dst factor w/ dst in reverse sub blending. 2014-08-26 00:39:14 -07:00
Henrik Rydgård
caa34c4db8 Merge pull request #6777 from unknownbrackets/gpu-blend
Use blending to approximate incr/decr/invert
2014-08-25 11:38:08 +02:00
Unknown W. Brackets
42aa494aeb d3d: Get some initial GE previews working.
Wrong colors.
2014-08-24 21:52:47 -07:00
Unknown W. Brackets
39ee5bb6b7 Support stencil incr/decr even without blending. 2014-08-24 10:24:30 -07:00
Unknown W. Brackets
17ab856a35 Always zero drawn pixels with zero. 2014-08-24 10:24:29 -07:00
Unknown W. Brackets
757f10d47a Oops, equation not func. 2014-08-24 10:24:29 -07:00
Unknown W. Brackets
90746fb5b2 Support INVERT with stencil alpha replacement. 2014-08-24 10:24:28 -07:00
Unknown W. Brackets
0018638458 Support INCR/DECR with stencil value replacement. 2014-08-24 10:24:28 -07:00
Henrik Rydgard
1d7642fa48 Remove most mentions of the "_XBOX" define 2014-08-24 14:21:35 +02:00
Henrik Rydgard
6011255e6f D3D: Don't display buffered rendering upside down. Support screen scaling filter setting 2014-08-24 14:04:55 +02:00
Ced2911
d4adc3abb8 [dx9] don't do alpha test in pixel shader, use state mapping
hrydgard: Cleaned up a bit, disabled by default

Conflicts:
	GPU/Directx9/TextureCacheDX9.cpp
2014-08-24 09:52:34 +02:00
Henrik Rydgård
f8a4236d58 Merge pull request #6679 from unknownbrackets/gpu-blend
Handle doubled alpha blending using premultiplication
2014-08-22 10:06:24 +02:00
Unknown W. Brackets
1e057a76b5 Convert all CLUT entries ever loaded.
Some games reuse previously loaded bytes, like World Neverland.  We
displayed bad colors in these cases when we don't convert all the entries.

Technically, this means we're hashing less than used in these cases, but if
we hash more we will get lots of false cache misses.

Fixes #6752.
2014-08-19 22:31:09 -07:00
Unknown W. Brackets
7f61da2e5a Add a hack for Silent Hill games.
Either way has different problems, but it sounds like this will work
better for Silent Hill.  Probably still rendering wrong, unfortunately.
2014-08-18 23:20:49 -07:00
Unknown W. Brackets
a43c3771a3 More correctly blend when hitting the frame cap.
If we hit too many blits per frame, fall back correctly in the shader.
2014-08-18 23:20:48 -07:00
Unknown W. Brackets
422db25277 Optimize fixed color blending that isn't blending.
Gods Eater Burst uses this, for example.
2014-08-18 23:20:48 -07:00