shouldUseMipRadianceLayout static method

  1. @visibleForTesting
bool shouldUseMipRadianceLayout({
  1. required bool isWeb,
  2. required TargetPlatform targetPlatform,
  3. required bool backendSupportsMips,
  4. required bool? platformMipSamplingWorks,
})

Applies the backend capability and the measured Android mip sampling probe. Before the probe resolves, Android conservatively stays on the atlas so environments built early are never wrong.

Implementation

@visibleForTesting
static bool shouldUseMipRadianceLayout({
  required bool isWeb,
  required TargetPlatform targetPlatform,
  required bool backendSupportsMips,
  required bool? platformMipSamplingWorks,
}) {
  if (!backendSupportsMips) {
    return false;
  }
  if (isWeb || targetPlatform != TargetPlatform.android) {
    return true;
  }
  return platformMipSamplingWorks ?? false;
}