Commit graph

84 commits

Author SHA1 Message Date
Rodolfo Bogado
d8cd2c3252 Implement scaled partial texture updates 2015-07-02 08:53:40 -03:00
Lioncash
daa205990f Use emplace() instead of insert() where applicable for maps. 2015-06-28 19:52:40 -04:00
Jules Blok
2a5dd69c72 Merge branch 'stable' 2015-06-24 19:34:16 +02:00
mimimi085181
829fc3dc2d Quick fix for an invalid iterator 2015-06-24 19:12:46 +02:00
mimimi085181
0ed6b5623f Support partial texture updates via efb copies 2015-06-21 14:02:44 +02:00
degasus
c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
mimimi085181
4d5fdb74be Code cleanup for FreeTexture after merging PR #2097 2015-06-09 21:45:09 +02:00
mimimi085181
3b9020dc9b Search the texture cache for small textures by address and hash
This fixes issue 6563:
https://code.google.com/p/dolphin-emu/issues/detail?id=6563

This PR adds a 2nd map to texture cache, which uses the hash as key. Cache entries from this new map are used only if the address matches or if the texture was fully hashed. This restriction avoids false positive cache hits. This results in a possible situation where safe texture cache accuracy could be faster than the fast one.

Small textures means up to 1KB for fast texture cache accuracy, 4KB for medium, and all textures for safe accuracy.

Since this adds a small overhead to all texture cache handling, some regression testing would be nice. Games, which use a lot of textures the same time, should be affected the most.
2015-06-05 21:30:39 +02:00
Markus Wick
a6412fb41e Merge pull request #2162 from degasus/prefetch_tex
CustomTexture: prefetch all available textures
2015-05-26 13:30:26 +02:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
degasus
242f7d964d CustomTexture: prefetch all available textures 2015-05-16 15:12:07 +02:00
Jules Blok
54f4443971 VideoCommon: Implement EFB dumping for both backends. 2015-05-02 13:23:33 +02:00
degasus
35373c5185 TextureCache: load all mipmap levels from custom textures
This drops the "feature" to load level 0 from the custom texture
and all other levels from the native one if the size matches.
But in my opinion, when a custom texture only provide one level,
no more should be used at all.
2015-03-02 00:09:09 +01:00
degasus
7ca24f90d1 TexCache: increase TEXTURE_KILL_THRESHOLD
Xenoblade uses more than 40 textures alternately per frame for eg water effects.
So don't try to drop them as aggressive.
2015-03-01 13:41:14 +01:00
Lioncash
7408de7e79 Merge pull request #2058 from Stevoisiak/Codemaid-Cleanup-Take2
Basic Formatting/Whitespace Cleanup
2015-02-25 18:07:56 -05:00
Stevoisiak
93b16a4a2d Formatting/Whitespace Cleanup
Various fixes to formatting and whitespace
2015-02-25 10:48:21 -05:00
degasus
967eaad8df VideoCommon: rename efb2tex and efb2ram 2015-02-24 23:10:13 +01:00
Tillmann Karras
e2fec13ab6 Fix some -Wsign-compare warnings 2015-02-24 10:29:59 +01:00
magumagu
074397c12d Explicitly set up AllocateTexture configuration for palette conversion.
No functional change.
2015-02-19 15:57:05 -08:00
magumagu
ddc815dd7a Remove TextureAddress struct. 2015-02-19 15:36:32 -08:00
magumagu
c0a4760f0e Decode EFB copies used as paletted textures.
A number of games make an EFB copy in I4/I8 format, then use it as a
texture in C4/C8 format.  Detect when this happens, and decode the copy on
the GPU using the specified palette.

This has a few advantages: it allows using EFB2Tex for a few more games,
it, it preserves the resolution of scaled EFB copies, and it's probably a
bit faster.

D3D only at the moment, but porting to OpenGL should be straightforward..
2015-02-19 15:09:27 -08:00
mimimi085181
2f8e0c9bb9 Allow multiple texture cache entries for textures at the same address
This is the same trick which is used for Metroid's fonts/texts, but for all textures. If 2 different textures at the same address are loaded during the same frame, create a 2nd entry instead of overwriting the existing one. If the entry was overwritten in this case, there wouldn't be any caching, which results in a big performance drop.

The restriction to textures, which are loaded during the same frame, prevents creating lots of textures when textures are used in the regular way. This restriction is new. Overwriting textures, instead of creating new ones is faster, if the old ones are unlikely to be used again.

Since this would break efb copies, don't do it for efb copies.

Castlevania 3 goes from 80 fps to 115 fps for me.

