Skip to content
Permalink
Browse files

D3D11: Make stateman a unique_ptr

  • Loading branch information...
stenzek committed Mar 29, 2019
1 parent 3b86c93 commit d0d010f8549cc902829f567b3b5127d9a0556ca5
@@ -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.bSupportsSSAA = shader_model_5_supported;

stateman = new StateManager();
stateman = std::make_unique<StateManager>();
return true;
}

void Destroy()
{
delete stateman;
stateman = nullptr;
stateman.reset();

context->ClearState();
context->Flush();
@@ -20,7 +20,7 @@ namespace DX11
{
namespace D3D
{
StateManager* stateman;
std::unique_ptr<StateManager> stateman;

StateManager::StateManager() = default;
StateManager::~StateManager() = default;
@@ -6,6 +6,7 @@

#include <array>
#include <cstddef>
#include <memory>
#include <mutex>
#include <unordered_map>

@@ -296,7 +297,7 @@ class StateManager
ID3D11ComputeShader* m_compute_shader = nullptr;
};

extern StateManager* stateman;
extern std::unique_ptr<StateManager> stateman;

} // namespace D3D

0 comments on commit d0d010f

Please sign in to comment.
You can’t perform that action at this time.