d3d12: Some cleaning

This commit is contained in:
vlj 2015-05-11 19:18:02 +02:00 committed by Vincent Lejeune
parent c6e2f070ee
commit d2889786a2
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,9 @@ size_t getFPBinarySize(void *ptr)
PipelineStateObjectCache::PipelineStateObjectCache() : currentShaderId(0) PipelineStateObjectCache::PipelineStateObjectCache() : currentShaderId(0)
{} {}
PipelineStateObjectCache::~PipelineStateObjectCache()
{}
bool PipelineStateObjectCache::SearchFp(const RSXFragmentProgram& rsx_fp, Shader& shader) bool PipelineStateObjectCache::SearchFp(const RSXFragmentProgram& rsx_fp, Shader& shader)
{ {
binary2FS::const_iterator It = cacheFS.find(vm::get_ptr<void>(rsx_fp.addr)); binary2FS::const_iterator It = cacheFS.find(vm::get_ptr<void>(rsx_fp.addr));

View File

@ -138,6 +138,10 @@ struct FragmentProgramCompare
typedef std::unordered_map<void *, Shader, HashVertexProgram, VertexProgramCompare> binary2VS; typedef std::unordered_map<void *, Shader, HashVertexProgram, VertexProgramCompare> binary2VS;
typedef std::unordered_map<void *, Shader, HashFragmentProgram, FragmentProgramCompare> binary2FS; typedef std::unordered_map<void *, Shader, HashFragmentProgram, FragmentProgramCompare> binary2FS;
/**
* Cache for shader blobs and Pipeline state object
* The class is responsible for creating the object so the state only has to call getGraphicPipelineState
*/
class PipelineStateObjectCache class PipelineStateObjectCache
{ {
private: private:
@ -155,6 +159,7 @@ private:
void Add(ID3D12PipelineState *prog, Shader& fp, Shader& vp); void Add(ID3D12PipelineState *prog, Shader& fp, Shader& vp);
public: public:
PipelineStateObjectCache(); PipelineStateObjectCache();
~PipelineStateObjectCache();
ID3D12PipelineState *getGraphicPipelineState(ID3D12Device *device, RSXVertexProgram *vertexShader, RSXFragmentProgram *fragmentShader); ID3D12PipelineState *getGraphicPipelineState(ID3D12Device *device, RSXVertexProgram *vertexShader, RSXFragmentProgram *fragmentShader);
}; };