[Metal] PF_FloatRGBA (RGBA16Float) is never reported as TextureFilterable, although Apple documents it as filterable on every GPU family

Summary

On Metal, UE::PixelFormat::HasCapabilities(PF_FloatRGBA, EPixelFormatCapabilities::TextureFilterable) always returns false. On D3D11, D3D12, Vulkan and OpenGL, the same call returns true. The hardware is not the limitation: sampling an RGBA16F texture with a bilinear sampler works correctly on Metal. Only the capability flag that UE reports is missing.

How we found it. Our project chooses a GPU wind-simulation backend at startup. The simulation writes velocity to a PF_FloatRGBA Texture2DArray, and materials sample that texture bilinearly. Before enabling the feature, the project checks that the format has Texture2D | TextureSample | TextureFilterable | UAV | TypedUAVStore. On Metal, every one of those flags is present except TextureFilterable, so the feature reports unsupported on every Mac and iPhone.

Engine features affected the same way. These are the places in the engine that check TextureFilterable:

Call site Format checked Metal result Effect on Metal
FogSeparateComposition.cpp, DoesPlatformSupportFSSS() (Fog Screen Space Scattering) PF_FloatRGBA not filterable FSSS can never be enabled
MediaTextureResource.cpp (mip generation) output format, often PF_FloatRGBA not filterable media texture mips are generated with point sampling
ShadingEnergyConservation.cpp PF_G16, PF_A16B16G16R16 not filterable falls back to another format
SpecularProfile.cpp PF_FloatR11G11B10 not filterable falls back to another format
Niagara / PCG landscape height sampling PF_R32_FLOAT filterable only on Apple9 see the 32-bit float note below
SystemTextures.cpp PF_G16R16 filterable correct

Root cause: the other RHIs query the driver, but Metal provides no query API.

RHIInitDefaultPixelFormatCapabilities() gives every non-block-compressed format AllTextureFlags | AllBufferFlags | UAV. AllTextureFlags does not include TextureFilterable, so each RHI has to add that flag itself:

  • Vulkan: FVulkanDevice::MapImageFormatSupport calls vkGetPhysicalDeviceFormatProperties and maps VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT to TextureFilterable.
  • D3D12 / D3D11: FD3D12Device::SetupAfterDeviceCreation calls CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) for each format and maps D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE to TextureSample | TextureFilterable. D3D11 uses the equivalent query.
  • OpenGL: maps EOpenGLFormatCapabilities::Filterable to TextureFilterable.

Metal has no API that returns a pixel format’s capabilities. Apple documents them in the Metal Feature Set Tables, in the “Texture capabilities by pixel format” section:

Metal exposes runtime properties only for the cases the table marks as device-dependent. Examples:

  • MTLDevice.supports32BitFloatFiltering, referenced by the table’s footnote on 32-bit float formats
  • readWriteTextureSupport
  • supportsBCTextureCompression

The table also states that every Metal 3 and Metal 4 device supports at least the capabilities in the Apple7 column. These are the relevant rows:

MTLPixelFormat UE format Apple2 … Apple11
RGBA16Float PF_FloatRGBA All (includes Filter)
RG16Float PF_G16R16F, PF_G16R16F_FILTER All
R16Float PF_R16F All
R32Float / RG32Float / RGBA32Float PF_R32_FLOAT, … Filter only on newer families; some other devices are reported through supports32BitFloatFiltering

What MetalRHI does today. FMetalDynamicRHI adds TextureFilterable by hand for only two formats:

  • PF_R32_FLOAT, and only when the device supports GPUFamilyApple9
  • PF_G16R16

No other format gets the flag, even when Apple’s table lists it as filterable. PF_FloatRGBA already receives TypedUAVLoad | TypedUAVStore on ReadWriteTextureTier2 devices, so TextureFilterable is the only flag it is missing.

Other Metal backends maintain a complete hand-written table. Because Metal cannot be queried, other cross-platform graphics layers keep a full per-format capability table based on Apple’s document, then adjust it with the per-device properties:

  • MoltenVK (Khronos): MVKPixelFormats.mm lists RGBA16Float, RG16Float and RG11B10Float as All on both iOS and macOS. It enables Filter for the 32-bit float formats when supports32BitFloatFiltering is true. In MoltenVK#1814, the maintainer directs contributors to the Feature Set Tables as the source for this table.
  • wgpu (gfx-rs): the Metal backend maps format capabilities by hand in wgpu-hal/src/metal/adapter.rs. Keeping that mapping consistent with Apple’s table is tracked in gfx-rs/wgpu#8670 and #8594.

Suggested fix.

  1. After RHIInitDefaultPixelFormatCapabilities(), add TextureFilterable from a small per-format table built from Apple’s Feature Set Tables. Gate an entry with supportsFamily(...) where the table differs between GPU families.
  2. For the 32-bit float formats, also check supports32BitFloatFiltering.

This fix would change engine behavior on Metal in three ways:

  • FSSS becomes available.
  • Media texture mips are filtered bilinearly.
  • Energy conservation uses its primary formats instead of the fallbacks.

We already run a local patch for PF_FloatRGBA on Mac and iOS. If this approach is acceptable, we can open a PR that adds the full table.

What Type of Bug are you experiencing?

Rendering (Graphics / Niagara)

Steps to Reproduce

  1. Open any project on a Mac (Metal). Add this log line somewhere that runs after RHI initialization, such as a game module’s StartupModule:
    UE_LOG(LogTemp, Display, TEXT("FloatRGBA filterable = %d"),
        UE::PixelFormat::HasCapabilities(PF_FloatRGBA, EPixelFormatCapabilities::TextureFilterable));
    
  2. Run the same project on Windows (D3D12 or Vulkan) and on the Mac, then compare the log output.
  3. To see a visible symptom, add an Exponential Height Fog to any level and enable Screen Space Scattering (bEnableFSSS). Leave r.Fog.ScreenSpaceScattering=1, which is the default. Compare the result on Windows and on the Mac.

Expected Result

On Metal, the log prints FloatRGBA filterable = 1, the same as on D3D12 and Vulkan, because Apple’s Feature Set Tables list RGBA16Float as filterable on every Apple GPU family.

  • Fog Screen Space Scattering renders on the Mac the same way it does on Windows.

Observed Result

  • On Windows (D3D12/Vulkan), the log prints FloatRGBA filterable = 1. On the Mac (Metal), it prints FloatRGBA filterable = 0.
  • On the Mac, FSSS never renders. DoesPlatformSupportFSSS() returns false because PF_FloatRGBA does not have TextureFilterable.

Affects Versions

5.8

Platform(s)

iOS
Mac