mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 22:05:38 +00:00
GPUDevice: Implement MirrorRepeat address mode
This commit is contained in:
parent
6deb9d3072
commit
b65d2748b4
|
@ -177,6 +177,7 @@ std::unique_ptr<GPUSampler> D3D11Device::CreateSampler(const GPUSampler::Config&
|
|||
D3D11_TEXTURE_ADDRESS_WRAP, // Repeat
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP, // ClampToEdge
|
||||
D3D11_TEXTURE_ADDRESS_BORDER, // ClampToBorder
|
||||
D3D11_TEXTURE_ADDRESS_MIRROR, // MirrorRepeat
|
||||
}};
|
||||
static constexpr u8 filter_count = static_cast<u8>(GPUSampler::Filter::MaxCount);
|
||||
static constexpr D3D11_FILTER filters[filter_count][filter_count][filter_count] = {
|
||||
|
|
|
@ -786,6 +786,7 @@ D3D12DescriptorHandle D3D12Device::GetSampler(const GPUSampler::Config& config)
|
|||
D3D12_TEXTURE_ADDRESS_MODE_WRAP, // Repeat
|
||||
D3D12_TEXTURE_ADDRESS_MODE_CLAMP, // ClampToEdge
|
||||
D3D12_TEXTURE_ADDRESS_MODE_BORDER, // ClampToBorder
|
||||
D3D12_TEXTURE_ADDRESS_MODE_MIRROR, // MirrorRepeat
|
||||
}};
|
||||
|
||||
static constexpr u8 filter_count = static_cast<u8>(GPUSampler::Filter::MaxCount);
|
||||
|
|
|
@ -69,6 +69,7 @@ public:
|
|||
Repeat,
|
||||
ClampToEdge,
|
||||
ClampToBorder,
|
||||
MirrorRepeat,
|
||||
|
||||
MaxCount
|
||||
};
|
||||
|
|
|
@ -1231,6 +1231,7 @@ std::unique_ptr<GPUSampler> MetalDevice::CreateSampler(const GPUSampler::Config&
|
|||
MTLSamplerAddressModeRepeat, // Repeat
|
||||
MTLSamplerAddressModeClampToEdge, // ClampToEdge
|
||||
MTLSamplerAddressModeClampToBorderColor, // ClampToBorder
|
||||
MTLSamplerAddressModeMirrorRepeat, // MirrorRepeat
|
||||
}};
|
||||
static constexpr std::array<MTLSamplerMinMagFilter, static_cast<u8>(GPUSampler::Filter::MaxCount)> min_mag_filters =
|
||||
{{
|
||||
|
|
|
@ -363,6 +363,7 @@ std::unique_ptr<GPUSampler> OpenGLDevice::CreateSampler(const GPUSampler::Config
|
|||
GL_REPEAT, // Repeat
|
||||
GL_CLAMP_TO_EDGE, // ClampToEdge
|
||||
GL_CLAMP_TO_BORDER, // ClampToBorder
|
||||
GL_MIRRORED_REPEAT, // MirrorRepeat
|
||||
}};
|
||||
|
||||
// [mipmap_on_off][mipmap][filter]
|
||||
|
|
|
@ -182,7 +182,7 @@ static GPUSampler::Config MapSampler(const reshadefx::sampler_info& si)
|
|||
case reshadefx::texture_address_mode::wrap:
|
||||
return GPUSampler::AddressMode::Repeat;
|
||||
case reshadefx::texture_address_mode::mirror:
|
||||
Panic("Not implemented");
|
||||
return GPUSampler::AddressMode::MirrorRepeat;
|
||||
case reshadefx::texture_address_mode::clamp:
|
||||
return GPUSampler::AddressMode::ClampToEdge;
|
||||
case reshadefx::texture_address_mode::border:
|
||||
|
|
|
@ -870,6 +870,7 @@ VkSampler VulkanDevice::GetSampler(const GPUSampler::Config& config)
|
|||
VK_SAMPLER_ADDRESS_MODE_REPEAT, // Repeat
|
||||
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, // ClampToEdge
|
||||
VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER, // ClampToBorder
|
||||
VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT, // MirrorRepeat
|
||||
}};
|
||||
static constexpr std::array<VkFilter, static_cast<u8>(GPUSampler::Filter::MaxCount)> min_mag_filters = {{
|
||||
VK_FILTER_NEAREST, // Nearest
|
||||
|
|
Loading…
Reference in a new issue