95 Commits

Author SHA1 Message Date
Unknown W. Brackets
b45711ba94 d3d: Centralize parts of the texture cache.
Should merge these.
2014-09-08 20:55:56 -07: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
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
Luna
62a1023615 Add "Screen Scaling Filter" option 2014-08-08 20:51:15 +02:00
Unknown W. Brackets
40f13d51e7 Separate framebuffer sampling params from tex.
This way we don't need to reset params on the texture or worry about
things like that.  We always force on the framebuffer anyway, so this is
simpler.

Also don't enable mipmaps when using a framebuffer, since they don't make
sense currently.
2014-06-15 13:34:58 -07:00
Henrik Rydgard
ab61255018 Allow only a small number of "InvalidateAll" operations per frame on the texture cache.
Reduces stutter in FF:Type0 tutorial end scene a bit more.
2014-06-15 00:40:08 +02:00
Unknown W. Brackets
0b9db176e9 Centralize render-to-tex logic, support mirrors.
Now everything is decided in AttachFramebuffer().
2014-06-14 11:04:16 -07:00
Henrik Rydgård
c0c058937f Limit the amount of texture scaling done per frame, to reduce stutters
Scaling causes really bad stutters in some games on some hardware.

This should also reduce the impact of pathological cases like the first
boss of FF Type-0 to be more bearable.
2014-06-13 22:07:26 +02:00
Unknown W. Brackets
ef12694c4b Don't update render tex x/y offset unless matched.
Sometimes we have false matches, they should be skipped.  Fixes some bloom
that is off in some games.
2014-06-09 22:45:14 -07:00
Unknown W. Brackets
acab898be0 Keep track of x/y offset for render-to-tex.
Fixes intro in Valkyrie Profile now that we're wrapping correctly.
2014-06-08 14:27:05 -07:00
Unknown W. Brackets
0896c3412d Allocate textures names in blocks.
May improve performance slightly when loading or recycling textures.
Probably uploading the texture is bigger anyway.
2014-06-07 16:13:53 -07:00
Unknown W. Brackets
3d8f078b6c Try to workaround Breath of Fire 3's render-to-tex.
It renders to two areas but textures with a high V to reach the second
texture.  We've been wrapping the V around but this may show the right
buffer.
2014-06-06 00:28:12 -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
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
580143e5e2 Disable vertex arrays before depal as well. 2014-05-31 22:07:42 -07:00
Henrik Rydgard
44d9af9222 Hopefully fix the Manhunt red/green swap 2014-05-27 22:22:56 +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
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
8fba7fa98e Initial work on depalettization. 2014-05-27 22:07:24 +02: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
779a52e08a Don't forget tex alpha if only a mip has none.
Mip levels should only move toward unknown.
2014-05-04 09:54:53 -07:00
raven02
abc5c86339 Split out texture level 2014-04-19 06:45:17 +08:00
raven02
95d2848f07 Define texture level mode 2014-04-18 18:06:38 +08:00
Unknown W. Brackets
dc0eea0522 Propagate texcache hash fails through cluts.
In games that use palette swapping (hi, FF2), if we detect a change in
a texture, another texture with the same address but new clut might not be
rehashed.

This just marks all other textures as dangerous when a hashfail occurs.

Fixes FF2 from recent optimizations.  It's slower, but still much faster
than before.
2014-04-13 16:20:58 -07:00
Unknown W. Brackets
b6dc7eba8b Simplify texture status checks a bit. 2014-04-13 13:19:35 -07:00
Henrik Rydgard
d83a5da6bd Fix glTextureStorage2D issue by scaling w/h. Fixes #5625 2014-04-02 00:15:41 +02:00
Unknown W. Brackets
b626daca59 Correct CheckAlpha() for un-rearranged textures.
Fixes #4403.  It was just not seeing the alpha when a texture had a large
bufw and a small w, and transparent only near the bottom - as in FF1's case.
2014-01-26 19:39:34 -08:00
Unknown W. Brackets
b48de952fd Duplicate framebuffers textured onto themselves.
This fixes #2917.

I verified that, at least for my card, blitting is much faster than
glReadPixels (by quite a margin.)
2014-01-20 07:54:39 -08:00
Unknown W. Brackets
09f1c795e5 Pass around texture pointers, not addresses.
This makes it possible to override it easier, rather than needing it in
PSP RAM.
2014-01-20 07:52:09 -08:00
Unknown W. Brackets
9680a7ccc7 Allow texture scaling on changed textures.
But only if they don't change very frequently.  Should fix #1934.
2014-01-19 20:54:48 -08:00
Henrik Rydgard
5de7bb2e2d Use GL_EXT_unpack_subimage to speed up non-pow-2 texture loads when available 2013-11-01 19:38:52 +01:00
Henrik Rydgård
df29da0b13 GLES3: Use glTexStorage2D for (possibly) more efficient texture uploading 2013-10-08 15:00:48 +02:00
Unknown W. Brackets
81e71dd8d7 Add a way to get to the current texture as well. 2013-09-27 22:46:08 -07:00
Unknown W. Brackets
8ca31f7652 Round texture bufw down to nearest 16 byte mult. 2013-09-15 20:06:41 -07:00
Unknown W. Brackets
b1ca06dff0 Keep track of fbs so there's no lag texturing.
Before, there would always be at least one bind with the incorrect memory
before using the framebuffer as a source.
2013-09-01 11:45:42 -07:00
Unknown W. Brackets
49902ed4dc Factor out texture from framebuffer. 2013-09-01 11:40:35 -07:00
Unknown W. Brackets
ab1c20f509 Detach textures and fbs using a range check.
This is more compatible with the attach logic, and might also be faster.
Although, framebuffer destroys should not be that common.
2013-08-02 22:45:34 -07:00
Henrik Rydgard
61d419b2ec Don't scan for something to decimate every frame. Actually costs perf. 2013-08-01 00:13:58 +02:00
Unknown W. Brackets
5f5048ca04 Save the bufw for textures as well, to match fbs. 2013-07-30 00:02:32 -07:00
The Dax
21f0bf2079 Put TextureFiltering enumerator name back. It was deleted by accident. 2013-07-29 15:34:51 -04:00
The Dax
5ef3a558ff Remove more magic numbers and remove enumerator names. 2013-07-29 15:34:51 -04:00
The Dax
b2dfdf6401 Perform some Windows UI cleanups. Dozens of unused IDs were leftover from Dolphin, and I doubt they'll ever be used again. Also remove several magic numbers, instead using enumerators to clarify code. 2013-07-29 15:34:50 -04:00
raven02
2ed82df646 Use UPPER case for enum 2013-07-23 19:28:01 +08:00
Unknown W. Brackets
4cfa074546 Use GE state accessors in the texcache. 2013-07-21 19:45:05 -07:00
raven02
4d53022121 Use emnu{} to simplify different of texture filtering 2013-07-19 22:36:00 +08: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
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
Unknown W. Brackets
f042894c3e Don't bypass the secondary cache on minihash fail. 2013-05-26 13:44:47 -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