mirror of
https://github.com/love2d/love.git
synced 2026-08-20 04:30:09 +02:00
metal: fix clampzero wrap mode.
This commit is contained in:
@@ -643,6 +643,11 @@ void Graphics::submitBlitEncoder()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isClampOne(SamplerState::WrapMode w)
|
||||||
|
{
|
||||||
|
return w == SamplerState::WRAP_CLAMP_ONE;
|
||||||
|
}
|
||||||
|
|
||||||
id<MTLSamplerState> Graphics::getCachedSampler(const SamplerState &s)
|
id<MTLSamplerState> Graphics::getCachedSampler(const SamplerState &s)
|
||||||
{ @autoreleasepool {
|
{ @autoreleasepool {
|
||||||
uint64 key = s.toKey();
|
uint64 key = s.toKey();
|
||||||
@@ -662,8 +667,11 @@ id<MTLSamplerState> Graphics::getCachedSampler(const SamplerState &s)
|
|||||||
desc.tAddressMode = getMTLSamplerAddressMode(s.wrapV);
|
desc.tAddressMode = getMTLSamplerAddressMode(s.wrapV);
|
||||||
desc.rAddressMode = getMTLSamplerAddressMode(s.wrapW);
|
desc.rAddressMode = getMTLSamplerAddressMode(s.wrapW);
|
||||||
|
|
||||||
if (@available(macOS 10.12, iOS 10.14, *))
|
if (isClampOne(s.wrapU) || isClampOne(s.wrapV) || isClampOne(s.wrapW))
|
||||||
desc.borderColor = MTLSamplerBorderColorOpaqueWhite;
|
{
|
||||||
|
if (@available(macOS 10.12, iOS 10.14, *))
|
||||||
|
desc.borderColor = MTLSamplerBorderColorOpaqueWhite;
|
||||||
|
}
|
||||||
|
|
||||||
desc.lodMinClamp = s.minLod;
|
desc.lodMinClamp = s.minLod;
|
||||||
desc.lodMaxClamp = s.maxLod;
|
desc.lodMaxClamp = s.maxLod;
|
||||||
|
|||||||
Reference in New Issue
Block a user