Skip fp16 buffers for GPUs that don't support fp16 textures.
Bug: b/192518252
Test: I have no way to test this, on adt3 device, but it boots on R4 device.
Change-Id: I6340aab0aaeb6c2eea44f29735d90db20c25c6d1
diff --git a/libs/renderengine/skia/Cache.cpp b/libs/renderengine/skia/Cache.cpp
index 34577da..d9d2496 100644
--- a/libs/renderengine/skia/Cache.cpp
+++ b/libs/renderengine/skia/Cache.cpp
@@ -313,7 +313,13 @@
// The majority of shaders are related to sampling images.
// These need to be generated with various source textures
- for (auto texture : {srcTexture, externalTexture, f16ExternalTexture}) {
+ // The F16 texture may not be usable on all devices, so check first that it was created with
+ // the requested usage bit.
+ auto textures = {srcTexture, externalTexture};
+ auto texturesWithF16 = {srcTexture, externalTexture, f16ExternalTexture};
+ bool canUsef16 = f16ExternalBuffer->getUsage() & GRALLOC_USAGE_HW_TEXTURE;
+
+ for (auto texture : canUsef16 ? texturesWithF16 : textures) {
drawImageLayers(renderengine, display, dstTexture, texture);
// Draw layers for b/185569240.
drawClippedLayers(renderengine, display, dstTexture, texture);