There might be games that need a higher texture cache accuracy with this, but those games should also see a performance boost from this PR.

Some games, which use paletted textures, which are not efb copies, might be faster now. And also not require a higher texture cache accuracy anymore. (similar sitation as PR https://github.com/dolphin-emu/dolphin/pull/1916)
2015-02-18 23:54:40 +01:00
Markus Wick
43605f8716 Merge pull request #1948 from magumagu/remove-efb-cache
Remove EFB to RAM cache, and simplify code.
2015-01-27 09:42:15 +01:00
degasus
51990fcdfa TexCache: Rewrite the texID generation for paletted textures
This changes the behavior if both texture are available. The old code did
try to load the modfied texID, the new code tries the unmodified texID first.
2015-01-24 13:58:20 +01:00
magumagu
6659c15bed Remove EFB to RAM cache, and simplify code. 2015-01-23 10:48:15 -08:00
degasus
62402efa6c CustomTexture: Mark textures with mipmaps 2015-01-21 21:22:55 +01:00
degasus
ee9d05d67f CustomTexture: Use another file name with wildcards 2015-01-21 21:22:55 +01:00
Ryan Houdek
50d495b581 Merge pull request #1916 from mimimi085181/master
Make efb to texture less broken for paletted textures that are efb copies
2015-01-21 13:40:36 -06:00
mimimi085181
0d3343d093 Make efb to texture less broken for paletted textures that are efb copies
Don't change the texID depending on the tlut_hash for paletted textures that are efb copies and don't have an entry in the cache for texID ^ tlut_hash. This makes those textures less broken when using efb to texture.

This is not really fixing those textures, but it's a step forward. The mini map in Twilight Princess for example is in grayscales with this and is more or less usable.
2015-01-19 01:31:41 +01:00
degasus
9f13a77799 TexCache: don't try to aggressive reuse the entry
As we pool them now, freeing and reallocating them is quite fast.
2015-01-18 19:58:33 +01:00
degasus
8565f02699 TexCache: use an unordered_multimap for the tex pool 2015-01-18 19:58:33 +01:00
degasus
4639d3b1bc TexCache: also incude textures within the render target pool 2015-01-18 19:47:48 +01:00
degasus
6cd6e6546f TexCache: merge texture and rendertarget factory function 2015-01-18 19:47:48 +01:00
degasus
615ae9f106 TexCache: remove PC_TexFormat
We only support rgba32 for a while now, so there is no need to have everything in common configureable.
2015-01-18 19:47:48 +01:00
mimimi085181
96bcb09fb2 Fix another small bug with the efb2ram cache
Textures that are directly next to each other were falsely detected as overlapping.
2015-01-17 19:10:00 +01:00
degasus
22e06daf5c TexCache: recreate the entry on level missmatch 2015-01-11 23:11:04 +01:00
degasus
a9eb08b85d TexCache: Choose texture based on mipmap count 2015-01-11 22:41:04 +01:00
degasus
744b1c1624 TexCache: rewrite level calculation 2015-01-11 22:23:35 +01:00
degasus
d95e5e2b6f TexCache: create a const Config struct 2015-01-11 22:23:35 +01:00
degasus
d640453274 TexCache: cleanup max texture level 2015-01-11 22:23:35 +01:00
degasus
1261f5f7f4 TextureCache: inline arguments into texture cache 2015-01-11 22:23:35 +01:00
degasus
2b47df07b6 TexCache: use c++11 syntax for std::map::erase 2015-01-11 22:23:35 +01:00
degasus
1c98a43203 TexCache: clean up frameCount handling 2015-01-11 22:23:35 +01:00
degasus
6ba613fbd3 TexCache: unify global variables 2015-01-11 22:23:35 +01:00
degasus
774596dbed TexCache: rename OverlapsMemoryRange 2015-01-11 22:23:35 +01:00
degasus
dddcea5a9a TexCache: don't invalidate efb copys because of config changes
We'll loose data on invalidating them. So just keep them until a new copy is done.
A wrong scaled copy is better than no copy if the game doesn't creates a new one.
2015-01-11 22:23:35 +01:00
degasus
38f42da55a TexCache: remove expanded_width
This variable isn't use any more.
2015-01-10 12:22:03 +01:00
degasus
614d058db1 TexCache: don't load tex level 0 on creation
This reverts an optimization which isn't worth imo. Every texture uploads have to alloc vram and a staging buffer, so there is no need to do both in the same call.
2015-01-10 12:21:33 +01:00
Markus Wick
f0f8384639 Merge pull request #1785 from degasus/custom_texture
VideoCommon: Custom texture handling
2015-01-08 13:29:45 +01:00