Move shader caches to VideoCommon

This commit is contained in:
Stenzek
2018-02-25 01:15:35 +10:00
parent 24df896eb8
commit dec0c3bce8
48 changed files with 1448 additions and 3346 deletions

View File

@ -15,36 +15,12 @@ class GeometryShaderCache
{
public:
static void Init();
static void Reload();
static void Clear();
static void Shutdown();
static bool SetShader(PrimitiveType primitive_type);
static bool CompileShader(const GeometryShaderUid& uid);
static bool InsertByteCode(const GeometryShaderUid& uid, const u8* bytecode, size_t len);
static void PrecompileShaders();
static ID3D11GeometryShader* GetClearGeometryShader();
static ID3D11GeometryShader* GetCopyGeometryShader();
static ID3D11Buffer*& GetConstantBuffer();
private:
struct GSCacheEntry
{
ID3D11GeometryShader* shader;
GSCacheEntry() : shader(nullptr) {}
void Destroy() { SAFE_RELEASE(shader); }
};
typedef std::map<GeometryShaderUid, GSCacheEntry> GSCache;
static void LoadShaderCache();
static GSCache GeometryShaders;
static const GSCacheEntry* last_entry;
static GeometryShaderUid last_uid;
static const GSCacheEntry pass_entry;
};
} // namespace DX11