summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
AgeCommit message (Collapse)Author
2017-08-09VideoCommon: Fix typo in comments introduced by #5849N.E.C
2017-08-03Video: Clearly separate Texture and EFB Copy formatsN.E.C
Improve bookkeeping around formats. Hopefully make code less confusing. - Rename TlutFormat -> TLUTFormat to follow conventions. - Use enum classes to prevent using a Texture format where an EFB Copy format is expected or vice-versa. - Use common EFBCopyFormat names regardless of depth and YUV configurations.
2017-07-11Merge pull request #5726 from mimimi085181/minimal-tmem-cache-emulationAnthony
Implement minimal emulation of TMEM caching
2017-07-10Implement minimal emulation of TMEM cachingmimimi085181
This is a remake of https://github.com/dolphin-emu/dolphin/pull/3749 Full credit goes to phire. Old message: "If none of the texture registers have changed and TMEM hasn't been invalidated or changed in other ways, we can blindly reuse the old texture cache entries without rehashing. Not only does this fix the bloom effect in Spyro: A Hero's Tail (The game abused texture cache) but it will also provide speedups for other games which use the same texture over multiple draw calls, especially when safe texture cache is in use." Changed the pr per phire's instructions to only return the current texture(s) if none of the texture registers were changed. If any texture register was changed, fall back to the default hashing and rebuilding textures from memory.
2017-06-29FileUtil: Add a class for Exists/IsDirectory/GetSizeJosJuice
Some code was calling more than one of these functions in a row (in particular, FileUtil.cpp itself did it a lot...), which is a waste since it's possible to call stat a single time and then read all three values from the stat struct. This commit adds a File::FileInfo class that calls stat once on construction and then lets Exists/IsDirectory/GetSize be executed very quickly. The performance improvement mostly matters for functions that can be handling a lot of files, such as File::ScanDirectoryTree. I've also done some cleanup in code that uses these functions. For instance, some code had checks like !Exists() || !IsDirectory(), which is functionally equivalent to !IsDirectory(), and some code was using File::GetSize even though there was an IOFile object that the code could call GetSize on.
2017-06-13Video Backends: Move and rename HostTextureFormat to AbstractTextureFormatiwubcode
2017-06-13Video Backends: Split texture cache code out into separate files, introduce ↵iwubcode
'AbstractTexture'
2017-06-07fix various instances of -1 being assigned to unsigned typesShawn Hoffman
2017-04-29TextureCache: Move host texture utility functions to VideoCommonStenzek
The appropriate place for these would be AbstractTexture, once it is finished.
2017-04-29TextureCache: Support compressed textures and pass pitch/size to uploadStenzek
This also removes an extra copy of the image for custom textures.
2017-04-12VideoBackends: Support updated texture encoding shader generatorsStenzek
2017-04-09Merge pull request #5220 from stenzek/small-nonsquare-mipsAnthony
TextureCache: Fix incomplete GPU texture decoding of non-square mips
2017-04-07TextureCache: Fix incomplete GPU texture decoding of non-square mipsStenzek
2017-04-06TextureCacheBase: remove duplicated variableMichael Maltese
Fixes warning: ``` Source/Core/VideoCommon/TextureCacheBase.cpp:869:17: warning: declaration shadows a local variable [-Wshadow] const u8* tlut = &texMem[tlutaddr]; ^ Source/Core/VideoCommon/TextureCacheBase.cpp:784:13: note: previous declaration is here const u8* tlut = &texMem[tlutaddr]; ^ ```
2017-04-04TextureCacheBase: fix custom textures not being loadedMichael Maltese
Fixes bug #10183 [0] introduced by 3bd184a / PR #4467 [1]. TextureCacheBase was no longer calling `entry->Load` for custom textures since the compute shader decoding logic was added. This adds it back in. It also slightly restructures the decoding if-group to match the one below, which I think makes the logic more obvious. (recommend viewing with `git diff -b` to ignore the indentation changes) [0]: https://bugs.dolphin-emu.org/issues/10183 [1]: https://github.com/dolphin-emu/dolphin/pull/4467
2017-04-01VideoCommon: Changes to TextureCache to support decoding in backendStenzek
2017-03-25TextureCacheBase: Convert bound_textures from a C array to a std::arrayLioncash
Prevents array-to-pointer decay and simplifies some code.
2017-03-22TextureCache: Don't lock freed rendertargets for one frame.degasus
New Super Mario Bros on PAL still renders at 60 fps, but skips every 5th XFB copy. So our detection of "per frame" fails, and we require twice the amound of texture objects. But our pool frees unused textures after 3 frames, so half of them needs to be reallocated every few frames. This commit removes the lock for render targets. It was introduced to not update a texture while it is still in use. But render targets aren't updated while rendering, so this lock isn't needed. Non-rendertarget textures however aren't as dynamic, so the lock should have no performance update.
2017-03-09Merge pull request #5051 from stenzek/renderer-fixesMarkus Wick
VideoBackends: Fix crashes introduced by #4999
2017-03-09Unify the way of setting game ID, title ID, revisionJosJuice
The existing code from ConfigManager, ES and MIOS is merged into a new set of functions called SetRunningGameMetadata.
2017-03-10VideoBackends: Move max texture size to VideoConfigStenzek
This stops the virtual method call from within the Renderer constructor. The initialization here for GL had to be moved to VideoBackend, as the Renderer constructor will not have been executed before the value is required.
2017-03-04VideoCommon: Eliminate static state in RendererStenzek
2016-12-27TextureCache: Add a dirty bit for partial updates on overlapping EFB copies.degasus
2016-12-26TextureCache: Drop unused parameter in backend API.degasus
2016-12-26TextureCache: Extract BP enum check to VideoCommon.degasus
We have TOO many video backends.
2016-12-25VideoCommon: use u32 for texture addressesTillmann Karras
2016-12-23Merge pull request #4224 from lioncash/tcacheMat M
TextureCacheBase: Eliminate static state
2016-12-15TextureCache: Use same color coefficients for EFB2Tex as EFB2RAMStenzek
2016-12-09TextureCacheBase: Eliminate static stateLioncash
2016-12-06Common: Add alignment headerLéo Lam
Gets rid of duplicated alignment code.
2016-10-29DiscIO/SConfig: Rename GetUniqueID to GetGameIDJosJuice
We call this "game ID" everywhere else, and it's not actually completely unique.
2016-10-06TextureCache: Don't re-use pooled textures within the same frameStenzek
This is an issue because a driver may have to maintain two copies of a texture if it batches all uploads together at the start of a frame. In the Vulkan backend, we do something similar to avoid breaking out of a render pass to copy a texture from the streaming buffer to the destination image. This was causing issues in the sms-bubbles fifolog, where an EFB copy to the same address of a previously-used texture caused the previous texture to be re-used again for a different image later on in the frame, causing the original contents to be discarded.
2016-10-01VideoBackends: Make TextureCache::CompileShaders return a boolStenzek
2016-08-30TextureCacheBase: Address 0x0 is valid, don't you dare ignore it.Jules Blok
2016-08-07Common: namespace MemoryUtilLioncash
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2016-06-18TextureCache: Rename functions and add comments to clear up docsScott Mansell
2016-06-17TextureCache: Track efb copies used in a partially updated textureScott Mansell
Fixes a major preformance regression in Skies of Arcadia during battle transisions. I had plans for a more advanced version of this code after 5.0, but here is a minimal implemenation for now.
2016-04-09Partial updates for paletted texturesmimimi085181
This pr fixes another regression that happened after pr #3165 was merged. The shadows in mario baseball should now work again.
2016-04-09Merge pull request #3752 from ↵Pierre Bourdon
mimimi085181/remove-use-only-once-restriction-partial-updates Remove the restriction to use efb copies only once as partial update
2016-04-02Partial texture updates: Allow the efb copy to start before the texturemimimi085181
This is an oversight from pr https://github.com/dolphin-emu/dolphin/pull/3266 . Thanks to degasus for pointing this out. It's possible that MAX_TEXTURE_BINARY_SIZE can be optimised, but i wanted to play it safe considering the 5.0 stable release.
2016-03-27Remove the restriction to apply efb copies only once as partial updatemimimi085181
I'm not entirely sure what is happening, but this optimisation is causing an issue in Sonic Riders: Zero Gravity. Apparently the issue would also be fixed by PR#3747, but this PR should also fix similar issues. Games that use partial updates might get slower with this, so some performance regression testing would be nice. Games like New Super Mario Bros, RS2, Zelda TP and Silent Hill. Testing with high graphics settings makes sense, since this would mostly end up in more work for the GPU.
2016-03-24VideoCommon: Refactor TexMode0 mipmaps disabled test into a helper functionEmptyChaos
2016-03-16Minor fixes to the partial updates codemimimi085181
- remove an outdated comment about the efb to ram and scaled efb restriction - when upscaling efb copies, mark the new texture as efb copy - dx12 fixes for the src box, especially the number of layers for 3D
2016-03-16Partial texture updates with parts of efb copies new versionmimimi085181
2016-02-14Copy all layers of textures with CopyRectangleFromTexturemimimi085181
2016-02-14For partial texture updates check the dimensions of the efb copy and the ↵mimimi085181
target texture, not just the binary size. This should get Donkey Kong Country Returns characters to be as broken as they should be. They will be fixed in a later pr. Expected result is: efbtex: characters are always flickering or invisible, no matter what scaling or IR setting efb2ram: characters are always working properly at 1xIR, no matter what scaling or IR setting
2016-01-30Merge pull request #3480 from phire/memory_stride_too_smallPierre Bourdon
Avoid the "Memory stride too small" assert
2016-01-17VideoCommon: Header cleanupLioncash
Also remedies places where the video backends and core rely on things being indirectly included.
2016-01-13TextureCacheBase: Change CalculateLevelSize to match D3D/OGL sizesStenzek
This was causing crashes/driver resets when odd-dimension textures were being loaded, due to the size we were uploading being larger than the size of the higher-level texture calculated by the runtime.