diff --git a/filament/backend/include/backend/DriverEnums.h b/filament/backend/include/backend/DriverEnums.h index d69a9991d2..8da0cfb02f 100644 --- a/filament/backend/include/backend/DriverEnums.h +++ b/filament/backend/include/backend/DriverEnums.h @@ -1244,7 +1244,7 @@ enum class Workaround : uint16_t { ADRENO_UNIFORM_ARRAY_CRASH, // Workaround a Metal pipeline compilation error with the message: // "Could not statically determine the target of a texture". See light_indirect.fs - A8X_STATIC_TEXTURE_TARGET_ERROR, + METAL_STATIC_TEXTURE_TARGET_ERROR, // Adreno drivers sometimes aren't able to blit into a layer of a texture array. DISABLE_BLIT_INTO_TEXTURE_ARRAY, // Multiple workarounds needed for PowerVR GPUs diff --git a/filament/backend/src/metal/MetalContext.h b/filament/backend/src/metal/MetalContext.h index 0f920466e9..f771ca5b41 100644 --- a/filament/backend/src/metal/MetalContext.h +++ b/filament/backend/src/metal/MetalContext.h @@ -93,7 +93,7 @@ struct MetalContext { } highestSupportedGpuFamily; struct { - bool a8xStaticTextureTargetError; + bool staticTextureTargetError; } bugs; // sampleCountLookup[requestedSamples] gives a <= sample count supported by the device. diff --git a/filament/backend/src/metal/MetalDriver.mm b/filament/backend/src/metal/MetalDriver.mm index a0c8217972..a9a0df24ed 100644 --- a/filament/backend/src/metal/MetalDriver.mm +++ b/filament/backend/src/metal/MetalDriver.mm @@ -162,8 +162,10 @@ MetalDriver::MetalDriver(MetalPlatform* platform, const Platform::DriverConfig& sc[s] = [mContext->device supportsTextureSampleCount:s] ? s : sc[s - 1]; } - mContext->bugs.a8xStaticTextureTargetError = - [mContext->device.name containsString:@"Apple A8X GPU"]; + mContext->bugs.staticTextureTargetError = + [mContext->device.name containsString:@"Apple A8X GPU"] || + [mContext->device.name containsString:@"Apple A8 GPU"] || + [mContext->device.name containsString:@"Apple A7 GPU"]; mContext->commandQueue = mPlatform.createCommandQueue(mContext->device); mContext->pipelineStateCache.setDevice(mContext->device); @@ -840,8 +842,8 @@ bool MetalDriver::isWorkaroundNeeded(Workaround workaround) { return true; case Workaround::ADRENO_UNIFORM_ARRAY_CRASH: return false; - case Workaround::A8X_STATIC_TEXTURE_TARGET_ERROR: - return mContext->bugs.a8xStaticTextureTargetError; + case Workaround::METAL_STATIC_TEXTURE_TARGET_ERROR: + return mContext->bugs.staticTextureTargetError; case Workaround::DISABLE_BLIT_INTO_TEXTURE_ARRAY: return false; default: diff --git a/filament/src/details/Material.cpp b/filament/src/details/Material.cpp index 6d73f96027..64eabe0368 100644 --- a/filament/src/details/Material.cpp +++ b/filament/src/details/Material.cpp @@ -873,7 +873,7 @@ void FMaterial::processSpecializationConstants(FEngine& engine, Material::Builde engine.getDriverApi().getMaxUniformBufferSize() / 16u); bool const staticTextureWorkaround = - engine.getDriverApi().isWorkaroundNeeded(Workaround::A8X_STATIC_TEXTURE_TARGET_ERROR); + engine.getDriverApi().isWorkaroundNeeded(Workaround::METAL_STATIC_TEXTURE_TARGET_ERROR); bool const powerVrShaderWorkarounds = engine.getDriverApi().isWorkaroundNeeded(Workaround::POWER_VR_SHADER_WORKAROUNDS); diff --git a/shaders/src/light_indirect.fs b/shaders/src/light_indirect.fs index 5dc3cad35d..793e4501bc 100644 --- a/shaders/src/light_indirect.fs +++ b/shaders/src/light_indirect.fs @@ -72,7 +72,7 @@ vec3 Irradiance_RoughnessOne(const vec3 n) { //------------------------------------------------------------------------------ vec3 diffuseIrradiance(const vec3 n) { - // On Metal devices with an A8X chipset, this light_iblSpecular texture sample must be pulled + // On Metal devices with certain chipsets, this light_iblSpecular texture sample must be pulled // outside the frameUniforms.iblSH check. This is to avoid a Metal pipeline compilation error // with the message: "Could not statically determine the target of a texture". // The reason for this is unknown, and is possibly a bug that exhibits only on these devices.