Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,9 @@ struct ID3D11Device_CreateSamplerState
static HRESULT STDMETHODCALLTYPE thunk(ID3D11Device* This, D3D11_SAMPLER_DESC* pSamplerDesc, ID3D11SamplerState** ppSamplerState)
{
// Limit Anisotropy to 8x for performance
pSamplerDesc->MaxAnisotropy = std::min(pSamplerDesc->MaxAnisotropy, 8u);
return func(This, pSamplerDesc, ppSamplerState);
D3D11_SAMPLER_DESC descCopy = *pSamplerDesc; // make a copy, pSamplerDesc is supposed to be immutable
descCopy.MaxAnisotropy = std::min(descCopy.MaxAnisotropy, 8u);
return func(This, &descCopy, ppSamplerState);
}
static inline REL::Relocation<decltype(thunk)> func;
};
Expand Down