[d3d11] Refactored D3D11SamplerState creation

This commit is contained in:
Philip Rebohle 2018-03-18 23:35:40 +01:00
parent b04e9b5f18
commit 127fad89be
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 8 additions and 8 deletions

View File

@ -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());

View File

@ -73,8 +73,8 @@ namespace dxvk {
}
HRESULT D3D11SamplerState::ValidateDesc(const D3D11_SAMPLER_DESC* desc) {
const uint32_t filterBits = static_cast<uint32_t>(desc->Filter);
HRESULT D3D11SamplerState::NormalizeDesc(D3D11_SAMPLER_DESC* pDesc) {
const uint32_t filterBits = static_cast<uint32_t>(pDesc->Filter);
if (filterBits & 0xFFFFFF2A) {
Logger::err(str::format("D3D11SamplerState: Unhandled filter: ", filterBits));

View File

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