Commit Graph

44 Commits

Author SHA1 Message Date
mimimi085181 0ed6b5623f Support partial texture updates via efb copies 2015-06-21 14:02:44 +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
Lioncash b0613bb1c8 General: Apply the const specifier where applicable 2015-04-15 02:04:03 -04:00
Shawn Hoffman ad64336137 quiet some warnings which appear on vs2015.
quieted warnings include shadowed variable names and integer extensions.
2015-03-15 19:28:47 -07: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
Stevoisiak 93b16a4a2d Formatting/Whitespace Cleanup
Various fixes to formatting and whitespace
2015-02-25 10:48:21 -05: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
magumagu 6659c15bed Remove EFB to RAM cache, and simplify code. 2015-01-23 10:48:15 -08: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
degasus a9eb08b85d TexCache: Choose texture based on mipmap count 2015-01-11 22:41:04 +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 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 8bdbe37c91 TexCache: Wipe pal hash 2015-01-10 11:55:16 +01:00
degasus f8184858da VideoCommon: Merge code to generate texture names on dumping 2014-12-29 10:24:27 +01:00
degasus 51bfc4c52a VideoCommon: rewrite custom textures 2014-12-29 10:24:21 +01:00
Jules Blok 31a55384b3 VideoConfig: Rename "StereoMonoEFBDepth" to "StereoEFBMonoDepth"
Makes a little bit more sense.
2014-12-24 23:30:40 +01:00
Jules Blok 0f63186371 TextureCache: Add "Mono EFB Depth Copy" stereoscopy option. 2014-11-23 14:27:40 +01:00
Jules Blok 8210b9c915 TextureCache: Ensure that all render target textures have as many layers as the frame buffer.
Also fixes a case where the D3D code path did not initialize num_layers leading to undefined behaviour.
2014-11-23 14:27:40 +01:00
Jules Blok ee76c03160 TextureCache: Recompile EFB2Tex shaders when stereo 3D is toggled. 2014-11-23 14:27:40 +01:00
Jules Blok 5944d15021 TextureCache: Check the number of layers before reusing a texture. 2014-11-23 14:23:42 +01:00
comex 7f6284c2fc Change a bunch of reference function arguments to pointers.
Per the coding style and sanity.
2014-10-02 03:00:33 -04:00
Yuriy O'Donnell d8d9bc8c6c Render: Implemented simple render target pool
This avoids creating and destroying render targets every frame,
which is a significant CPU overhead.

Old render targets are destroyed after 3 frames.
2014-09-04 22:21:06 +02:00
Tony Wasserka 8941f19cdb BPMemory: Expose the pixel_format and zformat fields in PE_CONTROL as enumerations. 2014-03-25 23:57:58 +01:00
Tillmann Karras 315a8ba1c0 Various changes suggested by cppcheck
- remove unused variables
- reduce the scope where it makes sense
- correct limits (did you know that strcat()'s last parameter does not
  include the \0 that is always added?)
- set some free()'d pointers to NULL
2014-02-28 12:43:20 +01:00
Lioncash 2afe215271 Convert all includes to relative paths. 2014-02-18 02:19:10 -05:00
Lioncash 3fd87a7636 Second and final pass of clearing out tabs. 2014-02-17 02:19:41 -05:00
lioncash d2038049f5 Replace all include guard ifdefs with "#pragma once" 2014-02-10 18:07:16 -05:00
Jasper St. Pierre 34692ab826 Remove unnecessary Src/ folders 2013-12-31 14:03:19 -05:00