dolphin/Source/Core/VideoBackends/D3D/GeometryShaderCache.h
Scott Mansell 2f134c5c36 Remove the rest of ShaderDebugging.
Without UID checking, it's basically a no-op that disables shader cache
and stores the shader source code (without ever reading it back).
2016-06-26 16:25:11 +12:00

48 lines
1.2 KiB
C++

// Copyright 2014 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <d3d11.h>
#include <map>
#include "VideoCommon/GeometryShaderGen.h"
namespace DX11
{
class GeometryShaderCache
{
public:
static void Init();
static void Clear();
static void Shutdown();
static bool SetShader(u32 primitive_type); // TODO: Should be renamed to LoadShader
static bool InsertByteCode(const GeometryShaderUid& uid, const void* bytecode,
unsigned int bytecodelen);
static ID3D11GeometryShader* GeometryShaderCache::GetClearGeometryShader();
static ID3D11GeometryShader* GeometryShaderCache::GetCopyGeometryShader();
static ID3D11GeometryShader* GetActiveShader() { return last_entry->shader; }
static ID3D11Buffer*& GetConstantBuffer();
private:
struct GSCacheEntry
{
ID3D11GeometryShader* shader;
GSCacheEntry() : shader(nullptr) {}
void Destroy() { SAFE_RELEASE(shader); }
};
typedef std::map<GeometryShaderUid, GSCacheEntry> GSCache;
static GSCache GeometryShaders;
static const GSCacheEntry* last_entry;
static GeometryShaderUid last_uid;
static const GSCacheEntry pass_entry;
};
} // namespace DX11