Commit Graph

868 Commits

Author SHA1 Message Date
Henrik Rydgård
283f382aff Revert "Attempted workaround for issue #2308. Needs plenty of testing! Fixes black screens in GTA when pausing for example."
This reverts commit f2b7096bdf.
2013-06-20 01:26:18 +02:00
Henrik Rydgard
f2b7096bdf Attempted workaround for issue #2308. Needs plenty of testing! Fixes black screens in GTA when pausing for example. 2013-06-19 23:55:36 +02:00
Henrik Rydgard
8f9562cde4 Remove gl enum hacks in texturecache (doesn't seem to work, get bad log output on adreno) 2013-06-19 12:42:04 +02:00
Henrik Rydgård
5fc11fa99c Turn off forced linear filtering if colortest enabled 2013-06-17 20:45:08 +02:00
Henrik Rydgard
e782b6f20e Add VSync option in Windows. Turns itself off when unthrottled. 2013-06-16 23:45:06 +02:00
Unknown W. Brackets
00540ea44c Hash/convert more when a CLUT base is used.
This seems a bit strange, but the games that use these bases seem to read
outside the loaded CLUT to a previously loaded CLUT.

May cause a performance issue on games that use a base but don't do this.
2013-06-16 08:04:21 -07:00
Unknown W. Brackets
5dd9ece98b Ignore alpha when writing to display. 2013-06-15 17:32:35 -07:00
Unknown W. Brackets
dc5e7d5e71 Still need to delete textures when scaling on.
Duh.  Fixes #2255.
2013-06-14 00:46:49 -07:00
Henrik Rydgård
3908bf537f Merge pull request #2249 from unknownbrackets/texcache
Re-enable subimage optimization with scaling check
2013-06-14 00:17:01 -07:00
HuangKangJing
9e0fe6f1e6 Fixed a build error on 64-bit linux. 2013-06-14 14:24:04 +08:00
Unknown W. Brackets
ff00b65cf3 Re-enable subimage optimization with scaling fix.
Thanks go to @Squall-Leonhart for finding the issue.
2013-06-13 23:04:11 -07:00
Henrik Rydgard
052a15b788 Disable the glTexSubImage optimization, see issue #2222 . 2013-06-11 23:06:30 +02:00
Henrik Rydgard
e809e39681 Mips interpreter: Use unions instead of ugly casts. Strict-aliasing builds now work, but needs more testing so I don't enable it yet. Also some aliasing fixes for TransformPipeline. 2013-06-11 21:44:37 +02:00
Henrik Rydgard
f8b9655f20 Use glTexSubImage to replace textures instead of deleting them and allocating new ones whenever possible. May help runaway VRAM consumption with some Radeon drivers. 2013-06-11 20:21:19 +02:00
Henrik Rydgard
112f1b4901 Wipe all FBOs on device lost. May help app switching issues on Android. 2013-06-11 11:28:41 +02:00
Henrik Rydgård
9fbb947fcd Merge pull request #2210 from aquanull/TCMinorFix
Fix some crash due to destroyed FBO's...
2013-06-11 02:24:19 -07:00
Henrik Rydgard
ea2b923ddf Logic precedence error, warning fixes 2013-06-11 11:05:34 +02:00
aquanull
a1b7da413a TextureCache::Invalidate()/InvalidateAll() small corrections and optimizations.
I think the ranges are [start_addr, end_addr).
2013-06-11 16:19:13 +08:00
aquanull
9b85da657a These were probably just typos. 2013-06-11 16:19:13 +08:00
aquanull
7082e9808d Fix some crash in debug builds. 2013-06-11 16:19:12 +08:00
Unknown W. Brackets
73ab4d1422 Fix memcpy to framebuffer to not invalidate.
This is much better.
2013-06-10 00:11:36 -07:00
Unknown W. Brackets
d8618e5028 Clear currentRenderVfb_ when fbo_unbinding.
At least, not doing this caused glitches somewhere else, seems right.
2013-06-09 23:55:33 -07:00
Unknown W. Brackets
f8d6bda678 Add a better signal for VRAM copies in the GPU. 2013-06-09 23:55:32 -07:00
Henrik Rydgard
2afbc94734 Turn off RTTI, simulate it where needed. 2013-06-09 13:02:16 +02:00
Unknown W. Brackets
dbb2dfdcff Invalidate FBOs when it's obvious they should be.
This fixes videos not being visible in for example Star Ocean.
Most likely any games doing a copy directly from the mpeg decode.
2013-06-08 04:51:57 -07:00
Henrik Rydgard
0d0148dad3 Change check in DoBlockTransfer to catch some more videos. 2013-06-06 10:30:05 +02:00
Henrik Rydgard
e7097ca95a Fall back to software transform when hardware transform fails. Should help Mali devices.
This is done per shader so the speed hit should not be as bad as turning hw transform off entirely.
Displays a red error at the top of the screen so that we don't trigger this accidentally.
2013-06-06 10:09:37 +02:00
Henrik Rydgard
be483a1aa6 Another framebuffer / displayptr fix. 2013-06-06 00:30:42 +02:00
Henrik Rydgard
9ae044de43 Keep a separate pointer for non-VRAM displayptr. Fixes GTA intro movie while still not breaking MotoGP. 2013-06-06 00:01:43 +02:00
Henrik Rydgard
443e9eca8e DrawPixels: Avoid copying in the common case. 2013-06-05 23:32:04 +02:00
Henrik Rydgard
44042b0ef9 Detect a method that some games use to get video on the screen. No more need to turn on raw framebuffer in these cases (this may not catch all of them). 2013-06-05 23:03:42 +02:00
Henrik Rydgard
2221f221e3 Only create backing texture for DrawPixels when needed. 2013-06-05 23:03:23 +02:00
Henrik Rydgard
a7f7410668 Merge branch 'master' into plugindownload 2013-06-05 16:13:55 +02:00
Unknown W. Brackets
d3e488400c Multiply by the base color in ambient lighting.
JPCSP seems to do it this way.  Fixes #1692, and makes it consistent with
specular and diffuse, which seems right.
2013-06-04 22:54:19 -07:00
Henrik Rydgard
0c7833796b Merge branch 'master' into plugindownload
Conflicts:
	Core/Core.vcxproj
	Windows/PPSSPP.vcxproj
	native
2013-06-03 23:42:49 +02:00
Henrik Rydgard
b3f3305068 vcproj update: enable multithread build 2013-06-02 23:45:44 +02:00
Sacha
f825a07650 Move C++11 functions to std namespace. 2013-06-02 22:27:37 +10:00
Sacha
b39a572043 Buildfixes.
Fix C++11 usage.
Remove redundancy.
Fix st_*time re-usage.
2013-06-02 13:26:39 +10:00
Henrik Rydgård
0e65c23346 Merge pull request #2020 from oioitff/mpeg-support
Rewrite some core functions for sceMpeg with ffmpeg.
2013-06-01 14:24:48 -07:00
oioitff
a7657c5a70 Fix a tiny bug in Framebuffer.
Prepare for showing video images.
2013-06-02 01:28:23 +08:00
Henrik Rydgard
ab4987bc20 Update to latest version of "native" 2013-05-31 23:10:58 +02:00
Unknown W. Brackets
c115a6f36c Don't report alphatest masks for always/never. 2013-05-31 10:40:39 -07:00
Unknown W. Brackets
9c85bd92e4 Show statistics for GPU cycles executed per frame. 2013-05-31 10:40:16 -07:00
raven02
a945cf0e13 Fix incorrect texture in Dragon Ball Z Shin Budokai 2 2013-05-31 23:00:35 +08:00
King_DuckZ
61500281a9 Warning fix on Intel compiler. 2013-05-30 15:42:11 +02:00
King_DuckZ
1455452850 Trailing whitespaces removed. 2013-05-30 15:42:11 +02:00
Henrik Rydgard
2d8632cd7a Remove texture coordinate difference between HW and SW transform. Partly fixes #1963 2013-05-30 13:37:18 +02:00
raven02
4a31e13c9b Missing semi-colon 2013-05-30 18:33:11 +09:00
raven02
c4a3769aee Fix incorrect clut in Dainiji_Super_Robot_Taisen_Z Hakaihen 2013-05-30 16:29:38 +08:00
jeid3
fc38cfe798 Fix VertexShaderGenerator Command line for Gpu last generation on ios (hwXform) 2013-05-28 17:53:43 +02:00
Henrik Rydgård
99634a913a Disable QuickClutHash until it can be fixed. 2013-05-27 19:46:09 +02:00
jeid3
632ac03fc2 Build ios fix 2013-05-27 09:54:16 +01:00
Unknown W. Brackets
f042894c3e Don't bypass the secondary cache on minihash fail. 2013-05-26 13:44:47 -07:00
Unknown W. Brackets
01e1a8093a Allow ConvertColors() to work as a copy op. 2013-05-26 13:31:58 -07:00
Unknown W. Brackets
d2a52f48e5 Switch to a weaker, but faster clut hash. 2013-05-26 13:26:12 -07:00
Unknown W. Brackets
5dabdd3651 Make sure to update the CLUT if format changes.
Otherwise we throw away the loaded clut, which is no good.
2013-05-26 13:26:07 -07:00
Unknown W. Brackets
c53386244d Don't hash the clut when it's not even used.
Many games load the clut even when it wasn't changed, and we don't flush
between when this happens.  There shouldn't be any need to rehash the clut
either.

Technically, the clut could have actually changed, but this would
generally require them to clear the dcache or something in a way the GE
probably doesn't support.
2013-05-26 12:41:36 -07:00
Henrik Rydgard
cdef31f9fc Turn off the use of uniform arrays in shaders as some devices don't like them, and the speedup seems to be very small if any. 2013-05-26 14:03:02 +02:00
Henrik Rydgard
7ffdac39bc Disable the for loop in the vertex shader again. Some lame drivers don't seem to like it. 2013-05-23 12:49:34 +02:00
Henrik Rydgard
e2024674a4 Undo an optimization that broke skinning a bit... 2013-05-22 19:49:58 +02:00
Henrik Rydgard
199907b9ed Shader simplification - well, more of it. Hopefully this helps the mali problems a bit more. 2013-05-22 15:52:10 +02:00
Unknown W. Brackets
373561b90e Don't store clutformat in the texcache entry. 2013-05-20 01:00:14 -07:00
Unknown W. Brackets
3efe7ae24d Cache based on the full clutformat.
Not just 2 bits of it.  Oops.  Simpler this way.
2013-05-20 00:53:39 -07:00
Henrik Rydgard
29ab5e7801 Shader simplification: Flip skinning math around. Remove a temporary from the texcoord generation code. Update ffmpeg submodule pointer. 2013-05-20 00:16:29 +02:00
Henrik Rydgard
d9ed61c04a Shader simplification: Get rid of some uniforms when possible. 2013-05-19 16:38:52 +02:00
Henrik Rydgard
063e23dc0d Shader simplification: Share even more variables between lights. 2013-05-19 14:45:56 +02:00
Henrik Rydgard
a1d549c59f Shader simplification: Share some variables between lights to help bad register allocators 2013-05-19 14:36:07 +02:00
Henrik Rydgard
0ff8be1b1a Shader simplification: Get rid of lightSum1 when not needed. 2013-05-19 14:23:17 +02:00
Henrik Rydgard
b3cc5859dc Shader simplification: Get rid of lightscale where possible 2013-05-19 13:52:47 +02:00
Henrik Rydgard
06e4441213 Shader simplification: .rgb += instead of vec4(..., 0.0f) 2013-05-19 13:51:46 +02:00
Henrik Rydgard
b1dd449f8f Remove accidentally-added extra "precision highp float" from vshader gen 2013-05-18 23:21:42 +02:00
Henrik Rydgard
9af5499b21 Optimize bone matrix updates. 2013-05-18 21:18:45 +02:00
Henrik Rydgard
1b210fab14 Use arrays and for loops in GLSL shaders for bone processing, to shrink the shaders which are becoming too big for some mobile GPUs. Might fix #1816. 2013-05-18 20:45:52 +02:00
Henrik Rydgard
dca2406374 Add more precision specifiers to vertex shader 2013-05-18 19:51:52 +02:00
Henrik Rydgård
367e9bcefb Remove DrawWireframe option to save space in dialog, it doesn't really work right anyway 2013-05-16 17:18:53 +02:00
Unknown W. Brackets
03f3f99e39 Don't use ivec in the fragment shader.
Attempt at #1777.  Needs the + 0.5 to round properly on mobile.
2013-05-12 13:09:02 -07:00
Unknown W. Brackets
41fb41afdb Only report these once to avoid spam. 2013-05-12 12:00:21 -07:00
Unknown W. Brackets
5619c84432 Defer palette conversion after clut load.
Because the format can easily be specified afterward.
2013-05-12 10:57:41 -07:00
Unknown W. Brackets
39c0e6c096 Add reporting for unsupported GE commands.
And clean up some disasm for a couple others.
2013-05-12 10:30:26 -07:00
Unknown W. Brackets
5ecacd6bc8 Don't double alpha when alphablend is disabled.
Probably doesn't affect much.
2013-05-12 09:31:23 -07:00
Unknown W. Brackets
5223ee3d1b Move the font clut opt check to clut load.
And remove the report for mipmap sharing, seems to work...
2013-05-12 09:26:17 -07:00
Unknown W. Brackets
901a7b804e Implement mipmap clut sharing/not sharing.
It was kinda already there, probably from JPCSP.  Not well tested,
but this is what JPCSP does and it makes sense.
2013-05-12 09:04:50 -07:00
Unknown W. Brackets
7e23299c36 Immediately load the clut on LOADCLUT. 2013-05-12 01:56:26 -07:00
Unknown W. Brackets
518394cca8 Allow the full features string to be logged. 2013-05-12 01:56:25 -07:00
Unknown W. Brackets
4c43da9c23 Only apply the clut offset when using the clut.
This may fix games that use the clut offset having wrong colors.
2013-05-12 01:56:25 -07:00
Unknown W. Brackets
5a81bfd1fb Don't invalidate textures based on the clutaddr.
The cluthash should be sufficient, and this is less to pass around.
2013-05-12 01:56:25 -07:00
Unknown W. Brackets
7dd0d242e2 Load the clut only using LOADCLUT, not every tex.
This is a small optimization, and should match PSP behavior better.
It also allows us to hash the clut and convert colors less often.
2013-05-12 01:56:24 -07:00
Unknown W. Brackets
342ae6c322 Reuse the fullhash when it triggers a reload.
Instead of hashing it again a few microseconds later...
2013-05-12 01:56:24 -07:00
Unknown W. Brackets
724495cbb3 Mix add and xor in the texcache for better results. 2013-05-12 01:56:23 -07:00
Unknown W. Brackets
347bccf9bc Fix bone matrix number disasm. 2013-05-11 10:31:04 -07:00
Unknown W. Brackets
a22934885d Improve GE disasm for a few commands. 2013-05-11 10:16:56 -07:00
Unknown W. Brackets
84ab8aa79b Add reporting for alphatest mask.
Actually, maybe it being 0x00 could be advantageous...
2013-05-11 01:19:46 -07:00
Unknown W. Brackets
4b91c7e707 Implement DXT3 alpha. 2013-05-10 00:49:13 -07:00
Unknown W. Brackets
c937a22f26 Only double the color with color doubling.
Not the alpha.
2013-05-09 23:31:53 -07:00
Henrik Rydgård
8ada3aa8b4 Merge pull request #1727 from unknownbrackets/perf
Keep track of whether textures have alpha values or not
2013-05-09 01:27:32 -07:00
Unknown W. Brackets
47c404b925 Clean up some comments. 2013-05-09 01:19:55 -07:00
Henrik Rydgard
5c1425f900 Detect clears, replace with glClear(). Needs more testing, disabled for now. 2013-05-09 09:47:39 +02:00
Unknown W. Brackets
4a30221c95 Ignore texfunc RGBA when texture is full alpha.
This allows us to skip some work in the fragment shader.
2013-05-08 23:14:20 -07:00
Unknown W. Brackets
cb217189c5 Keep track of whether a texture has alpha.
This way we know what sorts of blending we even have to do.  Commonly,
textures don't have any real alpha.

Not yet used for anything.
2013-05-08 23:14:19 -07:00
Sacha
33e7169248 New Option for Blackberry keyboard devices: Partial Vertical Stretch
Stretches screen vertically by ~38% (midpoint of stretched and non-stretched).
Set this on by default for keyboard devices. Also set 'Show Touch' off by default.
2013-05-08 23:23:24 +10:00
Henrik Rydgård
17e084d77e Fix objects showing through road in Ridge Racer. Clears can set whether
to affect depth or not, need to respect that bit. Fixes #1712.
2013-05-08 11:29:24 +02:00
Unknown W. Brackets
34da6f983a Fix reporting typo logging wrong things. 2013-05-08 00:35:17 -07:00
Henrik Rydgård
b3355b2f7c Mac build fix. Rename WindowZoom ini parameter to force-reset it as it
should always be 1 on Android for now.
2013-05-07 23:28:19 +02:00
Unknown W. Brackets
ebf1b57834 Rename round255f to roundAndScale255f.
Seems to verbose to me, but no one can think it doesn't scale or round
this way.
2013-05-07 08:02:27 -07:00
Unknown W. Brackets
f2b4c4a0bc Pre-round the colortest/alphatest reference val. 2013-05-07 07:52:49 -07:00
raven02
eba452f1ba Add back round255f and round255v to u_alphacolorref 2013-05-07 21:52:40 +08:00
raven02
3744f6ee28 Fix colortest rounding using vec3 2013-05-07 19:53:48 +08:00
raven02
274b9c712c Add rounding to equality check for ColorTest 2013-05-07 16:47:53 +08:00
Unknown W. Brackets
76c812a428 Allow larger texture buffer widths.
Fixes #1631.
2013-05-06 23:54:41 -07:00
Henrik Rydgård
d8f9790abc Some Mac build fixes from vit9696 and some more. Update submodules. 2013-05-07 00:08:57 +02:00
Unknown W. Brackets
3c0ed69fd2 Improve GPU invalidation interface, check fonts.
When a font is rendered, tell the GPU about it, but don't rehash.

This not only improves perf (less hashing) but makes font changes more
immediate (no deferred hashing.)  But only if they use sceFont.
2013-05-05 22:52:01 -07:00
Unknown W. Brackets
995ab510e9 Optimize alpha-only CLUTs, common for fonts.
This optimizes the case where fonts are drawn using animation (common in
RPGs, for example), and textures have to be decoded over and over.

Could probably be faster with SIMD.
2013-05-05 22:34:35 -07:00
Unknown W. Brackets
d86253cef2 Buildfix for Linux. 2013-05-05 19:58:59 -07:00
Peter Thoman
fa8df54391 Pre-compute all weights and sums for bicubic scaling 2013-05-05 21:59:41 +02:00
Peter Thoman
073787430e Fixed bicubic scaling, added SSE 4.1 version 2013-05-05 21:59:41 +02:00
Sacha
c85b5782a0 Buildfix for BHarmattan and Blackberry. Was missing math.h 2013-05-05 20:18:31 +10:00
Henrik Rydgård
81363074a5 Merge pull request #1676 from unknownbrackets/texcache
Add back second texcache, improve perf, add memory check
2013-05-05 00:44:14 -07:00
Unknown W. Brackets
bd692ddf66 Check for low GPU memory and try to disable cache.
This may help with phones and even desktops without much VRAM/RAM.
Normally OpenGL will copy between them, though, so it should not happen
often, especially not on desktops.
2013-05-05 00:00:22 -07:00
Unknown W. Brackets
5b970d76e3 Use SSE2 in the texture hashing function.
Speeds it up significantly, but only when it's called a lot.
2013-05-04 21:39:12 -07:00
Unknown W. Brackets
02c88b9517 Add a secondary texture cache again.
This time, only used when invalidations happen several times, but not
too often, and still hashes the entire texture.
2013-05-04 20:33:31 -07:00
Unknown W. Brackets
608f469b54 Minor cleanup to tex hash and clut check. 2013-05-04 19:16:52 -07:00
Peter Thoman
e7b382dc57 __forceinline doesn't make a measureable difference here, so no need to make the code nonstandard 2013-05-05 01:49:16 +02:00
Peter Thoman
f49cc04c7d Merge branch 'master' of https://github.com/hrydgard/ppsspp
Conflicts:
	Windows/resource.h
2013-05-05 01:38:47 +02:00
Peter Thoman
bfe1cb9ca2 Added bicubic texture filtering and hybrid bicubic texture filtering options 2013-05-05 01:27:15 +02:00
Unknown W. Brackets
353528b63d When displaying an FBO, pick the most recent used.
Fixes flicker in Jewel Summoner, and black screen in Shadow of Destiny.
2013-05-04 15:36:24 -07:00
Unknown W. Brackets
fd0c368037 Fix texfunc disasm missing color doubling. 2013-05-04 15:36:23 -07:00
Unknown W. Brackets
a0e6917ee8 If unspecified, default normal to 0, 0, 1.
Fixes Trails in the Sky buttons and improves Kingdom Hearts lighting.
2013-05-04 13:23:50 -07:00
Henrik Rydgård
5c2b337526 Merge pull request #1652 from PeterTh/master
Add Texture Deposterization
2013-05-03 08:06:27 -07:00
Sacha
279158a010 Buildfix (Harmattan and Blackberry): stdlib is required for abs(int). 2013-05-04 00:32:25 +10:00
Peter Thoman
3ede2b69cb Drop std:: from bind in deposterize, I want to avoid breaking builds again if at all possible 2013-05-03 16:26:02 +02:00
Peter Thoman
3c2ee6bd65 Added texture deposterization option 2013-05-03 16:26:02 +02:00
Sacha
ac9f271078 Buildfix. Was meant to be from unsigned int to u8. 2013-05-04 00:08:38 +10:00
Sacha
e0ef9a9505 Buildfix (all C++0x compilers). Drop the std::, do a static_cast for narrowing conversion as required by C++0x spec. 2013-05-04 00:06:41 +10:00
Peter Thoman
f4f0a958d3 Applied loop tiling/strip mining to algorithms where it makes sense 2013-05-03 14:38:24 +02:00
Peter Thoman
fa8250ba12 Avoid scaling empty and flat textures 2013-05-03 13:35:24 +02:00
Peter Thoman
75bbe9df9f Clean up (and slightly speed up) blinear scaling 2013-05-03 13:17:36 +02:00
Henrik Rydgård
655e7dbfbb Merge pull request #1640 from PeterTh/master
Texture scaling improvements
2013-05-03 01:37:39 -07:00
Henrik Rydgård
1a6c5daf0c Merge pull request #1646 from unknownbrackets/texcache
Minor texture cache optimizations + blend fix
2013-05-03 01:35:20 -07:00
Peter Thoman
7d2fd0ea31 Removed Bilinear texture filtering option 2013-05-03 10:29:29 +02:00
Unknown W. Brackets
9537be9ebb Don't double src alpha when it's not safe to do so.
Fixes LittleBigPlanet vignette.
2013-05-03 01:10:59 -07:00
Unknown W. Brackets
df65bb40ac Avoid copying a tex if the PSP format is perfect. 2013-05-03 01:02:00 -07:00
Unknown W. Brackets
57c7b21640 Convert colors before applying clut, not after.
No reason to build it wrong and fix it afterward.
2013-05-03 00:12:42 -07:00
Sacha
8cb0423f32 Avoid name collision with ThreadPool on Windows hosts. Fixes all Linux/Unix cross-compiles from Windows, including Harmattan and Blackberry. 2013-05-03 16:31:53 +10:00
Peter Thoman
edf94091db Final Hybrid scaling adjustments & remove debug output 2013-05-03 02:51:07 +02:00
Peter Thoman
d8df8a6796 Merge branch 'master' of https://github.com/hrydgard/ppsspp
Conflicts:
	Core/Config.cpp
	Core/Config.h
2013-05-03 00:24:03 +02:00
Henrik Rydgard
6d66577f17 Don't write to transformedvertex.color1[4], it doesn't exist. 2013-05-02 20:18:46 +02:00
Peter Thoman
e352432aab Hybrid scaling works now 2013-05-02 20:05:41 +02:00
Peter Thoman
d70641d3f2 Manual merge 2013-05-02 14:25:18 +02:00
Peter Thoman
7ae3894365 Added functionality for hybrid scaling (not yet working) 2013-05-02 14:09:46 +02:00
Henrik Rydgard
42a4a1e4ba Brightness fix for scaled RGB565 and RGB5551 textures. Fix broken color conversion in DecodeTexture (which is not normally used). 2013-05-02 10:59:45 +02:00