Commit Graph

3060 Commits

Author SHA1 Message Date
Unknown W. Brackets
8c4c9e554e d3d: Cache offscreen surfaces. 2014-09-13 22:28:39 -07:00
Unknown W. Brackets
ff3c5075fa d3d: Apply a half pixel offset when rendering.
Makes things a lot sharper, although there still seem to be problems.
This makes it so the viewport aligns with pixel edges rather than centers
at whole integers.
2014-09-13 22:08:43 -07:00
Unknown W. Brackets
0d1a529b01 d3d: Fix 4444 framebuffer data upload. 2014-09-13 21:50:38 -07:00
Unknown W. Brackets
95bf3a71dd d3d: Properly cache the DrawPixels tex size. 2014-09-13 21:45:18 -07:00
Unknown W. Brackets
abb2ce325c d3d: If possible, use StretchRect() to display.
May be faster, has less half-pixel offset issues.  Still seeing blurriness
problems, but they're better.
2014-09-13 20:31:01 -07:00
Unknown W. Brackets
822c5d9e75 d3d: Use StretchRect() when possible. 2014-09-13 20:08:29 -07:00
Unknown W. Brackets
003aaed9a7 d3d: Dirty the shader when drawing textures. 2014-09-13 20:05:41 -07:00
Unknown W. Brackets
98549aeb51 d3d: Fix download of small sections, oops. 2014-09-13 19:57:49 -07:00
Unknown W. Brackets
e4d5eb5d6c d3d: Dynamically size the drawPixelsTex_ like gl. 2014-09-13 19:56:08 -07:00
Unknown W. Brackets
6490a4ef44 d3d: Report errors on download/blit/upload. 2014-09-13 19:21:59 -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
2d530a916f d3d: Always download 8888, at least for now. 2014-09-13 18:25:45 -07:00
Unknown W. Brackets
d332452077 d3d: Track memory copies/uploads/downloads. 2014-09-13 17:59:21 -07:00
Unknown W. Brackets
9d24de3269 d3d: Oops, switch over block transfer logic. 2014-09-13 17:28:35 -07:00
Unknown W. Brackets
ddc9aaa4e8 d3d: Download from the specified region only. 2014-09-13 17:28:05 -07:00
Unknown W. Brackets
c17931c179 d3d: Fix flipped y in framebuf blit. 2014-09-13 17:10:57 -07:00
Unknown W. Brackets
b9d7ffe484 d3d: Support the Danganronpa hack. 2014-09-13 16:47:23 -07:00
Unknown W. Brackets
1f44bf2396 d3d: Don't flip blits when downloading. 2014-09-13 16:39:31 -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
96b497f955 d3d: Support arbitrary size framebuf uploads. 2014-09-13 14:54:53 -07:00
Unknown W. Brackets
b79062339b d3d: Fix colors in UpdateFromMemory(). 2014-09-13 14:53:43 -07:00
Henrik Rydgard
170e88838f Slightly improve GPU disassembly 2014-09-13 23:51:07 +02:00
Henrik Rydgard
02a89306d1 Warning fixes, sprintf->snprintf 2014-09-13 23:51:07 +02: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
Henrik Rydgård
c21c432486 Merge pull request #6855 from unknownbrackets/vertexcache
Use a minihash in the vertex cache, treat unreliable arrays more carefully
2014-09-13 23:20:26 +02:00
Henrik Rydgard
82bb5c1227 d3d: Tiny crashfix 2014-09-13 23:03:52 +02: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
Unknown W. Brackets
dc5afe9b38 d3d: Converge DrawPixels() logic.
This makes render to offset actually work properly.
2014-09-13 13:09:26 -07:00
Unknown W. Brackets
4909122660 d3d: Flip viewport y within the top of the fb.
Fixes issues when the framebuffer is larger than the current render
target.
2014-09-13 12:37:19 -07:00
Unknown W. Brackets
de6a168c97 d3d: Flip v correctly when buffer swapping. 2014-09-13 12:21:39 -07:00
Unknown W. Brackets
f3dbe526a9 d3d: Support offset rendering. 2014-09-13 12:08:14 -07:00
Unknown W. Brackets
5a0f646916 Merge pull request #6900 from hrydgard/gpu-convergence-2
Gpu convergence 2 - break out much of the Spline code into GPU/Common, fixes some minor things
2014-09-13 12:06:35 -07:00
Henrik Rydgard
0818d8ea8d dx9: More execute functions 2014-09-13 20:55:29 +02:00
Unknown W. Brackets
36a49917d2 d3d: Set texture only when enabled.
This allows optimizations that were applied to the cmd flags.
2014-09-13 11:55:01 -07:00
Unknown W. Brackets
e6f1ca6582 d3d: Correct framebuffer sizing issues. 2014-09-13 10:34:45 -07:00
Henrik Rydgard
21545e31c6 More convergence (tex stuff) 2014-09-13 17:20:55 +02: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
2f569533f3 Fix burnout depth issue by dirtying the proj matrix on viewport change 2014-09-13 14:08:07 +02:00
Henrik Rydgard
63e3e95d58 Replace the DX9 software transform code with the new common one 2014-09-13 13:53:04 +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
Henrik Rydgård
405f67fbef Merge pull request #6870 from hrydgard/vtxdec-centralize
Centralize the vertex decoder
2014-09-13 01:03:22 +02:00
Henrik Rydgard
c25815b904 DX9: Must turn off vertex caching for software skinned draws 2014-09-13 01:02:47 +02:00
Unknown W. Brackets
c288a52975 d3d: Oops, fix dumb CheckAlpha() mistake. 2014-09-12 08:12:16 -07:00
Unknown W. Brackets
ca33ddd4db d3d: Fix some missing Releases() in debug code. 2014-09-11 23:52:06 -07:00
Unknown W. Brackets
77cd49622b d3d: Fix switching between rendering modes. 2014-09-11 23:30:42 -07:00
Unknown W. Brackets
6ae6d53bd7 d3d: Fix CheckAlpha() for 16-bit formats.
Not reversed in d3d, unlike gles.  Fixes #6883.
2014-09-11 22:59:33 -07:00
Henrik Rydgard
e75551d5cd D3D vtxdec: Fix nrm stuff 2014-09-12 02:00:35 +02:00
Henrik Rydgard
38b803aba4 DX9: Enable vtxdec JIT, buildfix 2014-09-12 02:00:34 +02:00
Henrik Rydgard
4035b28503 Fix some endian-ness in generic vtxdec 2014-09-12 02:00:34 +02:00
Henrik Rydgard
1407648b59 D3D vtxdec: Convert weights and normals to float 2014-09-12 02:00:33 +02:00
Henrik Rydgard
0727df6f0a Jit the most common of the "ToFloat" texcoord conversions 2014-09-12 02:00:33 +02: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
chinhodado
fd13fcfa86 Fix a wrong condition 2014-09-11 15:21:18 -04:00
Henrik Rydgård
7ffb4602e3 Merge pull request #6873 from hrydgard/d3d-shader-cleanup
D3D shader cleanup - remove LinkedShaders and use fixed constant slots
2014-09-11 19:59:55 +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
chinhodado
31fc179bc2 Fix a wrong condition 2014-09-10 19:50:31 -04:00
Henrik Rydgard
7b66059ae0 D3D: Assorted cleanup. Add a missing register specification. 2014-09-10 15:20:57 +02:00
Henrik Rydgard
163f81e5be DX9: "Linked" shaders are now pointless, so remove them. 2014-09-10 14:07:30 +02:00
Henrik Rydgard
0dc6150a2e DX9: Not much point in tracking dirtiness per shader now that all constants are shared. 2014-09-10 13:57:19 +02:00
Henrik Rydgard
8bca420c0a Some renaming 2014-09-10 13:48:55 +02:00
Henrik Rydgard
bf7a4f9097 D3D: Use fixed constant registers for vertex shaders too. 2014-09-10 13:43:35 +02:00
Henrik Rydgard
d2d563cd2c D3D: Use fixed constant registers for pixel shader constants 2014-09-10 12:59:33 +02:00
Henrik Rydgard
14c8733def Uniforms/constants aren't shared in D3D, let's not pretend they are. 2014-09-10 12:40:15 +02:00
Henrik Rydgard
6fa1872163 DX9: Disable an annoying warning in vertex shader generator to clean up our reports
warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them
2014-09-10 11:04:37 +02:00
Unknown W. Brackets
417bfc74c3 d3d: Fix drawpixels texture. 2014-09-09 23:55:00 -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
Henrik Rydgard
8ef326e531 D3D: Remove now-redundant texture coord scaling now that we decode the 8-bit and 16-bit formats in the vertex decoder 2014-09-09 22:32:59 +02:00
Henrik Rydgard
422ae62b63 D3D9: Add support for D3D9Ex, which has faster flipping and an option for lower latency, and some other stuff.
MANAGED textures are not allowed though so compensate for that by making them dynamic for now.
2014-09-09 22:28:35 +02:00
Unknown W. Brackets
8c229e00b4 d3d: Begin centralizing framebuffer management. 2014-09-09 08:12:42 -07:00
Unknown W. Brackets
d59aa06a3b d3d: Improve GE debugger with render-to-tex.
Also fix a crash in oddly sized framebuffers.
2014-09-09 01:42:21 -07:00
Unknown W. Brackets
e3d0703bbb d3d: Fix texture scaling. 2014-09-09 01:22:11 -07:00
Unknown W. Brackets
02a3ebcb8a d3d: Add vertex full alpha detection. 2014-09-09 01:03:08 -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
1b12ad1b91 d3d: Fix a shader warning from sw transform. 2014-09-08 22:18:34 -07:00
Unknown W. Brackets
f770b599d9 d3d: Reset scissor/viewport on fbo bind.
Maybe a better way, the state is forgotten on bind so if we try to set it
again, it'll be ignored.  Fixes map in Star Ocean 1.
2014-09-08 22:12:13 -07:00
Unknown W. Brackets
932a593576 d3d: Clamp depth viewport to [0, 1] also. 2014-09-08 21:55:28 -07:00
Unknown W. Brackets
cfee8f81e8 d3d: Oops, typo in texcache. 2014-09-08 21:43:38 -07:00
Unknown W. Brackets
030a9d55e7 d3d: Use unnormalized values for alpha testing.
Fixes Tales of Eternia's world map, Popolocrois everwhere, etc.

If PowerVR is using this method on GLES, it may be broken for the same
reasons.
2014-09-08 21:37:25 -07:00
Unknown W. Brackets
52c1b37465 d3d: Handle texture swizzling in ge preview. 2014-09-08 21:25:37 -07:00
Unknown W. Brackets
bc6a67babf d3d: Use unsigned Z in throughmode. 2014-09-08 21:06:26 -07:00
Unknown W. Brackets
8aac734547 d3d: Correct texcoord scale.
Very obvious in for example LittleBigPlanet.
2014-09-08 21:00:46 -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
375e102647 d3d: Fix some shader issues with tex projection. 2014-09-08 19:33:12 -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
Henrik Rydgard
aaa0180114 D3D: Always decode U16 coords to floats as there's no good corresponding vertex format that works on all GPUs.
Fixes Burnout and probably many more games.
2014-09-09 00:42:12 +02:00
Henrik Rydgard
ef0ae77e98 D3D: some cleanup and a crashfix on shutdown 2014-09-09 00:29:01 +02:00
Unknown W. Brackets
923c535deb Merge pull request #6861 from hrydgard/depth-d3d
Improve depth buffering in D3D by computing a depth-flipped proj matrix but only when needed.
2014-09-08 14:17:19 -07:00
Henrik Rydgard
0a74243b61 Remove lying comment 2014-09-08 23:14:33 +02:00
Henrik Rydgard
01a1438dce Improve depth buffering in D3D by computing a depth-flipped proj matrix but only when needed. 2014-09-08 23:10:23 +02: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
Henrik Rydgård
d98480085a Merge pull request #6854 from unknownbrackets/d3d9
Report shader errors in Direct3D 9, plug some leaks
2014-09-07 23:38:35 +02:00
Unknown W. Brackets
858df90dff d3d: Release shaders and fbos on shutdown. 2014-09-07 13:15:39 -07:00
Unknown W. Brackets
34b1d13c29 d3d: Release vertex decls on shutdown. 2014-09-07 13:07:12 -07:00
Unknown W. Brackets
564ae9f184 d3d: Report shader compilation failures. 2014-09-07 11:01:19 -07:00
Unknown W. Brackets
4d54cad9bd d3d: Reduce D3DX leaks. 2014-09-07 10:38:49 -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
Henrik Rydgard
780ed765c7 Update dx9sdk (got rid of redundant headers) 2014-09-07 10:45:38 +02:00
Unknown W. Brackets
ebe71e3ec4 d3d: Properly initialize cullmode. 2014-09-06 23:01:04 -07:00
Unknown W. Brackets
5639b056b3 d3d: Use 0 texcoord when not specified. 2014-09-06 23:01:04 -07:00
Unknown W. Brackets
a29c2f4f2f d3d: Use 2.0 vertex and pixel shaders. 2014-09-06 23:01:03 -07:00
Unknown W. Brackets
07ccc37689 d3d: Use drawPixelsTex as a non-dynamic texture. 2014-09-06 23:01:03 -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
Henrik Rydgård
94ee0c5a01 Merge pull request #6815 from unknownbrackets/gpu-minor
Eat cycles during GE block transfers
2014-08-31 09:29:09 +02:00
Unknown W. Brackets
e1d2e72480 Add block transfer to null gpu.
For tests, better to have it here.
2014-08-30 22:14:58 -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
9ce5c49978 d3d: Add basic stencil mask handling.
Mostly so we have it in dxstate, will probably reorganize stuff later.
2014-08-30 11:18:18 -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
Henrik Rydgård
c5e80d0999 Merge pull request #6801 from unknownbrackets/d3d
d3d: Avoid rewriting textures to BGRA from RGBA, just swizzle
2014-08-28 11:21:19 +02:00
Unknown W. Brackets
4e5778d714 d3d: Correctly disable stencil testing. 2014-08-28 01:21:29 -07:00
Unknown W. Brackets
1f51fe7843 d3d: Avoid rewriting textures, just swizzle.
Luckily A is in the same place and the same width, so we can do this for
all but framebuffers easily.

Technically we could do it in OpenGL as well.

Small (1-2%) performance improvement in FF2.
2014-08-28 01:20:21 -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
140eb82821 d3d: Don't flip render-to-tex.
Fixes flipped screens and objects in a bunch of games.
2014-08-27 07:19:41 -07:00
Unknown W. Brackets
2191382a7a d3d: Scale positions by 128/32768. 2014-08-26 08:18:24 -07:00
Unknown W. Brackets
d987cfea37 d3d: Cache sampler/render state like in GL.
Small 3% performance improvement.  Also, would prefer to have the bugs
from this now rather than later.
2014-08-26 08:08:02 -07:00
Unknown W. Brackets
5e528f673d d3d: Set the lod bias for textures.
Why aren't these caching?
2014-08-26 07:58:09 -07:00
Unknown W. Brackets
b8e768066f d3d: Remove another use of D3DCOLOR.
Fixes more colors.
2014-08-26 07:46:22 -07:00
Unknown W. Brackets
b4b81744ee Use dst factor w/ dst in reverse sub blending. 2014-08-26 00:39:14 -07:00
Unknown W. Brackets
2448386e8a d3d: Specify clamping incr/decr of stencil. 2014-08-26 00:23:34 -07:00
Henrik Rydgård
44df3cee06 Merge pull request #6784 from unknownbrackets/d3d
Clean up some normal handling and a shader error in D3D
2014-08-25 18:32:08 +02:00
Unknown W. Brackets
a34bf158e3 d3d: Clean up some normal handling.
So hardware and software transform match gles.
2014-08-25 07:43:19 -07:00
Unknown W. Brackets
170036e171 d3d: Fix another shader compile error. 2014-08-25 07:31:10 -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
78c342889e d3d: Prevent crash on Release() of render-to-tex.
Might be safer to do as we do in GLES and always have a texture...
2014-08-25 02:15:02 -07:00
Unknown W. Brackets
a533d76c8e d3d: Convert DXT texture colors.
Doesn't seem like this is 100% correct though, not sure.
2014-08-25 02:00:55 -07:00
Unknown W. Brackets
5e829f06e8 d3d: Fix a shader compiler error. 2014-08-25 01:39:04 -07:00
Unknown W. Brackets
41d699ba98 d3d: Unbreak hardware transform, oops.
This was broken by my earlier commit.  Now we can send colors directly.
2014-08-25 01:16:49 -07:00
Henrik Rydgård
64100dc642 Merge pull request #6780 from unknownbrackets/ge-debugger
Welcome Direct3D9 to the GE debugger family
2014-08-25 09:59:46 +02:00
Unknown W. Brackets
c65f9603bd d3d: Fix some RGBA / ARGB color issues.
I wonder if we should just send floats here?  We denormalize and then
renormalize in software...
2014-08-24 23:34:48 -07:00
Unknown W. Brackets
d2018f4aea d3d: Copy over the vertex preview stuff.
Really need to just centralize, I know.  But want a debugger that works
first.
2014-08-24 22:19:59 -07:00
Unknown W. Brackets
4a615dc46c Support BGRA formats in the debugger previews. 2014-08-24 22:08:28 -07: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
fdc5d02e27 [Gpu] Various speedup (texture cache not tested ...) 2014-08-24 13:43:34 +02:00
Ced2911
ef54989598 [Gpu] update code, cleanup shaders generation: fixes rr2 lighting !
Conflicts:
	GPU/Directx9/PixelShaderGeneratorDX9.cpp
	GPU/Directx9/ShaderManagerDX9.cpp
	GPU/Directx9/VertexDecoderDX9.cpp
