Skip to content

Commit 1b6f416

Browse files
author
Thor Hjalmarsson
committed
Fix filtering
1 parent b473209 commit 1b6f416

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

pxr/imaging/hgiMetal/blitCmds.mm

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@
452452
_HgiCanBeFiltered(HgiFormat format)
453453
{
454454
HgiFormat const componentFormat = HgiGetComponentBaseFormat(format);
455-
456455
switch(componentFormat) {
457456
case HgiFormatInt16:
458457
case HgiFormatUInt16:
@@ -462,14 +461,29 @@
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

466479
void
467480
HgiMetalBlitCmds::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()];

0 commit comments

Comments
 (0)