From 25e9686cf60ebbf3cb9efd4dfdeb187cdffaa293 Mon Sep 17 00:00:00 2001 From: Maksim Sisov Date: Thu, 9 Feb 2023 11:51:24 +0200 Subject: [PATCH] [ios]: fix missing caps for D16_UNORM Fixes "Assert failed in updateCaps (third_party/angle/src/libANGLE/ \ Context.cpp:4368): getClientVersion() < ES_3_0 || \ formatMaxSamples >= 4" as D16_UNORM caps were missing, which resulted in GenerateTextureCapsMap skipping that format. Bug: angleproject:6597, chromium:1413715 Change-Id: I031271e2db07d129e0c383107db2080794a11da1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4236537 Reviewed-by: Geoff Lang Commit-Queue: Geoff Lang --- scripts/code_generation_hashes/Metal_format_table.json | 4 ++-- src/libANGLE/renderer/metal/mtl_format_map.json | 9 +++++++++ src/libANGLE/renderer/metal/mtl_format_table_autogen.mm | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/scripts/code_generation_hashes/Metal_format_table.json b/scripts/code_generation_hashes/Metal_format_table.json index 3b69ed1e8..93017b02f 100644 --- a/scripts/code_generation_hashes/Metal_format_table.json +++ b/scripts/code_generation_hashes/Metal_format_table.json @@ -6,7 +6,7 @@ "src/libANGLE/renderer/metal/gen_mtl_format_table.py": "28f3065f5d1bc65803b1218b706430ae", "src/libANGLE/renderer/metal/mtl_format_map.json": - "635fa5d81e340bf0d6c7cbbdd804b110", + "1bfe5f014cd73c83c279b5a2c78370a4", "src/libANGLE/renderer/metal/mtl_format_table_autogen.mm": - "c1dc9a979d33e5d55285504a7cef5e7f" + "9935924d4bb57d08e1328e26deaa2514" } \ No newline at end of file diff --git a/src/libANGLE/renderer/metal/mtl_format_map.json b/src/libANGLE/renderer/metal/mtl_format_map.json index 6b8944ab5..41c58d589 100644 --- a/src/libANGLE/renderer/metal/mtl_format_map.json +++ b/src/libANGLE/renderer/metal/mtl_format_map.json @@ -707,6 +707,15 @@ } }, "caps_ios_platform": { + "MTLPixelFormatDepth16Unorm":{ + "filterable": "true", + "writable": "false", + "blendable": "false", + "multisample": "true", + "resolve": "supportDepthAutoResolve", + "colorRenderable": "false", + "depthRenderable": "true" + }, "MTLPixelFormatR8Unorm_sRGB":{ "filterable": "display->supportsAppleGPUFamily(1)", "writable": "display->supportsAppleGPUFamily(2)", diff --git a/src/libANGLE/renderer/metal/mtl_format_table_autogen.mm b/src/libANGLE/renderer/metal/mtl_format_table_autogen.mm index 15d1367f2..a0ab53960 100644 --- a/src/libANGLE/renderer/metal/mtl_format_table_autogen.mm +++ b/src/libANGLE/renderer/metal/mtl_format_table_autogen.mm @@ -4006,6 +4006,11 @@ void FormatTable::initNativeFormatCapsAutogen(const DisplayMtl *display) /** colorRenderable*/ display->supportsAppleGPUFamily(1), /** depthRenderable*/ false); + setFormatCaps(MTLPixelFormatDepth16Unorm, /** filterable*/ true, /** writable*/ false, + /** blendable*/ false, /** multisample*/ true, + /** resolve*/ supportDepthAutoResolve, /** colorRenderable*/ false, + /** depthRenderable*/ true); + setFormatCaps(MTLPixelFormatEAC_R11Snorm, /** filterable*/ display->supportsAppleGPUFamily(1), /** writable*/ false, /** blendable*/ false, /** multisample*/ false, /** resolve*/ false, /** colorRenderable*/ false, /** depthRenderable*/ false);