mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
836b9b9acb
Also moves logic for primitive handling to VideoCommon.
51 lines
1.2 KiB
C++
51 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 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
|