1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[d3d11] Change ValidateBufferProperties to NormalizeBufferProperties

This commit is contained in:
Philip Rebohle 2019-10-11 17:23:02 +02:00
parent 409991b9db
commit 762df0bedf
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 7 additions and 9 deletions

View File

@ -181,8 +181,7 @@ namespace dxvk {
} }
HRESULT D3D11Buffer::ValidateBufferProperties( HRESULT D3D11Buffer::NormalizeBufferProperties(D3D11_BUFFER_DESC* pDesc) {
const D3D11_BUFFER_DESC* pDesc) {
// Zero-sized buffers are illegal // Zero-sized buffers are illegal
if (!pDesc->ByteWidth) if (!pDesc->ByteWidth)
return E_INVALIDARG; return E_INVALIDARG;

View File

@ -113,13 +113,13 @@ namespace dxvk {
} }
/** /**
* \brief Validates buffer description * \brief Normalizes buffer description
* *
* \param [in] pDesc Buffer description * \param [in] pDesc Buffer description
* \returns \c S_OK if the parameters are valid * \returns \c S_OK if the parameters are valid
*/ */
static HRESULT ValidateBufferProperties( static HRESULT NormalizeBufferProperties(
const D3D11_BUFFER_DESC* pDesc); D3D11_BUFFER_DESC* pDesc);
private: private:

View File

@ -81,7 +81,8 @@ namespace dxvk {
if (!pDesc) if (!pDesc)
return E_INVALIDARG; return E_INVALIDARG;
HRESULT hr = D3D11Buffer::ValidateBufferProperties(pDesc); D3D11_BUFFER_DESC desc = *pDesc;
HRESULT hr = D3D11Buffer::NormalizeBufferProperties(&desc);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
@ -90,9 +91,7 @@ namespace dxvk {
return S_FALSE; return S_FALSE;
try { try {
const Com<D3D11Buffer> buffer const Com<D3D11Buffer> buffer = new D3D11Buffer(this, &desc);
= new D3D11Buffer(this, pDesc);
m_initializer->InitBuffer(buffer.ptr(), pInitialData); m_initializer->InitBuffer(buffer.ptr(), pInitialData);
*ppBuffer = buffer.ref(); *ppBuffer = buffer.ref();
return S_OK; return S_OK;