From d6bc35578249a8d6141b29dde7a638d42497850e Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Sat, 24 Jul 2021 18:50:08 +0100 Subject: [PATCH] [d3d9] Fix code-style of D3D9Subresource and inline --- src/d3d9/d3d9_subresource.h | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/d3d9/d3d9_subresource.h b/src/d3d9/d3d9_subresource.h index 7c20d3a0..724e5bc2 100644 --- a/src/d3d9/d3d9_subresource.h +++ b/src/d3d9/d3d9_subresource.h @@ -17,13 +17,15 @@ namespace dxvk { UINT MipLevel, IDirect3DBaseTexture9* pBaseTexture, IUnknown* pContainer) - : D3D9Resource ( pDevice ) - , m_container ( pContainer ) - , m_baseTexture ( pBaseTexture ) - , m_texture ( pTexture ) - , m_face ( Face ) - , m_mipLevel ( MipLevel ) - , m_isSrgbCompatible ( pTexture->IsSrgbCompatible() ) { } + : D3D9Resource(pDevice), + m_container (pContainer), + m_baseTexture (pBaseTexture), + m_texture (pTexture), + m_face (Face), + m_mipLevel (MipLevel), + m_isSrgbCompatible (pTexture->IsSrgbCompatible()) { + + } ~D3D9Subresource() { // We own the texture! @@ -56,23 +58,23 @@ namespace dxvk { m_texture->PreLoadSubresource(GetSubresource()); } - D3D9CommonTexture* GetCommonTexture() { + inline D3D9CommonTexture* GetCommonTexture() { return m_texture; } - UINT GetFace() const { + inline UINT GetFace() const { return m_face; } - UINT GetMipLevel() const { + inline UINT GetMipLevel() const { return m_mipLevel; } - UINT GetSubresource() const { + inline UINT GetSubresource() const { return m_texture->CalcSubresource(m_face, m_mipLevel); } - const Rc& GetImageView(bool Srgb) { + inline const Rc& GetImageView(bool Srgb) { Srgb &= m_isSrgbCompatible; Rc& view = m_sampleView.Pick(Srgb); @@ -82,7 +84,7 @@ namespace dxvk { return view; } - const Rc& GetRenderTargetView(bool Srgb) { + inline const Rc& GetRenderTargetView(bool Srgb) { Srgb &= m_isSrgbCompatible; Rc& view = m_renderTargetView.Pick(Srgb); @@ -92,11 +94,11 @@ namespace dxvk { return view; } - VkImageLayout GetRenderTargetLayout() const { + inline VkImageLayout GetRenderTargetLayout() const { return m_texture->DetermineRenderTargetLayout(); } - const Rc& GetDepthStencilView() { + inline const Rc& GetDepthStencilView() { Rc& view = m_depthStencilView; if (unlikely(view == nullptr)) @@ -105,19 +107,19 @@ namespace dxvk { return view; } - VkImageLayout GetDepthStencilLayout(bool write, bool hazardous) const { + inline VkImageLayout GetDepthStencilLayout(bool write, bool hazardous) const { return m_texture->DetermineDepthStencilLayout(write, hazardous); } - bool IsNull() { + inline bool IsNull() { return m_texture->Desc()->Format == D3D9Format::NULL_FORMAT; } - IDirect3DBaseTexture9* GetBaseTexture() { + inline IDirect3DBaseTexture9* GetBaseTexture() { return m_baseTexture; } - void Swap(D3D9Subresource* Other) { + inline void Swap(D3D9Subresource* Other) { // Only used for swap chain back buffers that don't // have a container and all have identical properties std::swap(m_texture, Other->m_texture);