diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index f08ece4c..41eecff9 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1165,16 +1165,16 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE D3D11Device::CreateSamplerState( const D3D11_SAMPLER_DESC* pSamplerDesc, ID3D11SamplerState** ppSamplerState) { - HRESULT hr = D3D11SamplerState::ValidateDesc(pSamplerDesc); + D3D11_SAMPLER_DESC desc = *pSamplerDesc; - if (FAILED(hr)) - return hr; + if (FAILED(D3D11SamplerState::NormalizeDesc(&desc))) + return E_INVALIDARG; if (ppSamplerState == nullptr) return S_FALSE; try { - *ppSamplerState = m_samplerObjects.Create(this, *pSamplerDesc); + *ppSamplerState = m_samplerObjects.Create(this, desc); return S_OK; } catch (const DxvkError& e) { Logger::err(e.message()); diff --git a/src/d3d11/d3d11_sampler.cpp b/src/d3d11/d3d11_sampler.cpp index f7e363c7..b74f0b2b 100644 --- a/src/d3d11/d3d11_sampler.cpp +++ b/src/d3d11/d3d11_sampler.cpp @@ -73,8 +73,8 @@ namespace dxvk { } - HRESULT D3D11SamplerState::ValidateDesc(const D3D11_SAMPLER_DESC* desc) { - const uint32_t filterBits = static_cast(desc->Filter); + HRESULT D3D11SamplerState::NormalizeDesc(D3D11_SAMPLER_DESC* pDesc) { + const uint32_t filterBits = static_cast(pDesc->Filter); if (filterBits & 0xFFFFFF2A) { Logger::err(str::format("D3D11SamplerState: Unhandled filter: ", filterBits)); diff --git a/src/d3d11/d3d11_sampler.h b/src/d3d11/d3d11_sampler.h index e1f9cef9..e7f9eb08 100644 --- a/src/d3d11/d3d11_sampler.h +++ b/src/d3d11/d3d11_sampler.h @@ -33,8 +33,8 @@ namespace dxvk { return m_sampler; } - static HRESULT ValidateDesc( - const D3D11_SAMPLER_DESC* desc); + static HRESULT NormalizeDesc( + D3D11_SAMPLER_DESC* pDesc); private: