Improve VRAM texture compression checks for mobile/web
For HTML5, we need to support S3TC if running on desktop, and ETC or ETC2 for mobile, so make this explicit. Add logic to check for ETC2 support on GLES3, and remove incorrect ETC feature for GLES3 on Android. Fix ETC check invalidating templates on HTML5. Fixes #26476.
This commit is contained in:
@ -1163,10 +1163,13 @@ void EditorExport::add_export_preset(const Ref<EditorExportPreset> &p_preset, in
|
||||
String EditorExportPlatform::test_etc2() const {
|
||||
|
||||
String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name");
|
||||
bool etc2_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc");
|
||||
bool etc_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc");
|
||||
bool etc2_supported = ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2");
|
||||
|
||||
if (driver == "GLES2" && !etc2_supported) {
|
||||
return TTR("Target platform requires 'ETC' texture compression for GLES2. Enable support in Project Settings.");
|
||||
if (driver == "GLES2" && !etc_supported) {
|
||||
return TTR("Target platform requires 'ETC' texture compression for GLES2. Enable 'rendering/vram_compression/import_etc' in Project Settings.");
|
||||
} else if (driver == "GLES3" && !etc2_supported) {
|
||||
return TTR("Target platform requires 'ETC2' texture compression for GLES3. Enable 'rendering/vram_compression/import_etc2' in Project Settings.");
|
||||
}
|
||||
return String();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user