Commit 1b436e07 by Alexey Knyazev Committed by Commit Bot

Metal: Implement BPTC support

Use autogen for setting compressed format caps. Bug: angleproject:2634 Change-Id: I8cfb57390751615c08f798f223f4db3deed2fff6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2411979Reviewed-by: 's avatarLe Hoang Quyen <le.hoang.q@gmail.com> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent e56ccc49
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"src/libANGLE/renderer/metal/gen_mtl_format_table.py": "src/libANGLE/renderer/metal/gen_mtl_format_table.py":
"91579339b484425ef81b0e900a5c04ed", "91579339b484425ef81b0e900a5c04ed",
"src/libANGLE/renderer/metal/mtl_format_map.json": "src/libANGLE/renderer/metal/mtl_format_map.json":
"b4f515e08814b5a0f148a049139d8392", "0ef0eef6ce842b9439bfa1cc68b3fb77",
"src/libANGLE/renderer/metal/mtl_format_table_autogen.mm": "src/libANGLE/renderer/metal/mtl_format_table_autogen.mm":
"6a8cdb5d09a6ba1521fe9dab3b887451" "1f563eeba716d013ef39af6937576591"
} }
\ No newline at end of file
...@@ -115,7 +115,11 @@ ...@@ -115,7 +115,11 @@
"BC4_RED_UNORM_BLOCK": "MTLPixelFormatBC4_RUnorm", "BC4_RED_UNORM_BLOCK": "MTLPixelFormatBC4_RUnorm",
"BC4_RED_SNORM_BLOCK": "MTLPixelFormatBC4_RSnorm", "BC4_RED_SNORM_BLOCK": "MTLPixelFormatBC4_RSnorm",
"BC5_RG_UNORM_BLOCK": "MTLPixelFormatBC5_RGUnorm", "BC5_RG_UNORM_BLOCK": "MTLPixelFormatBC5_RGUnorm",
"BC5_RG_SNORM_BLOCK": "MTLPixelFormatBC5_RGSnorm" "BC5_RG_SNORM_BLOCK": "MTLPixelFormatBC5_RGSnorm",
"BPTC_RGB_UNSIGNED_FLOAT_BLOCK": "MTLPixelFormatBC6H_RGBUfloat",
"BPTC_RGB_SIGNED_FLOAT_BLOCK": "MTLPixelFormatBC6H_RGBFloat",
"BPTC_RGBA_UNORM_BLOCK": "MTLPixelFormatBC7_RGBAUnorm",
"BPTC_SRGB_ALPHA_UNORM_BLOCK": "MTLPixelFormatBC7_RGBAUnorm_sRGB"
}, },
"override": { "override": {
"L8_UNORM": "R8G8B8A8_UNORM", "L8_UNORM": "R8G8B8A8_UNORM",
...@@ -581,6 +585,48 @@ ...@@ -581,6 +585,48 @@
"resolve": "supportDepthStencilAutoResolve", "resolve": "supportDepthStencilAutoResolve",
"colorRenderable": "false", "colorRenderable": "false",
"depthRenderable": "display->supportsMacGPUFamily(1)" "depthRenderable": "display->supportsMacGPUFamily(1)"
},
"MTLPixelFormatBC1_RGBA":{
"filterable": "true"
},
"MTLPixelFormatBC1_RGBA_sRGB":{
"filterable": "true"
},
"MTLPixelFormatBC2_RGBA":{
"filterable": "true"
},
"MTLPixelFormatBC2_RGBA_sRGB":{
"filterable": "true"
},
"MTLPixelFormatBC3_RGBA":{
"filterable": "true"
},
"MTLPixelFormatBC3_RGBA_sRGB":{
"filterable": "true"
},
"MTLPixelFormatBC4_RUnorm":{
"filterable": "true"
},
"MTLPixelFormatBC4_RSnorm":{
"filterable": "true"
},
"MTLPixelFormatBC5_RGUnorm":{
"filterable": "true"
},
"MTLPixelFormatBC5_RGSnorm":{
"filterable": "true"
},
"MTLPixelFormatBC6H_RGBUfloat":{
"filterable": "true"
},
"MTLPixelFormatBC6H_RGBFloat":{
"filterable": "true"
},
"MTLPixelFormatBC7_RGBAUnorm":{
"filterable": "true"
},
"MTLPixelFormatBC7_RGBAUnorm_sRGB":{
"filterable": "true"
} }
}, },
"caps_ios": { "caps_ios": {
...@@ -615,6 +661,60 @@ ...@@ -615,6 +661,60 @@
"multisample": "true", "multisample": "true",
"resolve": "true", "resolve": "true",
"colorRenderable": "true" "colorRenderable": "true"
},
"MTLPixelFormatPVRTC_RGB_4BPP":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGB_2BPP":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGBA_4BPP":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGBA_2BPP":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGB_2BPP_sRGB":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGB_4BPP_sRGB":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGBA_2BPP_sRGB":{
"filterable": "true"
},
"MTLPixelFormatPVRTC_RGBA_4BPP_sRGB":{
"filterable": "true"
},
"MTLPixelFormatETC2_RGB8":{
"filterable": "true"
},
"MTLPixelFormatETC2_RGB8_sRGB":{
"filterable": "true"
},
"MTLPixelFormatETC2_RGB8A1":{
"filterable": "true"
},
"MTLPixelFormatETC2_RGB8A1_sRGB":{
"filterable": "true"
},
"MTLPixelFormatEAC_RGBA8":{
"filterable": "true"
},
"MTLPixelFormatEAC_RGBA8_sRGB":{
"filterable": "true"
},
"MTLPixelFormatEAC_R11Unorm":{
"filterable": "true"
},
"MTLPixelFormatEAC_R11Snorm":{
"filterable": "true"
},
"MTLPixelFormatEAC_RG11Unorm":{
"filterable": "true"
},
"MTLPixelFormatEAC_RG11Snorm":{
"filterable": "true"
} }
} }
}, },
......
...@@ -263,35 +263,6 @@ void FormatTable::setCompressedFormatCaps(MTLPixelFormat formatId, bool filterab ...@@ -263,35 +263,6 @@ void FormatTable::setCompressedFormatCaps(MTLPixelFormat formatId, bool filterab
void FormatTable::initNativeFormatCaps(const DisplayMtl *display) void FormatTable::initNativeFormatCaps(const DisplayMtl *display)
{ {
initNativeFormatCapsAutogen(display); initNativeFormatCapsAutogen(display);
#if TARGET_OS_OSX || TARGET_OS_MACCATALYST
setCompressedFormatCaps(MTLPixelFormatBC1_RGBA, true);
setCompressedFormatCaps(MTLPixelFormatBC1_RGBA_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatBC2_RGBA, true);
setCompressedFormatCaps(MTLPixelFormatBC2_RGBA_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatBC3_RGBA, true);
setCompressedFormatCaps(MTLPixelFormatBC3_RGBA_sRGB, true);
#else
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGB_2BPP, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGB_2BPP_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGB_4BPP, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGB_4BPP_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGBA_2BPP, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGBA_2BPP_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGBA_4BPP, true);
setCompressedFormatCaps(MTLPixelFormatPVRTC_RGBA_4BPP_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatEAC_R11Unorm, true);
setCompressedFormatCaps(MTLPixelFormatEAC_R11Snorm, true);
setCompressedFormatCaps(MTLPixelFormatEAC_RG11Unorm, true);
setCompressedFormatCaps(MTLPixelFormatEAC_RG11Snorm, true);
setCompressedFormatCaps(MTLPixelFormatEAC_RGBA8, true);
setCompressedFormatCaps(MTLPixelFormatEAC_RGBA8_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatETC2_RGB8, true);
setCompressedFormatCaps(MTLPixelFormatETC2_RGB8_sRGB, true);
setCompressedFormatCaps(MTLPixelFormatETC2_RGB8A1, true);
setCompressedFormatCaps(MTLPixelFormatETC2_RGB8A1_sRGB, true);
#endif
// clang-format on
} }
} // namespace mtl } // namespace mtl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment