Commit Graph

3033 Commits

Author SHA1 Message Date
Unknown W. Brackets
67a54504c7 Oops, left the comment in the wrong one. 2014-09-24 23:11:47 -07:00
Unknown W. Brackets
cee2827172 Normalize newlines, no code changes.
We really shouldn't let mixed newlines creep into the codebase.
They're annoying.
2014-09-24 23:10:13 -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
199e6bcd3b Avoid crashing when calling an invalid address.
We already have a check, let's use it properly.
2014-09-23 08:31:29 -07:00
Unknown W. Brackets
9bcffc5b4d Fix divide by zero in memcpy checks.
Happened in Resistance demo.
2014-09-21 21:36:26 -07:00
Henrik Rydgård
b9d3443e1b Merge pull request #6931 from CPkmn/patch-6
D3D9 Get maxAnisotropyLevel from device caps
2014-09-21 22:31:31 +02:00
Unknown W. Brackets
dc6c88d147 d3d9: Mask out alpha using KEEP stencil op. 2014-09-21 12:47:39 -07:00
Unknown W. Brackets
6618681d05 d3d9: Oops, can't use shader blending anyway. 2014-09-21 12:17:16 -07:00
Unknown W. Brackets
4e50eed85b d3d9: Specify tex stage for binding framebuf color. 2014-09-21 12:11:17 -07:00
Henrik Rydgard
718d7e291f d3d9: Add BindFramebufferColor(). 2014-09-21 12:05:29 -07:00
Unknown W. Brackets
856154a5f9 d3d9: Replace alpha and premultiply blend.
Unfortunately they are fairly tied together.
2014-09-21 12:01:49 -07:00
Unknown W. Brackets
6e34fe1c4b d3d9: Fix fbo tex clamp (usually shadows.) 2014-09-21 11:07:02 -07:00
Unknown W. Brackets
ccb6e99e07 d3d9: Disable color doubling without tex.
As the PSP does.
2014-09-21 10:58:21 -07:00
Unknown W. Brackets
8bf13d4214 d3d9: Add stencil and blend replacement helpers. 2014-09-21 10:56:54 -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
9355322824 d3d9: Fix shader compile error X3014. 2014-09-21 09:05:47 -07:00
Unknown W. Brackets
4210ba44eb Clean up a few more ImmPtr() cases. 2014-09-21 08:34:27 -07:00
Unknown W. Brackets
a62f88d1f8 d3d9: Oops, don't need this, no prescale.
Hmm, trying to reduce differences, though...
2014-09-21 00:09:38 -07:00
Unknown W. Brackets
77b2da7345 d3d9: Update some areas of the pix shader.
Will eventually want this to have the clamping etc.
2014-09-21 00:07:07 -07:00
Unknown W. Brackets
6f38c21ccc d3d9: Make the vertex shaders more similar. 2014-09-20 23:55:48 -07:00
CPkmn
d0b225df7c D3D9 Get maxAnisotropyLevel from device caps 2014-09-20 22:39:01 -07:00
Henrik Rydgard
34f7b90c1d DX9: Don't set mipfilter to aniso, it's enough to set the minfilter.
Remove erroneuos comment.
2014-09-20 21:14:42 +02:00
Unknown W. Brackets
6d08b363c2 d3d9: Use a half-pixel offset when drawing a tex.
Fixes half pixel offset issues (center of pixels is 0,0 in d3d9, but
texels are at 0.5/w,0.5/h.)
2014-09-20 08:30:30 -07:00
Unknown W. Brackets
8d4a642787 Merge pull request #6925 from hrydgard/d3d9-matrixopt
D3D9 - use 4x3 matrices where possible
2014-09-20 08:26:42 -07:00
Henrik Rydgard
98337c68f3 DX9: fix type in texture filter selection 2014-09-20 14:06:02 +02:00
Henrik Rydgard
e04b67dad4 When aniso filtering is enabled, force it on for min filtering but not for mag filtering. 2014-09-20 13:04:32 +02:00
Henrik Rydgard
f416978013 DX9: Support anisotropic filtering. Fixes #6929 2014-09-20 10:32:43 +02:00
Henrik Rydgard
9bb5bd6fb3 Of course have to update these as well. 2014-09-19 00:39:34 +02:00
Henrik Rydgard
9c625a79a1 DX9: Use 4x3 matrices for bones too. Compact shader constants. 2014-09-18 23:14:53 +02:00
Henrik Rydgard
6304d60b40 Convert 4x4 to 4x3 matrices where possible (except bones) 2014-09-18 23:08:46 +02:00
Henrik Rydgård
23ade6108d Merge pull request #6917 from unknownbrackets/vertexjit
Add x86 weight ToFloat handling for d3d9
2014-09-18 17:48:22 +02:00
Unknown W. Brackets
967df9c018 vertexjit: Use SSE4 in tc u8/u16 code.
It's not much different for non-SSE 4, might as well be common.
2014-09-17 23:15:24 -07:00
Unknown W. Brackets
5276487611 vertexjit: Use SSE for all weights, u8/u16. 2014-09-17 23:14:36 -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
9755f6ba49 Really set maxindex correctly.. 2014-09-17 23:28:46 +02:00
Henrik Rydgard
decdfadabc DX9: Specify max index correctly 2014-09-17 22:06:34 +02:00
Henrik Rydgard
e07d836d7c D3D: Specify maxindex correctly in DrawIndexedPrimitive 2014-09-17 22:04:10 +02:00
Henrik Rydgard
60c8cdec39 Clean up some indentation 2014-09-17 22:03:44 +02:00
Henrik Rydgard
5e2c30c640 Move GetCurrentSimpleVertices to DrawEngineCommon 2014-09-17 21:37:53 +02:00
Henrik Rydgard
cef5f5be40 Fix DX9 bbox crash (DrawEngine::decoded wasn't initialized, because it also existed in the DX9 draw engine) 2014-09-17 21:31:22 +02:00
Unknown W. Brackets
4c1061ff4a vertexjit: Optimize the d3d9 weights a bit.
Only used without skinning on, or with morph, of course.
2014-09-17 08:39:56 -07:00
Unknown W. Brackets
062bcceeee Oops, forgot to multiply. 2014-09-17 08:27:44 -07:00
Unknown W. Brackets
f426be59b4 vertexjit: Initial u8/u16 weights for d3d9. 2014-09-16 23:28:35 -07:00
Unknown W. Brackets
37f90597e3 vertexjit: Optimize u8/u16 weights a little.
Only for uncommon values.
2014-09-16 23:28:28 -07:00
Unknown W. Brackets
94c865b0ab d3d: Fix auto texture scaling.
Fixes #6913.
2014-09-15 07:09:25 -07: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
c4b6e74999 d3d: Fix vertex cache alpha flag tracking. 2014-09-14 13:49:59 -07:00
Unknown W. Brackets
d2df54153d d3d: Fix some issues with the vertex cache. 2014-09-14 13:35:19 -07:00
Henrik Rydgård
ee8178d8e4 Merge pull request #6907 from unknownbrackets/d3d-mipmap
d3d: Enable mipmapping
2014-09-14 21:40:02 +02: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
937fe0ea57 d3d: Use INTZ if supported.
No performance impact on my card, and allows downloading depth/stencil
data.
2014-09-14 11:20:59 -07:00
Unknown W. Brackets
2c88935755 d3d: Support depth and stencil in the GE debugger.
But, not with our current depth surfaces.
2014-09-14 11:15:37 -07:00
Unknown W. Brackets
fee1ab98ba Add support for 24/8 textures in the GE debugger. 2014-09-14 11:13:03 -07:00
Unknown W. Brackets
bccb8dfb1e d3d: Correct render-to-texture effects.
Was checking the corners wrong.
2014-09-14 09:37:59 -07:00
Unknown W. Brackets
6af41aeed9 d3d: Enable mipmapping. 2014-09-14 09:14:04 -07:00
Henrik Rydgard
8175c014e2 Warning fixes 2014-09-14 17:38:49 +02: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
bb7f3c0762 d3d: Fix silly typo in stencil handling.
Now it works.
2014-09-14 07:56:48 -07:00
Henrik Rydgard
a074bf1677 Delete some dead and duplicated code 2014-09-14 13:23:36 +02: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
db4fedcbc0 d3d: Fix a missing include. 2014-09-14 02:01:17 -07:00
Unknown W. Brackets
692cc8dbf1 d3d: Support the Breath of Fire 3 hack.
Since framebuffers are not always flipped.
2014-09-14 00:49:40 -07:00
Unknown W. Brackets
d48fb04a18 d3d: Declare a couple overrides. 2014-09-14 00:34:52 -07:00
Unknown W. Brackets
b0cad8ecac d3d: StretchRect properly at > 1x. 2014-09-14 00:26:35 -07:00
Unknown W. Brackets
26978ad7e0 d3d: Allow blit to self in block transfers/etc. 2014-09-13 22:39:54 -07:00
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