1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 22:24:15 +01:00

[general] Minor COM pointer improvements

This commit is contained in:
Philip Rebohle 2018-01-29 16:31:25 +01:00
parent 173e46e2bd
commit ca53eaf878
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 10 additions and 3 deletions

View File

@ -1728,7 +1728,7 @@ namespace dxvk {
m_state.om.sampleMask = SampleMask;
if (blendState == nullptr)
blendState = m_defaultBlendState.ptr();
blendState = m_defaultBlendState;
EmitCs([
cBlendState = std::move(blendState),
@ -1769,7 +1769,7 @@ namespace dxvk {
m_state.om.dsState = depthStencilState;
if (depthStencilState == nullptr)
depthStencilState = m_defaultDepthStencilState.ptr();
depthStencilState = m_defaultDepthStencilState;
EmitCs([cDepthStencilState = std::move(depthStencilState)]
(DxvkContext* ctx) {
@ -1848,7 +1848,7 @@ namespace dxvk {
m_state.rs.state = rasterizerState;
if (rasterizerState == nullptr)
rasterizerState = m_defaultRasterizerState.ptr();
rasterizerState = m_defaultRasterizerState;
EmitCs([cRasterizerState = std::move(rasterizerState)]
(DxvkContext* ctx) {

View File

@ -32,6 +32,13 @@ namespace dxvk {
other.m_ptr = nullptr;
}
Com& operator = (T* object) {
this->decRef();
m_ptr = object;
this->incRef();
return *this;
}
Com& operator = (const Com& other) {
other.incRef();
this->decRef();