summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/TextureCache.cpp
diff options
context:
space:
mode:
authorDolphin Bot <dolphin-emu-bot@users.noreply.github.com>2014-12-11 23:38:35 +0100
committerDolphin Bot <dolphin-emu-bot@users.noreply.github.com>2014-12-11 23:38:35 +0100
commit971a95aecef1c4fc3e5aa8799a296d2734526cfc (patch)
tree0b1d3a4f8bdd82f276f490c08c4854dedd553fa9 /Source/Core/VideoBackends/D3D/TextureCache.cpp
parentfe6723066355788a8877f484a8711524a80430e7 (diff)
parente90604c5ed4e78780cb56bf969cc80eec57c0199 (diff)
Merge pull request #1503 from kayru/d3d_optimization_cache
D3D: Filter redundant API calls by caching state in StateManager
Diffstat (limited to 'Source/Core/VideoBackends/D3D/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/TextureCache.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp
index 773833ee18..4ed4d6045f 100644
--- a/Source/Core/VideoBackends/D3D/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp
@@ -4,6 +4,7 @@
#include "Core/HW/Memmap.h"
#include "VideoBackends/D3D/D3DBase.h"
+#include "VideoBackends/D3D/D3DState.h"
#include "VideoBackends/D3D/D3DUtil.h"
#include "VideoBackends/D3D/FramebufferManager.h"
#include "VideoBackends/D3D/PixelShaderCache.h"
@@ -29,7 +30,7 @@ TextureCache::TCacheEntry::~TCacheEntry()
void TextureCache::TCacheEntry::Bind(unsigned int stage)
{
- D3D::context->PSSetShaderResources(stage, 1, &texture->GetSRV());
+ D3D::stateman->SetTexture(stage, texture->GetSRV());
}
bool TextureCache::TCacheEntry::Save(const std::string& filename, unsigned int level)
@@ -143,7 +144,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo
CHECK(SUCCEEDED(hr), "Create efb copy constant buffer %d", cbufid);
D3D::SetDebugObjectName((ID3D11DeviceChild*)efbcopycbuf[cbufid], "a constant buffer used in TextureCache::CopyRenderTargetToTexture");
}
- D3D::context->PSSetConstantBuffers(0, 1, &efbcopycbuf[cbufid]);
+ D3D::stateman->SetPixelConstants(efbcopycbuf[cbufid]);
const TargetRectangle targetSource = g_renderer->ConvertEFBRectangle(srcRect);
// TODO: try targetSource.asRECT();