mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-07 10:22:22 +00:00
D3D11: Make stateman a unique_ptr
This commit is contained in:
parent
3b86c93285
commit
d0d010f854
@ -156,14 +156,13 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
|||||||
g_Config.backend_info.bSupportsGSInstancing = shader_model_5_supported;
|
g_Config.backend_info.bSupportsGSInstancing = shader_model_5_supported;
|
||||||
g_Config.backend_info.bSupportsSSAA = shader_model_5_supported;
|
g_Config.backend_info.bSupportsSSAA = shader_model_5_supported;
|
||||||
|
|
||||||
stateman = new StateManager();
|
stateman = std::make_unique<StateManager>();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Destroy()
|
void Destroy()
|
||||||
{
|
{
|
||||||
delete stateman;
|
stateman.reset();
|
||||||
stateman = nullptr;
|
|
||||||
|
|
||||||
context->ClearState();
|
context->ClearState();
|
||||||
context->Flush();
|
context->Flush();
|
||||||
|
@ -20,7 +20,7 @@ namespace DX11
|
|||||||
{
|
{
|
||||||
namespace D3D
|
namespace D3D
|
||||||
{
|
{
|
||||||
StateManager* stateman;
|
std::unique_ptr<StateManager> stateman;
|
||||||
|
|
||||||
StateManager::StateManager() = default;
|
StateManager::StateManager() = default;
|
||||||
StateManager::~StateManager() = default;
|
StateManager::~StateManager() = default;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <memory>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
@ -296,7 +297,7 @@ private:
|
|||||||
ID3D11ComputeShader* m_compute_shader = nullptr;
|
ID3D11ComputeShader* m_compute_shader = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern StateManager* stateman;
|
extern std::unique_ptr<StateManager> stateman;
|
||||||
|
|
||||||
} // namespace D3D
|
} // namespace D3D
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user