D3D: Make state cache part of Renderer and not static

This commit is contained in:
Stenzek
2017-09-30 16:19:16 +10:00
parent 73a67aa413
commit 798ec96e14
4 changed files with 46 additions and 59 deletions

View File

@ -23,6 +23,8 @@ namespace DX11
class StateCache
{
public:
~StateCache();
// Get existing or create new render state.
// Returned objects is owned by the cache and does not need to be released.
ID3D11SamplerState* Get(SamplerState state);
@ -30,9 +32,6 @@ public:
ID3D11RasterizerState* Get(RasterizationState state);
ID3D11DepthStencilState* Get(DepthState state);
// Release all cached states and clear hash tables.
void Clear();
// Convert RasterState primitive type to D3D11 primitive topology.
static D3D11_PRIMITIVE_TOPOLOGY GetPrimitiveTopology(PrimitiveType primitive);