mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 22:05:38 +00:00
MetalDevice: Anisotropy should be minimum 1
This commit is contained in:
parent
2071addce0
commit
601d8ff629
|
@ -197,7 +197,7 @@ std::unique_ptr<GPUSampler> D3D11Device::CreateSampler(const GPUSampler::Config&
|
||||||
desc.MinLOD = static_cast<float>(config.min_lod);
|
desc.MinLOD = static_cast<float>(config.min_lod);
|
||||||
desc.MaxLOD = static_cast<float>(config.max_lod);
|
desc.MaxLOD = static_cast<float>(config.max_lod);
|
||||||
|
|
||||||
if (config.anisotropy > 0)
|
if (config.anisotropy > 1)
|
||||||
{
|
{
|
||||||
desc.Filter = D3D11_FILTER_ANISOTROPIC;
|
desc.Filter = D3D11_FILTER_ANISOTROPIC;
|
||||||
desc.MaxAnisotropy = config.anisotropy;
|
desc.MaxAnisotropy = config.anisotropy;
|
||||||
|
|
|
@ -806,7 +806,7 @@ D3D12DescriptorHandle D3D12Device::GetSampler(const GPUSampler::Config& config)
|
||||||
desc.MinLOD = static_cast<float>(config.min_lod);
|
desc.MinLOD = static_cast<float>(config.min_lod);
|
||||||
desc.MaxLOD = static_cast<float>(config.max_lod);
|
desc.MaxLOD = static_cast<float>(config.max_lod);
|
||||||
|
|
||||||
if (config.anisotropy > 0)
|
if (config.anisotropy > 1)
|
||||||
{
|
{
|
||||||
desc.Filter = D3D12_FILTER_ANISOTROPIC;
|
desc.Filter = D3D12_FILTER_ANISOTROPIC;
|
||||||
desc.MaxAnisotropy = config.anisotropy;
|
desc.MaxAnisotropy = config.anisotropy;
|
||||||
|
|
|
@ -1264,7 +1264,7 @@ std::unique_ptr<GPUSampler> MetalDevice::CreateSampler(const GPUSampler::Config&
|
||||||
MTLSamplerMipFilterNotMipmapped;
|
MTLSamplerMipFilterNotMipmapped;
|
||||||
desc.lodMinClamp = static_cast<float>(config.min_lod);
|
desc.lodMinClamp = static_cast<float>(config.min_lod);
|
||||||
desc.lodMaxClamp = static_cast<float>(config.max_lod);
|
desc.lodMaxClamp = static_cast<float>(config.max_lod);
|
||||||
desc.maxAnisotropy = config.anisotropy;
|
desc.maxAnisotropy = std::max<u8>(config.anisotropy, 1);
|
||||||
|
|
||||||
if (config.address_u == GPUSampler::AddressMode::ClampToBorder ||
|
if (config.address_u == GPUSampler::AddressMode::ClampToBorder ||
|
||||||
config.address_v == GPUSampler::AddressMode::ClampToBorder ||
|
config.address_v == GPUSampler::AddressMode::ClampToBorder ||
|
||||||
|
|
|
@ -376,10 +376,8 @@ std::unique_ptr<GPUSampler> OpenGLDevice::CreateSampler(const GPUSampler::Config
|
||||||
glSamplerParameterf(sampler, GL_TEXTURE_MIN_LOD, static_cast<float>(config.min_lod));
|
glSamplerParameterf(sampler, GL_TEXTURE_MIN_LOD, static_cast<float>(config.min_lod));
|
||||||
glSamplerParameterf(sampler, GL_TEXTURE_MAX_LOD, static_cast<float>(config.max_lod));
|
glSamplerParameterf(sampler, GL_TEXTURE_MAX_LOD, static_cast<float>(config.max_lod));
|
||||||
glSamplerParameterfv(sampler, GL_TEXTURE_BORDER_COLOR, config.GetBorderFloatColor().data());
|
glSamplerParameterfv(sampler, GL_TEXTURE_BORDER_COLOR, config.GetBorderFloatColor().data());
|
||||||
if (config.anisotropy)
|
if (config.anisotropy > 1)
|
||||||
{
|
glSamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY, static_cast<float>(config.anisotropy.GetValue()));
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::unique_ptr<GPUSampler>(new OpenGLSampler(sampler));
|
return std::unique_ptr<GPUSampler>(new OpenGLSampler(sampler));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue