Commit Graph

2003 Commits

Author SHA1 Message Date
Unknown W. Brackets
b9652c2112 Ignore sizes with unreasonable heights.
God of War sets region to 1024x1024, but doesn't draw in that whole space.
2014-06-03 07:52:05 -07:00
Henrik Rydgård
e6d3a9c1b6 Merge pull request #6211 from unknownbrackets/framebuf-estimate
Another attempt at framebuffer size estimate changes
2014-06-03 10:50:21 +02:00
Unknown W. Brackets
238bdce2b8 Detect if framebuffer clut uses alpha.
It's not a perfect check but it may allow skipping alphatests sometimes.
2014-06-03 01:06:02 -07:00
Unknown W. Brackets
bf788e278d Change CheckAlpha() to apply to any pixel data.
For example, cluts.  But not yet, just changing it here.
2014-06-03 00:59:34 -07:00
Unknown W. Brackets
a18eceac71 Don't skip alpha in 565/clut framebuffers textures. 2014-06-03 00:45:15 -07:00
Unknown W. Brackets
b069462bea Relax display buffer / GetVfbAt() requirements.
Castlevania actually uses a display buffer of 420, it seems.  Since we no
longer allow multiple FBOs at the same address, this should be safe.
2014-06-02 22:51:37 -07:00
Unknown W. Brackets
304d372f48 When clamping height to 512, try region/scissor. 2014-06-02 21:46:22 -07:00
Unknown W. Brackets
78c83e122d Force 481x273 to 480x272, it's seen in a few games. 2014-06-01 23:47:37 -07:00
Unknown W. Brackets
3021640897 Correct widths in stencil upload too. 2014-06-01 21:24:33 -07:00
Unknown W. Brackets
c2ccfd5629 Stop stretching things to the FBO size.
Instead, draw in the top corner.  This way, even if framebuffers get
smaller things stay consistent.
2014-06-01 21:20:04 -07:00
Sacha
319c0efcb2 Remove MAY_HAVE_GLES3 2014-06-02 12:08:49 +10:00
Unknown W. Brackets
cfb21707b6 Take the tallest estimate, scissor may be short.
Even if it's wider but short, it should not reduce the height of the
buffer.
2014-06-01 18:45:25 -07:00
Unknown W. Brackets
d64d2afcb3 Don't allow a zero framebuf stride in estimation. 2014-06-01 18:45:03 -07:00
Unknown W. Brackets
a351a42041 Cleanup some old comments/code. 2014-06-01 14:00:58 -07:00
Unknown W. Brackets
d03397f056 Blit framebuf contents when resizing.
This avoids a blink when sizing up.
2014-06-01 13:53:34 -07:00
Unknown W. Brackets
32439bc006 Recreate framebuffers when they get bigger.
To avoid cases where they remain too small, and to make sure size always
matches up sanely.
2014-06-01 13:53:27 -07:00
Unknown W. Brackets
73234941e1 Consider stride more when determining fb size. 2014-06-01 13:50:37 -07:00
Unknown W. Brackets
003f20c694 Allow scissor, but not depthtest during glClear().
Improves #6210.
2014-06-01 10:34:57 -07:00
Unknown W. Brackets
111b624000 Oops, this will give the right alpha of course.
Although it may not be exactly the same for 4444/5551.
2014-06-01 10:26:41 -07:00
Unknown W. Brackets
c79d0a2e3c Correct alpha in stencil upload, avoid blending.
Docs say blending is slower than masking, makes sense.
2014-06-01 08:47:53 -07:00
Henrik Rydgård
0c7c736522 Merge pull request #6205 from unknownbrackets/replace-funcs
Initial replacement for Star Ocean's stencil upload
2014-06-01 12:22:11 +02:00
Henrik Rydgård
3c521c3f88 Merge pull request #6209 from unknownbrackets/gpu-blocktransfer
Also check for x offsets within block transfers
2014-06-01 12:10:07 +02:00
Unknown W. Brackets
bc618fdb6c Also check for x offsets within block transfers.
Grand Knights History does these too, not just y offsets.  Why does it
bother when block transfer let's you specify the coordinates so exactly?
2014-06-01 02:33:44 -07:00
Unknown W. Brackets
68e5be9381 Doesn't look like these need to use depth/stencil.
May save a bit of VRAM/RAM.
2014-06-01 01:03:44 -07:00
Unknown W. Brackets
3e8442c371 Decimate temporary FBOs after not being used. 2014-06-01 01:03:43 -07:00
Unknown W. Brackets
0846673dc3 Track temporary-use FBOs all in FramebufferManager.
This way it's easier to manage their lifecycle.
2014-06-01 01:03:43 -07:00
Unknown W. Brackets
4195eac04f Get rid of depalFBOs when overwriting textures.
Just in case they are not always used as framebuffers.  We set to 0 later
anyway.
2014-06-01 01:03:04 -07:00
Unknown W. Brackets
4461c7e3c4 Oops, remove an old wrong comment. 2014-05-31 22:07:43 -07:00
Unknown W. Brackets
097ab53952 Enable the glClear() optimization.
It seems to help and so far have not noticed any problems.
2014-05-31 22:07:42 -07:00
Unknown W. Brackets
580143e5e2 Disable vertex arrays before depal as well. 2014-05-31 22:07:42 -07:00
Unknown W. Brackets
e109a547ae Disable vertex arrays not in use. 2014-05-31 22:07:41 -07:00
Unknown W. Brackets
bd67cdab3f Add basic decimation to the depal clut cache. 2014-05-31 22:07:41 -07:00
Unknown W. Brackets
b308aaad03 Update disabled IsReallyAClear() code.
Not sure if there's still something wrong about depth.
2014-05-31 22:07:40 -07:00
Unknown W. Brackets
66fff0601d Upload stencil by bit rather than by value.
Still not the most optimal way, probably, but this was an easy change.
2014-05-31 21:48:12 -07:00
Unknown W. Brackets
7c87138915 Disable the last shader properly. 2014-05-31 21:48:12 -07:00
Unknown W. Brackets
21c1c635d8 Add support for 4444/5551/8888 stencil upload. 2014-05-31 21:48:11 -07:00
Unknown W. Brackets
089ee41d9c Implement a very basic stencil upload.
This is not fast or efficient, but works.
2014-05-31 21:48:09 -07:00
Unknown W. Brackets
e477a765e1 Scale bits better in MakePixelTexture(). 2014-05-31 21:48:08 -07:00
Unknown W. Brackets
c142207a93 Fix a few warnings, mostly type comparisons. 2014-05-31 21:42:57 -07:00
Henrik Rydgård
fd19b8d271 Merge pull request #6197 from unknownbrackets/replace-funcs
Function replacement hooks and some GLES compat replacements
2014-05-31 20:30:30 +02:00
Unknown W. Brackets
1433b98c46 Clean up the framebuffer force downloads. 2014-05-31 10:03:03 -07:00
Sacha
85c42e6932 Switch to libpng17 to resolve NEON issue on iOS + other bug fixes. 2014-05-31 04:36:35 +10:00
Unknown W. Brackets
192945fc71 Allow a memcpy upload in non-buffered rendering. 2014-05-30 09:44:14 -07:00
Unknown W. Brackets
da25de6970 Support block transfer uploads in non-buffered. 2014-05-30 09:25:36 -07:00
Unknown W. Brackets
766968e942 Don't use shader blending without buffers.
Ugh, making ComputeFragmentShaderID() slower again...
2014-05-30 09:01:22 -07:00
Unknown W. Brackets
aecd5bf250 Support render-to-self on GLES2. 2014-05-30 08:53:22 -07:00
Henrik Rydgard
d4c7922c25 framebuffer-clut: Fixes to ES 2.0 path, slight simplification to ES 3.0 path 2014-05-29 12:30:07 +02:00
Unknown W. Brackets
bf5946203d Fix a couple typos, oops.
Framebuffer one probably broke Grand Knights History some, depal one
probably broke some clut stuff.
2014-05-28 00:19:51 -07:00
Henrik Rydgard
06fda72701 framebuffer-clut fixes for ES2 2014-05-28 08:47:54 +02:00
Henrik Rydgard
44d9af9222 Hopefully fix the Manhunt red/green swap 2014-05-27 22:22:56 +02:00
Unknown W. Brackets
29a9ff369e Make a note when we need to reset the shader.
Hmm, not sure this is the cleanest way.
2014-05-27 22:12:25 +02:00
Unknown W. Brackets
14c081904c 5650 is also simple alpha. 2014-05-27 22:12:24 +02:00
Unknown W. Brackets
5f99f663ef Avoid duplicating an FBO when depaletizing it. 2014-05-27 22:12:23 +02:00
Unknown W. Brackets
126ed25a48 Correct clut depal indexing. 2014-05-27 22:11:20 +02:00
Unknown W. Brackets
5ac6fae8bb Validate framebuffer clut shaders on use.
When their parameters are actually the ones we are going to use.
2014-05-27 22:11:20 +02:00
Unknown W. Brackets
7ee6546609 Cache clut textures based on clut format.
Since we would end up with a different palette (size, interpretation of
bits, etc.)
2014-05-27 22:11:19 +02:00
Unknown W. Brackets
aa32bd6aa4 Also disable the logic op when rendering FB w/clut. 2014-05-27 22:11:18 +02:00
raven02
608d43898d Remove AlphaMaskHack 2014-05-27 22:11:18 +02:00
Henrik Rydgard
d90da45a76 On PC, OpenGL 3.3 is enough for the new path, don't need ES 3 full compat. 2014-05-27 22:10:37 +02:00
raven02
e2a4e13e38 Small one , not a big deal 2014-05-27 22:10:37 +02:00
Henrik Rydgard
7062da0483 Fix some more issues. The snow scene in FF Type 0 now looks B/W instead of broken. 2014-05-27 22:10:36 +02:00
Henrik Rydgard
3f16765f1c Allow 512 entries in 16-bit CLUTs. Also, forgot offset. 2014-05-27 22:09:29 +02:00
Henrik Rydgard
c3524246de Add GLES3 path to depalettization. Doesn't seem to help much though, must be missing something. 2014-05-27 22:09:28 +02:00
Henrik Rydgard
b82de69a2d depal: slightly better error reporting. 2014-05-27 22:09:28 +02:00
Henrik Rydgard
8b3f317bbf Typo fixes, thanks raven02. Fix deinitialization crashes. 2014-05-27 22:09:27 +02:00
Henrik Rydgard
634add3a46 Depalettize works at other resolutions than 1x. For some strange reason though if you change resolution in game it breaks. 2014-05-27 22:09:26 +02:00
Henrik Rydgard
d414327da7 Use a small offset to turn NEAREST into floor() when sampling the clut.
Minor fixes and cleanups.
2014-05-27 22:09:25 +02:00
Henrik Rydgard
00c24ad3fc Support aligned 4-bit accesses to 32-bit framebuffers 2014-05-27 22:09:24 +02:00
Henrik Rydgard
ee150fadbb Update CMake and Android build 2014-05-27 22:09:23 +02:00
Henrik Rydgard
f517fa4ac8 Fix typo-bug when setting sampler uniforms, tweak fudge factors. 2014-05-27 22:09:23 +02:00
Henrik Rydgard
d0e65054a4 A bit closer to working. Shadow visible 2014-05-27 22:09:22 +02:00
Henrik Rydgard
8fba7fa98e Initial work on depalettization. 2014-05-27 22:07:24 +02:00
Henrik Rydgård
8d84c912eb Merge pull request #6070 from unknownbrackets/gpu-blend
Apply unsupported blending modes in the shader
2014-05-27 17:45:33 +02:00
Unknown W. Brackets
8dcc09c9e1 Use a separate func for gpu memset(). 2014-05-27 07:50:01 -07:00
Unknown W. Brackets
ba2cf4f1d9 Make sure to rebind a texture after changing it. 2014-05-27 02:04:02 -07:00
Unknown W. Brackets
3e24786eab Disable the scissor test around blits.
Because it applies.
2014-05-27 02:00:28 -07:00
Unknown W. Brackets
fce7d8c697 Ignore the funcs for min/max/absdiff.
Seems from reports that they are indeed ignored, just wanted to verify.
2014-05-27 01:45:21 -07:00
Unknown W. Brackets
8f9a2b9882 Unbind the fbo texture when it's not used.
Just in case there are problems with decimating it or etc.
2014-05-27 01:45:20 -07:00
Unknown W. Brackets
0eae30dddb Set a bit to account for fixa/fixb/etc. logic. 2014-05-27 01:45:20 -07:00
Unknown W. Brackets
b8a2410934 Oops, typo. 2014-05-27 01:45:19 -07:00
Unknown W. Brackets
f80dee4164 Remove outdated comment.
Was all lies.
2014-05-27 01:45:19 -07:00
Unknown W. Brackets
b02fe1db3d Log when blitting a ton per frame, it can get slow. 2014-05-27 01:45:18 -07:00
Unknown W. Brackets
41ca303bee Skip a few more fixa/fixb combos. 2014-05-27 01:45:18 -07:00
Unknown W. Brackets
a67327759f Double using multiply not add, should be fine. 2014-05-27 01:45:17 -07:00
Unknown W. Brackets
4b978ed6f9 Apply unsupported blending modes in the shader.
This handles unsupported fixed color combinations, alpha doubling, etc.
Where possible, tries to avoid it - it means using a blit (without the
framebuffer fetch extension), which can slow things down a lot with tons
of drawcalls.
2014-05-27 01:45:17 -07:00
Unknown W. Brackets
64f6012dba Support memsets of framebuffers as uploads.
Technically should clear stencil too... maybe it'd be better to handle
separately.
2014-05-27 01:17:09 -07:00
Unknown W. Brackets
95003cb77d Oops, reversed the check. 2014-05-27 00:57:40 -07:00
Unknown W. Brackets
2dbf680278 Play it a bit safer on rendering mode changes.
This way funny things should be less likely.
2014-05-26 23:28:54 -07:00
Unknown W. Brackets
4095831772 Allow changing "read framebuffers" at runtime.
Fixes #6149.
2014-05-26 23:26:29 -07:00
sum2012
03f9c3fe27 Add a missing Dangan Ronpa 1 hack
Dangan-Ronpa 1 PSP The Best Ver
2014-05-27 06:38:56 +08:00
Unknown W. Brackets
1a8369e51c Apply a very specific hack for Danganronpa.
This should allow playing at non-1x resolutions, and without slowing down
the entire game just for one small framebuffer.

