From 762df0bedf01897a035cd733adcb4ec6dbdfaaeb Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 11 Oct 2019 17:23:02 +0200 Subject: [PATCH] [d3d11] Change ValidateBufferProperties to NormalizeBufferProperties --- src/d3d11/d3d11_buffer.cpp | 3 +-- src/d3d11/d3d11_buffer.h | 6 +++--- src/d3d11/d3d11_device.cpp | 7 +++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/d3d11/d3d11_buffer.cpp b/src/d3d11/d3d11_buffer.cpp index 08398000a..792185f54 100644 --- a/src/d3d11/d3d11_buffer.cpp +++ b/src/d3d11/d3d11_buffer.cpp @@ -181,8 +181,7 @@ namespace dxvk { } - HRESULT D3D11Buffer::ValidateBufferProperties( - const D3D11_BUFFER_DESC* pDesc) { + HRESULT D3D11Buffer::NormalizeBufferProperties(D3D11_BUFFER_DESC* pDesc) { // Zero-sized buffers are illegal if (!pDesc->ByteWidth) return E_INVALIDARG; diff --git a/src/d3d11/d3d11_buffer.h b/src/d3d11/d3d11_buffer.h index 077354d4c..99d96cba6 100644 --- a/src/d3d11/d3d11_buffer.h +++ b/src/d3d11/d3d11_buffer.h @@ -113,13 +113,13 @@ namespace dxvk { } /** - * \brief Validates buffer description + * \brief Normalizes buffer description * * \param [in] pDesc Buffer description * \returns \c S_OK if the parameters are valid */ - static HRESULT ValidateBufferProperties( - const D3D11_BUFFER_DESC* pDesc); + static HRESULT NormalizeBufferProperties( + D3D11_BUFFER_DESC* pDesc); private: diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 4da8de10c..deac8fe0d 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -81,7 +81,8 @@ namespace dxvk { if (!pDesc) return E_INVALIDARG; - HRESULT hr = D3D11Buffer::ValidateBufferProperties(pDesc); + D3D11_BUFFER_DESC desc = *pDesc; + HRESULT hr = D3D11Buffer::NormalizeBufferProperties(&desc); if (FAILED(hr)) return hr; @@ -90,9 +91,7 @@ namespace dxvk { return S_FALSE; try { - const Com buffer - = new D3D11Buffer(this, pDesc); - + const Com buffer = new D3D11Buffer(this, &desc); m_initializer->InitBuffer(buffer.ptr(), pInitialData); *ppBuffer = buffer.ref(); return S_OK;