mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
DX11 code maintenance, part 6:
Move constant buffer management from EmuGfxState to Vertex/PixelShaderCache. Finally remove the EmuGfxState class, cheers! git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6915 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -17,38 +17,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "D3DBase.h"
|
||||
#include "VertexShaderGen.h"
|
||||
#include "PixelShaderGen.h"
|
||||
#include <stack>
|
||||
using std::stack;
|
||||
|
||||
struct ID3D11BlendState;
|
||||
struct ID3D11DepthStencilState;
|
||||
struct ID3D11RasterizerState;
|
||||
|
||||
namespace D3D
|
||||
{
|
||||
|
||||
// stores the pipeline state to use when calling VertexManager::Flush()
|
||||
class EmuGfxState
|
||||
{
|
||||
public:
|
||||
EmuGfxState();
|
||||
~EmuGfxState();
|
||||
|
||||
void ApplyState(); // apply current state
|
||||
void Reset();
|
||||
|
||||
|
||||
float psconstants[C_PENVCONST_END*4];
|
||||
float vsconstants[C_VENVCONST_END*4];
|
||||
bool vscbufchanged;
|
||||
bool pscbufchanged;
|
||||
|
||||
private:
|
||||
ID3D11Buffer* vscbuf;
|
||||
ID3D11Buffer* pscbuf;
|
||||
|
||||
bool apply_called;
|
||||
};
|
||||
|
||||
template<typename T> class AutoState
|
||||
{
|
||||
public:
|
||||
@ -85,15 +62,14 @@ public:
|
||||
void Apply();
|
||||
|
||||
private:
|
||||
stack<AutoBlendState> blendstates;
|
||||
stack<AutoDepthStencilState> depthstates;
|
||||
stack<AutoRasterizerState> raststates;
|
||||
std::stack<AutoBlendState> blendstates;
|
||||
std::stack<AutoDepthStencilState> depthstates;
|
||||
std::stack<AutoRasterizerState> raststates;
|
||||
ID3D11BlendState* cur_blendstate;
|
||||
ID3D11DepthStencilState* cur_depthstate;
|
||||
ID3D11RasterizerState* cur_raststate;
|
||||
};
|
||||
|
||||
extern EmuGfxState* gfxstate;
|
||||
extern StateManager* stateman;
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user