summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-06-28 19:08:28 -0400
committerLioncash <mathew1800@gmail.com>2015-06-28 19:52:40 -0400
commitdaa205990fa043092394931b85be6efdc37408df (patch)
treed1e85f070ba34dc138e6744ddc18453b8f525d10 /Source/Core/VideoBackends
parent1120132d261f08fae7bb19933a4d814d52eca8a3 (diff)
Use emplace() instead of insert() where applicable for maps.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/D3D/D3DState.cpp26
-rw-r--r--Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp2
2 files changed, 18 insertions, 10 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3DState.cpp b/Source/Core/VideoBackends/D3D/D3DState.cpp
index 5bd95bc8f3..9627ae2019 100644
--- a/Source/Core/VideoBackends/D3D/D3DState.cpp
+++ b/Source/Core/VideoBackends/D3D/D3DState.cpp
@@ -315,9 +315,11 @@ ID3D11SamplerState* StateCache::Get(SamplerState state)
ID3D11SamplerState* res = nullptr;
HRESULT hr = D3D::device->CreateSamplerState(&sampdc, &res);
- if (FAILED(hr)) PanicAlert("Fail %s %d\n", __FILE__, __LINE__);
+ if (FAILED(hr))
+ PanicAlert("Fail %s %d\n", __FILE__, __LINE__);
+
D3D::SetDebugObjectName((ID3D11DeviceChild*)res, "sampler state used to emulate the GX pipeline");
- m_sampler.insert(std::make_pair(state.packed, res));
+ m_sampler.emplace(state.packed, res);
return res;
}
@@ -394,9 +396,11 @@ ID3D11BlendState* StateCache::Get(BlendState state)
ID3D11BlendState* res = nullptr;
HRESULT hr = D3D::device->CreateBlendState(&blenddc, &res);
- if (FAILED(hr)) PanicAlert("Failed to create blend state at %s %d\n", __FILE__, __LINE__);
+ if (FAILED(hr))
+ PanicAlert("Failed to create blend state at %s %d\n", __FILE__, __LINE__);
+
D3D::SetDebugObjectName((ID3D11DeviceChild*)res, "blend state used to emulate the GX pipeline");
- m_blend.insert(std::make_pair(state.packed, res));
+ m_blend.emplace(state.packed, res);
return res;
}
@@ -415,9 +419,11 @@ ID3D11RasterizerState* StateCache::Get(RasterizerState state)
ID3D11RasterizerState* res = nullptr;
HRESULT hr = D3D::device->CreateRasterizerState(&rastdc, &res);
- if (FAILED(hr)) PanicAlert("Failed to create rasterizer state at %s %d\n", __FILE__, __LINE__);
+ if (FAILED(hr))
+ PanicAlert("Failed to create rasterizer state at %s %d\n", __FILE__, __LINE__);
+
D3D::SetDebugObjectName((ID3D11DeviceChild*)res, "rasterizer state used to emulate the GX pipeline");
- m_raster.insert(std::make_pair(state.packed, res));
+ m_raster.emplace(state.packed, res);
return res;
}
@@ -466,10 +472,12 @@ ID3D11DepthStencilState* StateCache::Get(ZMode state)
ID3D11DepthStencilState* res = nullptr;
HRESULT hr = D3D::device->CreateDepthStencilState(&depthdc, &res);
- if (SUCCEEDED(hr)) D3D::SetDebugObjectName((ID3D11DeviceChild*)res, "depth-stencil state used to emulate the GX pipeline");
- else PanicAlert("Failed to create depth state at %s %d\n", __FILE__, __LINE__);
+ if (SUCCEEDED(hr))
+ D3D::SetDebugObjectName((ID3D11DeviceChild*)res, "depth-stencil state used to emulate the GX pipeline");
+ else
+ PanicAlert("Failed to create depth state at %s %d\n", __FILE__, __LINE__);
- m_depth.insert(std::make_pair(state.hex, res));
+ m_depth.emplace(state.hex, res);
return res;
}
diff --git a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp
index 485cf54ee3..cdb7f75102 100644
--- a/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp
+++ b/Source/Core/VideoBackends/D3D/PSTextureEncoder.cpp
@@ -258,7 +258,7 @@ ID3D11PixelShader* PSTextureEncoder::SetStaticShader(unsigned int dstFormat, PEC
dstFormat, srcFormat, isIntensity, scaleByHalf);
D3D::SetDebugObjectName(newShader, debugName);
- it = m_staticShaders.insert(std::make_pair(key, newShader)).first;
+ it = m_staticShaders.emplace(key, newShader).first;
bytecode->Release();
}