D3D: Implemented context state caching

This avoids most of the redundant API calls.
This commit is contained in:
Yuriy O'Donnell
2014-10-29 01:19:09 +01:00
parent d83f0308af
commit 6e9226650d
12 changed files with 453 additions and 136 deletions

View File

@ -6,6 +6,7 @@
#include "VideoBackends/D3D/D3DBase.h"
#include "VideoBackends/D3D/D3DShader.h"
#include "VideoBackends/D3D/D3DState.h"
#include "VideoBackends/D3D/PointGeometryShader.h"
#include "VideoCommon/VertexShaderGen.h"
@ -217,8 +218,8 @@ bool PointGeometryShader::SetShader(u32 components, float pointSize,
DEBUG_LOG(VIDEO, "Point params: size %f, texOffset %f, vpWidth %f, vpHeight %f",
pointSize, texOffset, vpWidth, vpHeight);
D3D::context->GSSetShader(shaderIt->second, nullptr, 0);
D3D::context->GSSetConstantBuffers(0, 1, &m_paramsBuffer);
D3D::stateman->setGeometryShader(shaderIt->second);
D3D::stateman->setGeometryConstants(m_paramsBuffer);
return true;
}