Generally, hacks are a bad thing.  But even with memcpy and block transfer
stuff, we'll never be able to solve this game without some sort of hack.
Detecting memory reads will complicate cross-platform compat or slow
things down.
2014-05-26 11:40:46 -07:00
Unknown W. Brackets
ee8a180c41 Set the viewport on upload so 2x, etc. work. 2014-05-26 01:21:30 -07:00
Unknown W. Brackets
6243d0e8de Account for bpp mismatch in xfer upload. 2014-05-26 00:52:06 -07:00
Unknown W. Brackets
a29d2e418e When multiple framebuffers match, use nearest. 2014-05-25 22:57:07 -07:00
Unknown W. Brackets
4f03f693b6 Mark texture as needing reset after upload. 2014-05-25 22:35:14 -07:00
Unknown W. Brackets
e4dc702d68 Schedule the FBO blit during multithreading.
This was it's properly ordered with draws, and it runs on the right GL
context.
2014-05-25 22:08:15 -07:00
Unknown W. Brackets
9894b38a1d Support memcpy uploads to fbos.
Makes Vempire look right (has never worked before in any rendering mode.)
2014-05-25 22:01:08 -07:00
Unknown W. Brackets
9195019872 Allow memcpy gpu downloads.
Fixes FF4 battle transition effect, Trails in the Sky menu, etc.
2014-05-25 21:49:16 -07:00
Unknown W. Brackets
365012ec58 Fix block transfer upload.
Wasn't working properly, rendered to the wrong target.

No longer need the UpdateFromMemory() thing, now.
2014-05-25 21:48:44 -07:00
Unknown W. Brackets
8275f613ce UpdateMemory() now returns whether to skip the cpy.
This way it can do it itself as necessary in the right order.
2014-05-25 21:48:41 -07:00
Unknown W. Brackets
8228bee6bf Download only the necessary subareas.
Performance improvement in Tactics Ogre.
2014-05-25 19:50:40 -07:00
Unknown W. Brackets
c42d04829f Detect if the game uses block transfer slivers.
In that case, it's better to read it once, than multiple times.
Improves performance and graphics in Grand Knights History.
2014-05-25 18:18:26 -07:00
Unknown W. Brackets
c3efa05c9e Correct end framebuf range check. 2014-05-25 17:51:12 -07:00
Unknown W. Brackets
24ebc0d987 Flip framebuffer y correctly.
And here I just corrected another commit doing this wrong a few weeks ago.
Shame.
2014-05-25 17:46:42 -07:00
Unknown W. Brackets
89b3ead30d If multiple framebuffers match, offset correctly. 2014-05-25 17:45:45 -07:00
Unknown W. Brackets
2e1afcf08d When there are multiple copies, don't redownload.
This should improve performance when there are lots of little transfers.
2014-05-25 17:24:09 -07:00
Unknown W. Brackets
cbb3fe0086 Refactor framebuffer size calculation. 2014-05-25 17:12:58 -07:00
Unknown W. Brackets
cec8195e97 Cleanup reporting of block/memcpy transfers. 2014-05-25 17:10:06 -07:00
Unknown W. Brackets
976968c707 Track more kinds of memcpy operations on fbos. 2014-05-25 17:08:55 -07:00
Unknown W. Brackets
fd4ba0093c Skip some code if things are outside framebuffers.
Small optimization.
2014-05-25 17:08:55 -07:00
Unknown W. Brackets
4dbb4328ae Download before, upload after. Fix save pictures.
Otherwise, it only works if it does it every frame, and then it's a frame
behind.  Also fixes Tales of Phantasia X's fades and etc.
2014-05-25 17:08:55 -07:00
Unknown W. Brackets
0e620b2fe9 Fix buffer overflow in MakePixelTexture(). 2014-05-25 16:28:28 -07:00
Unknown W. Brackets
30222f987d Flip framebuffers when downloading their pixels.
It seems like this is where it was being done...
2014-05-25 16:28:28 -07:00
Unknown W. Brackets
d26addc7b4 Match the #ifdef for glBlitFramebufferNV.
It's defined in gl_state with these requirements.
2014-05-25 15:15:21 -07:00
Unknown W. Brackets
62cd61611e Support block transfers offset into a framebuffer. 2014-05-25 15:13:19 -07:00
Unknown W. Brackets
cacbfab4b5 Allow glBlitFramebuffer on desktop, avoid NV.
Only use NV if !GLES3.  There's no reason otherwise.
2014-05-25 15:11:24 -07:00
Henrik Rydgard
8543de91d7 Don't skip the copy if block transfer is turned off 2014-05-25 10:50:28 +02:00
Henrik Rydgard
90f2d06697 Add setting to enable/disable GPU block transfer 2014-05-25 10:18:14 +02:00
Henrik Rydgard
33d15a6972 Try to implement block transfer upload to fbo. Doesn't seem to work right though... 2014-05-25 10:02:51 +02:00
Henrik Rydgard
eaba341db0 Split DrawPixels up, preparing to make it more flexible 2014-05-25 10:02:50 +02:00
Henrik Rydgard
c21fdef02d Typo fix 2014-05-25 10:02:49 +02:00
Henrik Rydgard
0208ca8e90 Add some reporting for framebuffer sceDmacMemcpys. 2014-05-25 10:02:49 +02:00
Henrik Rydgard
6c2ab3215f Try to fix R/B color swap problem 2014-05-25 10:01:40 +02:00
Henrik Rydgard
fdf17cb558 Move setting currentRenderVfb_ to NULL to when it's really needed. 2014-05-25 10:01:39 +02:00
raven02
50fc54c92a Fix wrong #endif 2014-05-25 10:01:39 +02:00
raven02
a516abef02 Add comments 2014-05-25 10:01:38 +02:00
raven02
68548856fd Use glBlitFramebuffer when available to blit framebuffer 2014-05-25 10:01:38 +02:00
raven02
cf7229e05e Null out currentRenderVfb_
This fixes the missing stuffs in Tactic Orge
2014-05-25 10:01:37 +02:00
Henrik Rydgård
ebd3d214ae Typo fix 2014-05-25 10:01:36 +02:00
raven02
218b446f9c Add updateVRAM_; 2014-05-25 10:01:36 +02:00
raven02
05be56a433 Keep it sync = true also rename updateVRAM_ 2014-05-25 10:01:35 +02:00
raven02
62c99843ad Do NotifyBlockTransfer() in buffered rendering mode only 2014-05-25 10:01:34 +02:00
Henrik Rydgard
945b6125f9 Restrict the last change to buffered mode only 2014-05-25 10:01:34 +02:00
Henrik Rydgard
994629089e Implement GPU block copies between buffers and from buffer to RAM.
(first one not very well tested, second one improves Burnout Legends sun a lot)
2014-05-25 10:01:33 +02:00
Henrik Rydgård
8273c1b956 Merge pull request #6056 from raven02/patch-51
Validate the framebuffer size with the size from sceDmac
2014-05-25 10:01:10 +02:00
Unknown W. Brackets
233213e38b Avoid a crash in the GE debugger. 2014-05-23 08:48:29 -07:00
Unknown W. Brackets
ec0ae44200 Don't force nearest for colortest against black.
Should fix #4217 and be relatively safe.  Probably it's a common colortest
ref color that's safe?
2014-05-15 23:52:16 -07:00
Unknown W. Brackets
99458d7797 Avoid forcing nearest/disabling linear if possible.
If we know that the test is trivially true, we don't need to worry about
the test.  May help #4405.
2014-05-15 22:38:44 -07:00
Henrik Rydgård
c31a1b18f7 Merge pull request #6067 from raven02/patch-56
Make the EstimateDrawingSize() simpler
2014-05-14 20:01:34 +02:00
raven02
8664fbac11 Make the EstimateDrawingSize() simpler 2014-05-14 20:13:20 +08:00
Unknown W. Brackets
2d12eb3394 Do not specify max LOD for no-mipmap textures.
Fixes #6077, incorrect filtering with no mipmaps in Popolocrois.
This was causing it to use the mag filtering setting, even when minifying.
2014-05-13 22:40:58 -07:00
Unknown W. Brackets
f660c04983 Optimize double alpha blending for 1/0 textures.
If the blend is 2*a / 1-a, and the alpha is either 1 or 0, we can still
use color doubling instead.  Fixes #3379 (Persona 2.)
2014-05-11 14:17:19 -07:00
Unknown W. Brackets
b4ceedfc43 Correctly flip textures in DrawActiveTexture().
We want to flip the origin of UV (top to bottom), not the pixels within
the specified range.
2014-05-10 09:35:02 -07:00
raven02
11b9d8d29a Build fix 2014-05-10 12:26:53 +08:00
raven02
4263f00092 Add GL_NV_framebuffer_blit support for BindFramebufferColor() 2014-05-10 11:41:24 +08:00
raven02
c54664ba89 Validate the size framebuffer size with the szie from sceDmac 2014-05-09 23:32:26 +08:00
Henrik Rydgård
19ea7b5331 Merge pull request #6047 from raven02/patch-47
Comment out the remaining one LogReadPixelsError()
2014-05-08 16:12:56 +02:00
Henrik Rydgard
b8c39d4e42 ReadFramebuffer: Support sub rectangle 2014-05-08 16:09:55 +02:00
Henrik Rydgard
3c2819afea Make DrawActiveTexture more flexible (u/v origin too). 2014-05-08 15:28:25 +02:00
Henrik Rydgard
3b3c794a37 More framebuffer code cleanup 2014-05-08 15:16:33 +02:00