File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 452452_HgiCanBeFiltered (HgiFormat format)
453453{
454454 HgiFormat const componentFormat = HgiGetComponentBaseFormat (format);
455-
456455 switch (componentFormat) {
457456 case HgiFormatInt16:
458457 case HgiFormatUInt16:
462461 return true ;
463462 }
464463}
464+ static const std::set<MTLPixelFormat > unfilterableIosFormats =
465+ {
466+ {MTLPixelFormatRGBA32Float }
467+ };
468+
469+ bool
470+ IsFilterable (MTLPixelFormat format)
471+ {
472+ #if defined(ARCH_OS_IOS)
473+ return unfilterableIosFormats.find (format) == unfilterableIosFormats.end ();
474+ #else
475+ return true ;
476+ #endif
477+ }
465478
466479void
467480HgiMetalBlitCmds::GenerateMipMaps (HgiTextureHandle const & texture)
468481{
469482 HgiMetalTexture* metalTex = static_cast <HgiMetalTexture*>(texture.Get ());
470483 if (metalTex) {
471484 HgiFormat const format = metalTex->GetDescriptor ().format ;
472- if (_HgiCanBeFiltered (format)) {
485+ if (_HgiCanBeFiltered (format)
486+ && IsFilterable (metalTex->GetTextureId ().pixelFormat )) {
473487 _CreateEncoder ();
474488 // Can fail if the texture format is not filterable.
475489 [_blitEncoder generateMipmapsForTexture: metalTex->GetTextureId ()];
You can’t perform that action at this time.
0 commit comments