2014-08-24 13:43:09 +02:00
Ced2911
9caa783137 [Gpu] Sync with gles
Conflicts:
	GPU/Directx9/GPU_DX9.cpp
2014-08-24 10:46:41 +02:00
Ced2911
49cc8e7312 [Gpu] Sync with gles
Conflicts:
	GPU/Directx9/FramebufferDX9.cpp
	GPU/Directx9/FramebufferDX9.h
	GPU/Directx9/TransformPipelineDX9.cpp
2014-08-24 10:40:16 +02:00
Ced2911
6ee39c9abd [Gpu] Update
Conflicts:
	GPU/Directx9/FramebufferDX9.cpp
	GPU/Directx9/FramebufferDX9.h
	GPU/Directx9/VertexDecoderDX9.cpp
	GPU/Directx9/helper/fbo.cpp
2014-08-24 10:29:47 +02:00
Ced2911
e0c3b5a112 [Gpu] somes fixes, monster hunter 2 run between 140 and 200% with vertex cache enabled
Conflicts:
	GPU/Directx9/FramebufferDX9.cpp
	GPU/Directx9/GPU_DX9.cpp
	GPU/Directx9/VertexDecoderDX9.cpp
	GPU/Directx9/helper/global.cpp
2014-08-24 10:21:08 +02:00
Ced2911
ace1e71456 [Misc] Windows fixes
Conflicts:
	GPU/Directx9/TransformPipelineDX9.cpp
	GPU/Directx9/VertexDecoderDX9.cpp
	GPU/Directx9/helper/fbo.cpp
	GPU/Directx9/helper/global.cpp
2014-08-24 10:17:11 +02:00
Henrik Rydgard
dcd8753ee1 Cherry-pick a tiny part of cf41d2af29633146e5b07c8851382efe72491091 2014-08-24 09:56:01 +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
5d836bfa5a Merge pull request #6765 from hrydgard/thin3d
Switch UI drawing from GL to Thin3D. This activates the D3D9 path as well.
2014-08-23 10:52:21 +02:00
Henrik Rydgard
1556234825 Bit more d3d stuff. Can't get depth right, pretty sure it's the projection matrix calc. 2014-08-23 01:52:46 +02:00
Henrik Rydgard
a758917919 D3d cleanups and improvements 2014-08-22 22:16:46 +02:00
Henrik Rydgard
00d5793f7d D3D9: Don't crash on bad vertex formats. 2014-08-22 21:27:27 +02:00
Henrik Rydgard
e2ecbb7a4d Convert more UI code to Thin3D 2014-08-22 20:55:18 +02:00
Henrik Rydgard
e539c7009f Hook up DX9 backend. Not really working though, it seems. 2014-08-22 20:55:12 +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
Henrik Rydgård
d52c87d82c Merge pull request #6722 from sum2012/wwe
check for duplicated stack addresses by JimLee168
2014-08-20 16:34:02 +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
Unknown W. Brackets
b79e4d22b8 Improve a possible obscure blend mode.
Seems like this would be likely to get overlap problems.
2014-08-18 23:20:47 -07:00
Unknown W. Brackets
0904085eb5 Avoid using fbo copies for the common 2a + 1-2a.
We won't even get it right that often since the copy doesn't deal with
overlap properly.
2014-08-18 23:20:47 -07:00
Unknown W. Brackets
5d1b1ab547 Dirty the fixed color when premultiplying. 2014-08-18 23:20:46 -07:00
Unknown W. Brackets
a41333c012 Avoid premultiplying easy fixed colors. 2014-08-18 23:20:46 -07:00
Unknown W. Brackets
24a0dd12ef Avoid recalculating replaceBlend so many times. 2014-08-18 23:20:45 -07:00
Unknown W. Brackets
44620c92ed Premultiply for doubled alpha blending if possible.
This makes the effect more accurate where the values were being clamped
before.  Some obscure methods of blending may be slower.
2014-08-18 23:20:45 -07:00