1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 07:29:17 +01:00

[d3d11] D3D11SamplerState: Cosmetic changes

This commit is contained in:
Philip Rebohle 2018-05-09 11:55:05 +02:00
parent 5465ee8a85
commit b6d33e6289
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -12,24 +12,27 @@ namespace dxvk {
// While D3D11_FILTER is technically an enum, its value bits // While D3D11_FILTER is technically an enum, its value bits
// can be used to decode the filter properties more efficiently. // can be used to decode the filter properties more efficiently.
const uint32_t filterBits = static_cast<uint32_t>(desc.Filter); const uint32_t filterBits = uint32_t(desc.Filter);
info.magFilter = (filterBits & 0x04) ? VK_FILTER_LINEAR : VK_FILTER_NEAREST; info.magFilter = (filterBits & 0x04) ? VK_FILTER_LINEAR : VK_FILTER_NEAREST;
info.minFilter = (filterBits & 0x10) ? VK_FILTER_LINEAR : VK_FILTER_NEAREST; info.minFilter = (filterBits & 0x10) ? VK_FILTER_LINEAR : VK_FILTER_NEAREST;
info.mipmapMode = (filterBits & 0x01) ? VK_SAMPLER_MIPMAP_MODE_LINEAR : VK_SAMPLER_MIPMAP_MODE_NEAREST;
info.useAnisotropy = (filterBits & 0x40) ? VK_TRUE : VK_FALSE;
info.compareToDepth = (filterBits & 0x80) ? VK_TRUE : VK_FALSE;
// Set up the remaining properties, which are // Set up the remaining properties, which are
// stored directly in the sampler description // stored directly in the sampler description
info.mipmapMode = (filterBits & 0x01) ? VK_SAMPLER_MIPMAP_MODE_LINEAR : VK_SAMPLER_MIPMAP_MODE_NEAREST;
info.mipmapLodBias = desc.MipLODBias; info.mipmapLodBias = desc.MipLODBias;
info.mipmapLodMin = desc.MinLOD; info.mipmapLodMin = desc.MinLOD;
info.mipmapLodMax = desc.MaxLOD; info.mipmapLodMax = desc.MaxLOD;
info.maxAnisotropy = static_cast<float>(desc.MaxAnisotropy);
info.useAnisotropy = (filterBits & 0x40) ? VK_TRUE : VK_FALSE;
info.maxAnisotropy = float(desc.MaxAnisotropy);
info.addressModeU = DecodeAddressMode(desc.AddressU); info.addressModeU = DecodeAddressMode(desc.AddressU);
info.addressModeV = DecodeAddressMode(desc.AddressV); info.addressModeV = DecodeAddressMode(desc.AddressV);
info.addressModeW = DecodeAddressMode(desc.AddressW); info.addressModeW = DecodeAddressMode(desc.AddressW);
info.compareToDepth = (filterBits & 0x80) ? VK_TRUE : VK_FALSE;
info.compareOp = DecodeCompareOp(desc.ComparisonFunc); info.compareOp = DecodeCompareOp(desc.ComparisonFunc);
info.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; info.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
info.usePixelCoord = VK_FALSE; // Not supported in D3D11 info.usePixelCoord = VK_FALSE; // Not supported in D3D11
@ -79,7 +82,7 @@ namespace dxvk {
HRESULT D3D11SamplerState::NormalizeDesc(D3D11_SAMPLER_DESC* pDesc) { HRESULT D3D11SamplerState::NormalizeDesc(D3D11_SAMPLER_DESC* pDesc) {
const uint32_t filterBits = static_cast<uint32_t>(pDesc->Filter); const uint32_t filterBits = uint32_t(pDesc->Filter);
if (filterBits & 0xFFFFFF2A) { if (filterBits & 0xFFFFFF2A) {
Logger::err(str::format( Logger::err(str::format(