1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-19 05: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(
const D3D11_BUFFER_DESC* pDesc) {
HRESULT D3D11Buffer::NormalizeBufferProperties(D3D11_BUFFER_DESC* pDesc) {
// Zero-sized buffers are illegal
if (!pDesc->ByteWidth)
return E_INVALIDARG;

View File

@ -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:

View File

@ -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<D3D11Buffer> buffer
= new D3D11Buffer(this, pDesc);
const Com<D3D11Buffer> buffer = new D3D11Buffer(this, &desc);
m_initializer->InitBuffer(buffer.ptr(), pInitialData);
*ppBuffer = buffer.ref();
return S_OK;