MCPcopy Create free account
hub / github.com/aliasIsolation/aliasIsolation / CreateSamplerState_hook

Function CreateSamplerState_hook

src/dll/rendering.cpp:88–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86// ----------------------------------------------------------------------------------------------------------------
87
88HRESULT WINAPI CreateSamplerState_hook(ID3D11Device *device, const D3D11_SAMPLER_DESC *pSamplerDesc,
89 ID3D11SamplerState **ppSamplerState)
90{
91 ZoneScopedN(__FUNCTION__);
92
93 D3D11_SAMPLER_DESC desc = *pSamplerDesc;
94
95 // Only g-buffer pass objects have anisotropy, and those are also the ones that need the bias.
96 if (desc.MaxAnisotropy > 1.0f)
97 {
98 desc.MipLODBias -= 0.5f;
99 }
100
101 return g_d3dHookOrig.CreateSamplerState(device, &desc, ppSamplerState);
102}
103
104// ----------------------------------------------------------------------------------------------------------------
105

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected