mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 05:40:01 -06:00
Implement OGL sampler cache. Allows binding a texture multiple times with different parameters. Also possibly gives a very small speed improvement.
This commit is contained in:
@ -63,6 +63,7 @@
|
||||
#include "FPSCounter.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "VertexManager.h"
|
||||
#include "SamplerCache.h"
|
||||
|
||||
#include "main.h" // Local
|
||||
#ifdef _WIN32
|
||||
@ -128,6 +129,7 @@ static const u32 EFB_CACHE_HEIGHT = (EFB_HEIGHT + EFB_CACHE_RECT_SIZE - 1) / EFB
|
||||
static bool s_efbCacheValid[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT];
|
||||
static std::vector<u32> s_efbCache[2][EFB_CACHE_WIDTH * EFB_CACHE_HEIGHT]; // 2 for PEEK_Z and PEEK_COLOR
|
||||
|
||||
static SamplerCache s_sampler_cache;
|
||||
|
||||
int GetNumMSAASamples(int MSAAMode)
|
||||
{
|
||||
@ -366,6 +368,8 @@ void Renderer::Shutdown()
|
||||
delete s_pfont;
|
||||
s_pfont = 0;
|
||||
s_ShowEFBCopyRegions.Destroy();
|
||||
|
||||
s_sampler_cache.Clear();
|
||||
}
|
||||
|
||||
void Renderer::Init()
|
||||
@ -1464,7 +1468,11 @@ void Renderer::SetLineWidth()
|
||||
|
||||
void Renderer::SetSamplerState(int stage, int texindex)
|
||||
{
|
||||
// TODO
|
||||
auto const& tex = bpmem.tex[texindex];
|
||||
auto const& tm0 = tex.texMode0[stage];
|
||||
auto const& tm1 = tex.texMode1[stage];
|
||||
|
||||
s_sampler_cache.SetSamplerState((texindex * 4) + stage, tm0, tm1);
|
||||
}
|
||||
|
||||
void Renderer::SetInterlacingMode()
|
||||
|
Reference in New Issue
Block a user