2016-01-08 03:40:35 +00:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "VideoCommon/GeometryShaderGen.h"
|
|
|
|
#include "VideoCommon/PixelShaderGen.h"
|
|
|
|
#include "VideoCommon/VertexShaderGen.h"
|
|
|
|
|
|
|
|
namespace DX12
|
|
|
|
{
|
|
|
|
class D3DBlob;
|
|
|
|
|
|
|
|
class ShaderCache final
|
|
|
|
{
|
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
static void Init();
|
|
|
|
static void Clear();
|
|
|
|
static void Shutdown();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-12-28 00:37:41 +00:00
|
|
|
static void LoadAndSetActiveShaders(u32 gs_primitive_type);
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
template <class UidType, class ShaderCacheType>
|
|
|
|
static D3D12_SHADER_BYTECODE InsertByteCode(const UidType& uid, ShaderCacheType* shader_cache,
|
|
|
|
ID3DBlob* bytecode_blob);
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
static D3D12_SHADER_BYTECODE GetActiveGeometryShaderBytecode();
|
|
|
|
static D3D12_SHADER_BYTECODE GetActivePixelShaderBytecode();
|
|
|
|
static D3D12_SHADER_BYTECODE GetActiveVertexShaderBytecode();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
static const GeometryShaderUid* GetActiveGeometryShaderUid();
|
|
|
|
static const PixelShaderUid* GetActivePixelShaderUid();
|
|
|
|
static const VertexShaderUid* GetActiveVertexShaderUid();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
static D3D12_SHADER_BYTECODE GetGeometryShaderFromUid(const GeometryShaderUid* uid);
|
|
|
|
static D3D12_SHADER_BYTECODE GetPixelShaderFromUid(const PixelShaderUid* uid);
|
|
|
|
static D3D12_SHADER_BYTECODE GetVertexShaderFromUid(const VertexShaderUid* uid);
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
static D3D12_PRIMITIVE_TOPOLOGY_TYPE GetCurrentPrimitiveTopology();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
static void SetCurrentPrimitiveTopology(u32 gs_primitive_type);
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
static void HandleGSUIDChange(GeometryShaderUid gs_uid, u32 gs_primitive_type);
|
2016-12-28 00:37:41 +00:00
|
|
|
static void HandlePSUIDChange(PixelShaderUid ps_uid);
|
2016-06-24 08:43:46 +00:00
|
|
|
static void HandleVSUIDChange(VertexShaderUid vs_uid);
|
2016-01-08 03:40:35 +00:00
|
|
|
};
|
|
|
|
}
|