From 2dcdd205174a03be7b5862c63483a5c7ae7e0a21 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 10 Feb 2022 14:23:24 +0100 Subject: [PATCH] [d3d11] Change D3D11ResourceRef constructor to be more useful --- src/d3d11/d3d11_cmdlist.cpp | 2 +- src/d3d11/d3d11_resource.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/d3d11/d3d11_cmdlist.cpp b/src/d3d11/d3d11_cmdlist.cpp index b2e2fe78..aeb1cd5a 100644 --- a/src/d3d11/d3d11_cmdlist.cpp +++ b/src/d3d11/d3d11_cmdlist.cpp @@ -88,7 +88,7 @@ namespace dxvk { ID3D11Resource* pResource, D3D11_RESOURCE_DIMENSION ResourceType, UINT Subresource) { - m_resources.emplace_back(pResource, ResourceType, Subresource); + m_resources.emplace_back(pResource, Subresource, ResourceType); } diff --git a/src/d3d11/d3d11_resource.h b/src/d3d11/d3d11_resource.h index 9a61dddf..8f0e4b6c 100644 --- a/src/d3d11/d3d11_resource.h +++ b/src/d3d11/d3d11_resource.h @@ -170,18 +170,18 @@ namespace dxvk { m_subresource(0), m_resource(nullptr) { } D3D11ResourceRef(ID3D11Resource* pResource) + : D3D11ResourceRef(pResource, 0) { } + + D3D11ResourceRef(ID3D11Resource* pResource, UINT Subresource) : m_type(D3D11_RESOURCE_DIMENSION_UNKNOWN), - m_subresource(0), m_resource(pResource) { + m_subresource(Subresource), m_resource(pResource) { if (m_resource) { m_resource->GetType(&m_type); ResourceAddRefPrivate(m_resource, m_type); } } - D3D11ResourceRef(ID3D11Resource* pResource, D3D11_RESOURCE_DIMENSION Type) - : D3D11ResourceRef(pResource, Type, 0) { } - - D3D11ResourceRef(ID3D11Resource* pResource, D3D11_RESOURCE_DIMENSION Type, UINT Subresource) + D3D11ResourceRef(ID3D11Resource* pResource, UINT Subresource, D3D11_RESOURCE_DIMENSION Type) : m_type(Type), m_subresource(Subresource), m_resource(pResource) { if (m_resource) ResourceAddRefPrivate(m_resource, m_type);