Add fixes & test for isConfigTexturable and isConfigRenderable
This CL fixes:
isConfigTexturable was returning true for:
kRG_float for ANGLE ES2 configs
isConfigRenderable was returning true for:
kAlpha_8 for ANGLE ES2 configs
isConfigTexturable and isConfigRenderable were returning true for:
SBGRA on ES2
The NexusPlayer was marking RGBA & RG float configs as renderable but not textureable
Bug: 720325
Change-Id: If21361870dbdde8f3e09bc9dff3a394f2a329157
Reviewed-on: https://skia-review.googlesource.com/17387
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 9115dae..0e5ccf0 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -318,10 +318,11 @@
if (SkToBool(VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT & vkFlags) &&
SkToBool(VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT & vkFlags)) {
*flags = *flags | kTextureable_Flag;
- }
- if (SkToBool(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT & vkFlags)) {
- *flags = *flags | kRenderable_Flag;
+ // Ganesh assumes that all renderable surfaces are also texturable
+ if (SkToBool(VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT & vkFlags)) {
+ *flags = *flags | kRenderable_Flag;
+ }
}
if (SkToBool(VK_FORMAT_FEATURE_BLIT_SRC_BIT & vkFlags)) {