BC4 causes crash on Metal

I made simple test case from empty template which cause instant crash on iOS metal with iPad air. There is single unlit material that has Feature level switch. On default it’s use BC4/alpha texture compressed texture sample but on mobile it’s just replace that with constant value. Even that texture is not used on mobile it always causes crash.

[Zipped project][2]

Crash report. Incident Identifier: A1298BED-61E2-431B-B760-AC310651681ACrashReporter Key: - Pastebin.com

Hey Jenny,

Thank you for taking the time to write up this report and provide a simple repro case for the issue. I was able to confirm that the BC4 texture compression setting is indeed causing a crash in the 4.12 release. I have gone ahead and entered a bug for the issue, UE-31739.

Once the bug has been addressed by our engineers, a fix will be integrated into an upcoming major engine or hotfix release. Please let me know if you have further questions or need additional assistance.

Cheers,

Okay, so yeah, we just never supported that type (not that IOS devices can use it natively). The best bet seems to be converting it to single channel at cook time. Before we can test/verify this, you can try a fix yourself.

In IOSTargetPlatform.cpp, in FIOSTargetPlatform::GetTextureFormats(), add this to the FormatRemap table:

	FName(TEXT("BC4")),		FName(TEXT("G8")),			FName(TEXT("G8")),

And give it a go :slight_smile:

Josh

Sadly we don’t use source version so it’s not easy for me to test this potential fix. What is odd is that even when material does not use that texture it’s causing a crash. So it’s not possible to fix this kind of bug with feature levels.