Revert "Add Ganesh support for RGBA_16161616 and RG_half"
This reverts commit 156622513ffc385bb493eda8d4cf5cbed19350d1.
Reason for revert: valgrind
Original change's description:
> Add Ganesh support for RGBA_16161616 and RG_half
>
> Change-Id: Ia424ff719c5fb8d1842a909ade09ad6f5f78f21f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219998
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,robertphillips@google.com
Change-Id: I7a8e99e70f575fb301ce289d9a04ebbec25b934b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220739
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/include/private/GrTypesPriv.h b/include/private/GrTypesPriv.h
index b2aed34..4d187ea 100644
--- a/include/private/GrTypesPriv.h
+++ b/include/private/GrTypesPriv.h
@@ -59,14 +59,12 @@
kRGBA_half_GrPixelConfig,
kRGBA_half_Clamped_GrPixelConfig,
kRGB_ETC1_GrPixelConfig,
+
+ // Experimental (for P016 and P010)
kR_16_GrPixelConfig,
kRG_1616_GrPixelConfig,
- // Experimental (for Y416 and mutant P016/P010)
- kRGBA_16161616_GrPixelConfig,
- kRG_half_GrPixelConfig,
-
- kLast_GrPixelConfig = kRG_half_GrPixelConfig
+ kLast_GrPixelConfig = kRG_1616_GrPixelConfig
};
static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
@@ -691,12 +689,10 @@
kInt_GrVertexAttribType,
kUint_GrVertexAttribType,
+ // Experimental (for P016 and P010)
kUShort_norm_GrVertexAttribType,
- // Experimental (for Y416)
- kUShort4_norm_GrVertexAttribType, // vector of 4 unsigned shorts. 0 -> 0.0f, 65535 -> 1.0f.
-
- kLast_GrVertexAttribType = kUShort4_norm_GrVertexAttribType
+ kLast_GrVertexAttribType = kUShort_norm_GrVertexAttribType
};
static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
@@ -902,11 +898,9 @@
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
case kRGB_ETC1_GrPixelConfig:
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
case kRG_1616_GrPixelConfig:
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- case kRG_half_GrPixelConfig:
return GrSRGBEncoded::kNo;
}
SK_ABORT("Invalid pixel config");
@@ -931,7 +925,6 @@
case kRG_88_GrPixelConfig:
case kAlpha_half_GrPixelConfig:
case kAlpha_half_as_Red_GrPixelConfig:
- case kR_16_GrPixelConfig:
return 2;
case kRGBA_8888_GrPixelConfig:
case kRGB_888_GrPixelConfig: // Assuming GPUs store this 4-byte aligned.
@@ -940,7 +933,6 @@
case kSRGBA_8888_GrPixelConfig:
case kSBGRA_8888_GrPixelConfig:
case kRGBA_1010102_GrPixelConfig:
- case kRG_1616_GrPixelConfig:
return 4;
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
@@ -953,10 +945,10 @@
case kRGB_ETC1_GrPixelConfig:
return 0;
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- return 8;
- case kRG_half_GrPixelConfig:
+ // Experimental (for P016 and P010)
+ case kR_16_GrPixelConfig:
+ return 2;
+ case kRG_1616_GrPixelConfig:
return 4;
}
SK_ABORT("Invalid pixel config");
@@ -974,9 +966,9 @@
case kGray_8_as_Red_GrPixelConfig:
case kRG_float_GrPixelConfig:
case kRGB_ETC1_GrPixelConfig:
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
case kRG_1616_GrPixelConfig:
- case kRG_half_GrPixelConfig: // Experimental (for mutant P016/P010)
return true;
case kAlpha_8_GrPixelConfig:
case kAlpha_8_as_Alpha_GrPixelConfig:
@@ -992,7 +984,6 @@
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
case kRGBA_float_GrPixelConfig:
- case kRGBA_16161616_GrPixelConfig: // Experimental (for Y416)
case kUnknown_GrPixelConfig:
return false;
}
@@ -1027,11 +1018,9 @@
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
case kRGB_ETC1_GrPixelConfig:
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
case kRG_1616_GrPixelConfig:
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- case kRG_half_GrPixelConfig:
return false;
}
SK_ABORT("Invalid pixel config.");
@@ -1058,9 +1047,9 @@
case kSBGRA_8888_GrPixelConfig:
case kRGBA_1010102_GrPixelConfig:
case kRGB_ETC1_GrPixelConfig:
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
case kRG_1616_GrPixelConfig:
- case kRGBA_16161616_GrPixelConfig: // Experimental (for Y416)
return false;
case kRGBA_float_GrPixelConfig:
case kRG_float_GrPixelConfig:
@@ -1068,7 +1057,6 @@
case kAlpha_half_as_Red_GrPixelConfig:
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
- case kRG_half_GrPixelConfig: // Experimental (for mutant P016/P010)
return true;
}
SK_ABORT("Invalid pixel config.");
@@ -1164,11 +1152,9 @@
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
case kRGBA_1010102_GrPixelConfig:
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
case kRG_1616_GrPixelConfig:
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- case kRG_half_GrPixelConfig:
return kMedium_GrSLPrecision;
}
SK_ABORT("Unexpected type");
@@ -1198,14 +1184,11 @@
kRGBA_F16_Clamped,
kRG_F32,
kRGBA_F32,
- kRGB_ETC1, // Not in SkColorType
+ kRGB_ETC1, // This type doesn't appear in SkColorType at all.
- kR_16, // Not in SkColorType
- kRG_1616, // Not in SkColorType
-
- // Experimental (for Y416 and mutant P016/P010)
- kRGBA_16161616, // Not in SkColorType
- kRG_half, // Not in SkColorType
+ // Experimental (for P016 and P010)
+ kR_16, // Not in SkColorType
+ kRG_1616, // Not in SkColorType
};
static inline SkColorType GrColorTypeToSkColorType(GrColorType ct) {
@@ -1226,11 +1209,9 @@
case GrColorType::kRG_F32: return kUnknown_SkColorType;
case GrColorType::kRGBA_F32: return kRGBA_F32_SkColorType;
case GrColorType::kRGB_ETC1: return kUnknown_SkColorType;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16: return kUnknown_SkColorType;
case GrColorType::kRG_1616: return kUnknown_SkColorType;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616: return kUnknown_SkColorType;
- case GrColorType::kRG_half: return kUnknown_SkColorType;
}
SK_ABORT("Invalid GrColorType");
return kUnknown_SkColorType;
@@ -1276,13 +1257,10 @@
kGreen_SkColorTypeComponentFlag;
case GrColorType::kRGBA_F32: return kRGBA_SkColorTypeComponentFlags;
case GrColorType::kRGB_ETC1: return kRGB_SkColorTypeComponentFlags;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16: return kRed_SkColorTypeComponentFlag;
case GrColorType::kRG_1616: return kRed_SkColorTypeComponentFlag |
kGreen_SkColorTypeComponentFlag;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616: return kRGBA_SkColorTypeComponentFlags;
- case GrColorType::kRG_half: return kRed_SkColorTypeComponentFlag |
- kGreen_SkColorTypeComponentFlag;
}
SK_ABORT("Invalid GrColorType");
return kUnknown_SkColorType;
@@ -1314,11 +1292,9 @@
case GrColorType::kRGBA_F16_Clamped: return 8;
case GrColorType::kRG_F32: return 8;
case GrColorType::kRGBA_F32: return 16;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16: return 2;
case GrColorType::kRG_1616: return 4;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616: return 8;
- case GrColorType::kRG_half: return 4;
}
SK_ABORT("Invalid GrColorType");
return 0;
@@ -1399,6 +1375,7 @@
case kGray_8_as_Red_GrPixelConfig:
*srgbEncoded = GrSRGBEncoded::kNo;
return GrColorType::kGray_8;
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
*srgbEncoded = GrSRGBEncoded::kNo;
return GrColorType::kR_16;
@@ -1406,13 +1383,6 @@
*srgbEncoded = GrSRGBEncoded::kNo;
return GrColorType::kRG_1616;
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- *srgbEncoded = GrSRGBEncoded::kNo;
- return GrColorType::kRGBA_16161616;
- case kRG_half_GrPixelConfig:
- *srgbEncoded = GrSRGBEncoded::kNo;
- return GrColorType::kRG_half;
}
SK_ABORT("Invalid GrPixelConfig");
return GrColorType::kUnknown;
@@ -1487,20 +1457,13 @@
return (GrSRGBEncoded::kYes == srgbEncoded) ? kUnknown_GrPixelConfig
: kRGB_ETC1_GrPixelConfig;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16:
return (GrSRGBEncoded::kYes == srgbEncoded) ? kUnknown_GrPixelConfig
: kR_16_GrPixelConfig;
case GrColorType::kRG_1616:
return (GrSRGBEncoded::kYes == srgbEncoded) ? kUnknown_GrPixelConfig
: kRG_1616_GrPixelConfig;
-
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616:
- return (GrSRGBEncoded::kYes == srgbEncoded) ? kUnknown_GrPixelConfig
- : kRGBA_16161616_GrPixelConfig;
- case GrColorType::kRG_half:
- return (GrSRGBEncoded::kYes == srgbEncoded) ? kUnknown_GrPixelConfig
- : kRG_half_GrPixelConfig;
}
SK_ABORT("Invalid GrColorType");
return kUnknown_GrPixelConfig;
diff --git a/src/gpu/GrCaps.cpp b/src/gpu/GrCaps.cpp
index 1b19d7e..adcedb6 100644
--- a/src/gpu/GrCaps.cpp
+++ b/src/gpu/GrCaps.cpp
@@ -148,11 +148,9 @@
case kRGBA_half_GrPixelConfig: return "RGBAHalf";
case kRGBA_half_Clamped_GrPixelConfig: return "RGBAHalfClamped";
case kRGB_ETC1_GrPixelConfig: return "RGBETC1";
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig: return "R16";
case kRG_1616_GrPixelConfig: return "RG1616";
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig: return "RGBA16161616";
- case kRG_half_GrPixelConfig: return "RGHalf";
}
SK_ABORT("Invalid pixel config");
return "<invalid>";
diff --git a/src/gpu/GrDataUtils.cpp b/src/gpu/GrDataUtils.cpp
index 63418a0..965251e 100644
--- a/src/gpu/GrDataUtils.cpp
+++ b/src/gpu/GrDataUtils.cpp
@@ -262,6 +262,7 @@
sk_memset64((uint64_t *) dest, rgbaHalf, width * height);
break;
}
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig: {
uint16_t r16 = SkScalarRoundToInt(colorf.fR * 65535.0f);
sk_memset16((uint16_t*) dest, r16, width * height);
@@ -276,26 +277,6 @@
sk_memset32((uint32_t*) dest, rg1616, width * height);
break;
}
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig: {
- uint64_t r16 = SkScalarRoundToInt(colorf.fR * 65535.0f);
- uint64_t g16 = SkScalarRoundToInt(colorf.fG * 65535.0f);
- uint64_t b16 = SkScalarRoundToInt(colorf.fB * 65535.0f);
- uint64_t a16 = SkScalarRoundToInt(colorf.fA * 65535.0f);
-
- uint64_t rgba16161616 = (a16 << 48) | (b16 << 32) | (g16 << 16) | r16;
- sk_memset64((uint64_t*) dest, rgba16161616, width * height);
- break;
- }
- case kRG_half_GrPixelConfig: {
- uint32_t rHalf = SkFloatToHalf(colorf.fR);
- uint32_t gHalf = SkFloatToHalf(colorf.fG);
-
- uint32_t rgHalf = (rHalf << 16) | gHalf;
-
- sk_memset32((uint32_t *) dest, rgHalf, width * height);
- break;
- }
default:
return false;
break;
diff --git a/src/gpu/GrPrimitiveProcessor.h b/src/gpu/GrPrimitiveProcessor.h
index 49b6277..a5fc8be 100644
--- a/src/gpu/GrPrimitiveProcessor.h
+++ b/src/gpu/GrPrimitiveProcessor.h
@@ -353,11 +353,9 @@
return sizeof(int32_t);
case kUint_GrVertexAttribType:
return sizeof(uint32_t);
+ // Experimental (for P016 and P010)
case kUShort_norm_GrVertexAttribType:
return sizeof(uint16_t);
- // Experimental (for Y416)
- case kUShort4_norm_GrVertexAttribType:
- return 4 * sizeof(uint16_t);
}
// GCC fails because SK_ABORT evaluates to non constexpr. clang and cl.exe think this is
// unreachable and don't complain.
diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp
index 32048c3..71113b4 100644
--- a/src/gpu/GrSurfaceContext.cpp
+++ b/src/gpu/GrSurfaceContext.cpp
@@ -72,11 +72,9 @@
case GrColorType::kRG_F32: return false;
case GrColorType::kRGBA_F32: return true;
case GrColorType::kRGB_ETC1: return false;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16: return false;
case GrColorType::kRG_1616: return false;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616: return false;
- case GrColorType::kRG_half: return false;
}
SK_ABORT("Invalid GrColorType");
return false;
@@ -110,11 +108,9 @@
case kAlpha_half_as_Red_GrPixelConfig: return false;
case kGray_8_as_Lum_GrPixelConfig: return false;
case kGray_8_as_Red_GrPixelConfig: return false;
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig: return false;
case kRG_1616_GrPixelConfig: return false;
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig: return false;
- case kRG_half_GrPixelConfig: return false;
}
SK_ABORT("Invalid GrPixelConfig");
return false;
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 5dae347..911262b 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -296,11 +296,9 @@
case kRGB_888X_GrPixelConfig:
case kRG_88_GrPixelConfig:
case kBGRA_8888_GrPixelConfig:
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
case kRG_1616_GrPixelConfig:
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- case kRG_half_GrPixelConfig:
return 0;
case kRGB_565_GrPixelConfig:
return 1;
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index d355208..462ead8 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -1977,7 +1977,6 @@
// solve many precision issues and no clients actually want this yet.
// hasFP32RenderTargets = true;
halfFPRenderTargetSupport = HalfFPRenderTargetSupport::kAll;
- rgIsTexturable = true;
} else if (ctxInfo.hasExtension("GL_EXT_color_buffer_half_float")) {
// This extension only enables half float support rendering for RGBA.
halfFPRenderTargetSupport = HalfFPRenderTargetSupport::kRGBAOnly;
@@ -2120,7 +2119,7 @@
} // No WebGL support
shaderCaps->fConfigTextureSwizzle[kRGB_ETC1_GrPixelConfig] = GrSwizzle::RGBA();
- // 16 bit formats
+ // Experimental (for P016 and P010)
{
// For desktop:
// GL 3.0 requires support for R16 & RG16
@@ -2139,21 +2138,6 @@
}
} // No WebGL support
- // For desktop:
- // GL 3.0 requires support for RGBA16
- // For ES:
- // GL_EXT_texture_norm16 adds support but it requires ES 3.1
- bool rgba16161616Supported = false;
- if (GR_IS_GR_GL(standard)) {
- if (version >= GR_GL_VER(3, 0)) {
- rgba16161616Supported = true;
- }
- } else if (GR_IS_GR_GL_ES(standard)) {
- if (version >= GR_GL_VER(3, 1) && ctxInfo.hasExtension("GL_EXT_texture_norm16")) {
- rgba16161616Supported = true;
- }
- } // No WebGL support
-
{
ConfigInfo& r16Info = fConfigTable[kR_16_GrPixelConfig];
@@ -2163,7 +2147,7 @@
r16Info.fFormats.fExternalType = GR_GL_UNSIGNED_SHORT;
r16Info.fFormatType = kNormalizedFixedPoint_FormatType;
if (r16AndRG1616Supported) {
- r16Info.fFlags = ConfigInfo::kTextureable_Flag | allRenderFlags;
+ r16Info.fFlags = ConfigInfo::kTextureable_Flag;
}
// We should only ever be sampling the R channel of this format so don't bother
// with a fancy swizzle.
@@ -2179,53 +2163,14 @@
rg1616Info.fFormats.fExternalType = GR_GL_UNSIGNED_SHORT;
rg1616Info.fFormatType = kNormalizedFixedPoint_FormatType;
if (r16AndRG1616Supported) {
- rg1616Info.fFlags = ConfigInfo::kTextureable_Flag | allRenderFlags;
+ rg1616Info.fFlags = ConfigInfo::kTextureable_Flag;
}
// We should only ever be sampling the R and G channels of this format so don't bother
// with a fancy swizzle.
shaderCaps->fConfigTextureSwizzle[kRG_1616_GrPixelConfig] = GrSwizzle::RGBA();
}
-
- // Experimental (for Y416)
- {
- ConfigInfo& rgba16161616Info = fConfigTable[kRGBA_16161616_GrPixelConfig];
-
- rgba16161616Info.fFormats.fBaseInternalFormat = GR_GL_RGBA;
- rgba16161616Info.fFormats.fSizedInternalFormat = GR_GL_RGBA16;
- rgba16161616Info.fFormats.fExternalFormat[kReadPixels_ExternalFormatUsage] = GR_GL_RGBA;
- rgba16161616Info.fFormats.fExternalType = GR_GL_UNSIGNED_SHORT;
- rgba16161616Info.fFormatType = kNormalizedFixedPoint_FormatType;
- if (rgba16161616Supported) {
- rgba16161616Info.fFlags = ConfigInfo::kTextureable_Flag | allRenderFlags;
- }
- shaderCaps->fConfigTextureSwizzle[kRGBA_16161616_GrPixelConfig] = GrSwizzle::RGBA();
- }
}
- // Experimental (for Y416 and mutant P016/P010)
- {
- ConfigInfo& rgHalf = fConfigTable[kRG_half_GrPixelConfig];
-
- rgHalf.fFormats.fBaseInternalFormat = GR_GL_RG;
- rgHalf.fFormats.fSizedInternalFormat = GR_GL_RG16F;
- rgHalf.fFormats.fExternalFormat[kReadPixels_ExternalFormatUsage] = GR_GL_RG;
- if (GR_IS_GR_GL(standard) || (GR_IS_GR_GL_ES(standard) && version >= GR_GL_VER(3, 0))) {
- rgHalf.fFormats.fExternalType = GR_GL_HALF_FLOAT;
- } else {
- rgHalf.fFormats.fExternalType = GR_GL_HALF_FLOAT_OES;
- }
- rgHalf.fFormatType = kFloat_FormatType;
- if (hasFP16Textures) {
- rgHalf.fFlags = rgIsTexturable ? ConfigInfo::kTextureable_Flag : 0;
-
- if (HalfFPRenderTargetSupport::kAll == halfFPRenderTargetSupport) {
- rgHalf.fFlags |= fpRenderFlags;
- }
- }
- // We should only ever be sampling the R and G channels of this format so don't bother
- // with a fancy swizzle.
- shaderCaps->fConfigTextureSwizzle[kRG_half_GrPixelConfig] = GrSwizzle::RGBA();
- }
// Bulk populate the texture internal/external formats here and then deal with exceptions below.
@@ -3284,19 +3229,13 @@
case GR_GL_R16F:
config = kAlpha_half_as_Red_GrPixelConfig;
break;
+ // Experimental (for P016 and P010)
case GR_GL_R16:
config = kR_16_GrPixelConfig;
break;
case GR_GL_RG16:
config = kRG_1616_GrPixelConfig;
break;
- // Experimental (for Y416 and mutant P016/P010)
- case GR_GL_RGBA16:
- config = kRGBA_16161616_GrPixelConfig;
- break;
- case GR_GL_RG16F:
- config = kRG_half_GrPixelConfig;
- break;
}
return config;
@@ -3354,16 +3293,11 @@
return GR_GL_RGBA32F == format;
case GrColorType::kRGB_ETC1:
return GR_GL_COMPRESSED_RGB8_ETC2 == format || GR_GL_COMPRESSED_ETC1_RGB8 == format;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16:
return GR_GL_R16 == format;
case GrColorType::kRG_1616:
return GR_GL_RG16 == format;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616:
- return GR_GL_RGBA16 == format;
- case GrColorType::kRG_half:
- return GR_GL_RG16F == format;
-
}
SK_ABORT("Unknown color type");
return false;
diff --git a/src/gpu/gl/GrGLDefines.h b/src/gpu/gl/GrGLDefines.h
index 5d8fac2..28b3798 100644
--- a/src/gpu/gl/GrGLDefines.h
+++ b/src/gpu/gl/GrGLDefines.h
@@ -480,7 +480,6 @@
#define GR_GL_RG16 0x822C
#define GR_GL_R16F 0x822D
#define GR_GL_R32F 0x822E
-#define GR_GL_RG16F 0x822F
/* RG sized integer formats */
#define GR_GL_RG8I 0x8237
@@ -513,7 +512,6 @@
#define GR_GL_RGBA16F 0x881A
#define GR_GL_RGBA32F 0x8814
#define GR_GL_RG32F 0x8230
-#define GR_GL_RGBA16 0x805B
/* RGBA integer sized formats */
#define GR_GL_RGBA8I 0x8D8E
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 160a0b9..811b718 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -873,7 +873,6 @@
case kAlpha_half_as_Red_GrPixelConfig:
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
- case kR_16_GrPixelConfig:
return 2;
case kRGBA_8888_GrPixelConfig:
case kRGB_888_GrPixelConfig: // We're really talking about GrColorType::kRGB_888x here.
@@ -884,16 +883,15 @@
case kRGBA_1010102_GrPixelConfig:
case kRGBA_float_GrPixelConfig:
case kRG_float_GrPixelConfig:
- case kRG_1616_GrPixelConfig:
return 4;
case kRGB_ETC1_GrPixelConfig:
case kUnknown_GrPixelConfig:
return 0;
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- return 8;
- case kRG_half_GrPixelConfig:
+ // Experimental (for P016 and P010)
+ case kR_16_GrPixelConfig:
+ return 2;
+ case kRG_1616_GrPixelConfig:
return 4;
}
SK_ABORT("Invalid pixel config");
@@ -3990,20 +3988,14 @@
case GR_GL_R16F:
*config = kAlpha_half_GrPixelConfig;
return true;
+
+ // Experimental (for P016 and P010)
case GR_GL_R16:
*config = kR_16_GrPixelConfig;
return true;
case GR_GL_RG16:
*config = kRG_1616_GrPixelConfig;
return true;
-
- // Experimental (for Y416 and mutant P016/P010)
- case GR_GL_RGBA16:
- *config = kRGBA_16161616_GrPixelConfig;
- return true;
- case GR_GL_RG16F:
- *config = kRG_half_GrPixelConfig;
- return true;
}
SK_ABORT("Unexpected config");
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index b1f989c..f50932e 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -612,7 +612,6 @@
case GR_GL_RGBA4:
case GR_GL_RG8:
case GR_GL_R16F:
- case GR_GL_R16:
return 2;
case GR_GL_RGB8:
@@ -622,7 +621,6 @@
case GR_GL_SRGB8_ALPHA8:
case GR_GL_BGRA8:
case GR_GL_RGB10_A2:
- case GR_GL_RG16:
return 4;
case GR_GL_RGBA16F:
@@ -636,11 +634,11 @@
case GR_GL_COMPRESSED_ETC1_RGB8:
return 0;
- // Experimental (for Y416 and mutant P016/P010)
- case GR_GL_RG16F:
+ // Experimental (for P016 and P010)
+ case GR_GL_R16:
+ return 2;
+ case GR_GL_RG16:
return 4;
- case GR_GL_RGBA16:
- return 8;
}
SK_ABORT("Invalid GL format");
diff --git a/src/gpu/gl/GrGLVertexArray.cpp b/src/gpu/gl/GrGLVertexArray.cpp
index 38c0254..4e6346d 100644
--- a/src/gpu/gl/GrGLVertexArray.cpp
+++ b/src/gpu/gl/GrGLVertexArray.cpp
@@ -74,10 +74,9 @@
return {false, 1, GR_GL_INT};
case kUint_GrVertexAttribType:
return {false, 1, GR_GL_UNSIGNED_INT};
+ // Experimental (for P016 and P010)
case kUShort_norm_GrVertexAttribType:
return {true, 1, GR_GL_UNSIGNED_SHORT};
- case kUShort4_norm_GrVertexAttribType:
- return {true, 4, GR_GL_UNSIGNED_SHORT};
}
SK_ABORT("Unknown vertex attrib type");
return {false, 0, 0};
diff --git a/src/gpu/mtl/GrMtlCaps.mm b/src/gpu/mtl/GrMtlCaps.mm
index 4064722..34ecb67 100644
--- a/src/gpu/mtl/GrMtlCaps.mm
+++ b/src/gpu/mtl/GrMtlCaps.mm
@@ -411,6 +411,7 @@
info = &fConfigTable[kRGBA_half_Clamped_GrPixelConfig];
info->fFlags = ConfigInfo::kAllFlags;
+ // Experimental (for P016 and P010)
// R_16 uses R16Unorm
info = &fConfigTable[kR_16_GrPixelConfig];
if (this->isMac()) {
@@ -426,20 +427,6 @@
} else {
info->fFlags = ConfigInfo::kTextureable_Flag | ConfigInfo::kRenderable_Flag;
}
-
- // Experimental (for Y416 and mutant P016/P010)
-
- // RGBA_16161616 uses RGBA16Unorm
- info = &fConfigTable[kRGBA_16161616_GrPixelConfig];
- if (this->isMac()) {
- info->fFlags = ConfigInfo::kAllFlags;
- } else {
- info->fFlags = ConfigInfo::kTextureable_Flag | ConfigInfo::kRenderable_Flag;
- }
-
- // RG_half uses RG16Float
- info = &fConfigTable[kRG_half_GrPixelConfig];
- info->fFlags = ConfigInfo::kAllFlags;
}
void GrMtlCaps::initStencilFormat(id<MTLDevice> physDev) {
@@ -575,19 +562,13 @@
case MTLPixelFormatRGB10A2Unorm:
return kRGBA_1010102_GrPixelConfig;
break;
+ // Experimental (for P016 and P010)
case MTLPixelFormatR16Unorm:
return kR_16_GrPixelConfig;
break;
case MTLPixelFormatRG16Unorm:
return kRG_1616_GrPixelConfig;
break;
- // Experimental (for Y416 and mutant P016/P010)
- case MTLPixelFormatRGBA16Unorm:
- return kRGBA_16161616_GrPixelConfig;
- break;
- case MTLPixelFormatRG16Float:
- return kRG_half_GrPixelConfig;
- break;
default:
return kUnknown_GrPixelConfig;
break;
@@ -662,15 +643,11 @@
#else
return MTLPixelFormatETC2_RGB8 == format;
#endif
+ // Experimental (for P016 and P010)
case GrColorType::kR_16:
return MTLPixelFormatR16Unorm == format;
case GrColorType::kRG_1616:
return MTLPixelFormatRG16Unorm == format;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616:
- return MTLPixelFormatRGBA16Unorm == format;
- case GrColorType::kRG_half:
- return MTLPixelFormatRG16Float == format;
}
SK_ABORT("Unknown color type");
return false;
diff --git a/src/gpu/mtl/GrMtlGpu.mm b/src/gpu/mtl/GrMtlGpu.mm
index eaf3470..8d01094 100644
--- a/src/gpu/mtl/GrMtlGpu.mm
+++ b/src/gpu/mtl/GrMtlGpu.mm
@@ -753,20 +753,13 @@
*config = kRGB_ETC1_GrPixelConfig;
return true;
#endif
+ // Experimental (for P016 and P010)
case MTLPixelFormatR16Unorm:
*config = kR_16_GrPixelConfig;
return true;
case MTLPixelFormatRG16Unorm:
*config = kRG_1616_GrPixelConfig;
return true;
-
- // Experimental (for Y416 and mutant P016/P010)
- case MTLPixelFormatRGBA16Unorm:
- *config = kRGBA_16161616_GrPixelConfig;
- return true;
- case MTLPixelFormatRG16Float:
- *config = kRG_half_GrPixelConfig;
- return true;
default:
return false;
}
diff --git a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
index 6ad4ae7..90b91ef 100644
--- a/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
+++ b/src/gpu/mtl/GrMtlPipelineStateBuilder.mm
@@ -141,11 +141,9 @@
return MTLVertexFormatInt;
case kUint_GrVertexAttribType:
return MTLVertexFormatUInt;
+ // Experimental (for P016 and P010)
case kUShort_norm_GrVertexAttribType:
return MTLVertexFormatUShortNormalized;
- // Experimental (for Y416)
- case kUShort4_norm_GrVertexAttribType:
- return MTLVertexFormatUShort4Normalized;
}
SK_ABORT("Unknown vertex attribute type");
return MTLVertexFormatInvalid;
diff --git a/src/gpu/mtl/GrMtlUtil.mm b/src/gpu/mtl/GrMtlUtil.mm
index 007abe2..5bd6222 100644
--- a/src/gpu/mtl/GrMtlUtil.mm
+++ b/src/gpu/mtl/GrMtlUtil.mm
@@ -110,14 +110,6 @@
case kRG_1616_GrPixelConfig:
*format = MTLPixelFormatRG16Unorm;
return true;
-
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- *format = MTLPixelFormatRGBA16Unorm;
- return true;
- case kRG_half_GrPixelConfig:
- *format = MTLPixelFormatRG16Float;
- return true;
}
SK_ABORT("Unexpected config");
return false;
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp
index 3534d12..5db4d45 100644
--- a/src/gpu/vk/GrVkCaps.cpp
+++ b/src/gpu/vk/GrVkCaps.cpp
@@ -85,7 +85,6 @@
case kRG_88_GrPixelConfig:
case kAlpha_half_GrPixelConfig:
case kAlpha_half_as_Red_GrPixelConfig:
- case kR_16_GrPixelConfig:
return 2;
case kRGB_888_GrPixelConfig:
return 3;
@@ -95,7 +94,6 @@
case kSRGBA_8888_GrPixelConfig:
case kSBGRA_8888_GrPixelConfig:
case kRGBA_1010102_GrPixelConfig:
- case kRG_1616_GrPixelConfig:
return 4;
case kRGBA_half_GrPixelConfig:
case kRGBA_half_Clamped_GrPixelConfig:
@@ -110,11 +108,10 @@
case kGray_8_as_Lum_GrPixelConfig:
SK_ABORT("Unsupported Vulkan pixel config");
return 0;
-
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- return 8;
- case kRG_half_GrPixelConfig:
+ // Experimental (for P016 and P010)
+ case kR_16_GrPixelConfig:
+ return 2;
+ case kRG_1616_GrPixelConfig:
return 4;
}
SK_ABORT("Invalid pixel config");
@@ -675,11 +672,9 @@
case VK_FORMAT_R32G32_SFLOAT:
case VK_FORMAT_R16G16B16A16_SFLOAT:
case VK_FORMAT_R16_SFLOAT:
+ // Experimental (for P016 and P010)
case VK_FORMAT_R16_UNORM:
case VK_FORMAT_R16G16_UNORM:
- // Experimental (for Y416 and mutant P016/P010)
- case VK_FORMAT_R16G16B16A16_UNORM:
- case VK_FORMAT_R16G16_SFLOAT:
return false;
default:
SK_ABORT("Unsupported VkFormat");
@@ -707,11 +702,10 @@
VK_FORMAT_R8G8B8A8_SRGB,
VK_FORMAT_B8G8R8A8_SRGB,
VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK,
+
+ // Experimental (for P016 and P010)
VK_FORMAT_R16_UNORM,
VK_FORMAT_R16G16_UNORM,
- // Experimental (for Y416 and mutant P016/P010)
- VK_FORMAT_R16G16B16A16_UNORM,
- VK_FORMAT_R16G16_SFLOAT,
};
const GrVkCaps::FormatInfo& GrVkCaps::getFormatInfo(VkFormat format) const {
@@ -1050,15 +1044,11 @@
return kBGRA_8888_GrPixelConfig;
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
return kRGBA_1010102_GrPixelConfig;
+ // Experimental (for P016 and P010)
case VK_FORMAT_R16_UNORM:
return kR_16_GrPixelConfig;
case VK_FORMAT_R16G16_UNORM:
return kRG_1616_GrPixelConfig;
- // Experimental (for Y416 and mutant P016/P010)
- case VK_FORMAT_R16G16B16A16_UNORM:
- return kRGBA_16161616_GrPixelConfig;
- case VK_FORMAT_R16G16_SFLOAT:
- return kRG_half_GrPixelConfig;
default:
return kUnknown_GrPixelConfig;
}
@@ -1121,15 +1111,11 @@
return VK_FORMAT_R32G32B32A32_SFLOAT == vkFormat;
case GrColorType::kRGB_ETC1:
return VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK == vkFormat;
+ // Experimental (for P016 and P010)
case GrColorType::kR_16:
return VK_FORMAT_R16_UNORM == vkFormat;
case GrColorType::kRG_1616:
return VK_FORMAT_R16G16_UNORM == vkFormat;
- // Experimental (for Y416 and mutant P016/P010)
- case GrColorType::kRGBA_16161616:
- return VK_FORMAT_R16G16B16A16_UNORM == vkFormat;
- case GrColorType::kRG_half:
- return VK_FORMAT_R16G16_SFLOAT == vkFormat;
}
SK_ABORT("Unknown color type");
return false;
diff --git a/src/gpu/vk/GrVkCaps.h b/src/gpu/vk/GrVkCaps.h
index d43f67b..3f9af35 100644
--- a/src/gpu/vk/GrVkCaps.h
+++ b/src/gpu/vk/GrVkCaps.h
@@ -218,7 +218,7 @@
SkTDArray<int> fColorSampleCounts;
};
- static const size_t kNumVkFormats = 21;
+ static const size_t kNumVkFormats = 19;
FormatInfo fFormatTable[kNumVkFormats];
const FormatInfo& getFormatInfo(VkFormat) const;
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp
index de6573f..4dd8a32 100644
--- a/src/gpu/vk/GrVkGpu.cpp
+++ b/src/gpu/vk/GrVkGpu.cpp
@@ -1822,19 +1822,13 @@
case VK_FORMAT_R16_SFLOAT:
*config = kAlpha_half_GrPixelConfig;
return true;
+ // Experimental (for P016 and P010)
case VK_FORMAT_R16_UNORM:
*config = kR_16_GrPixelConfig;
return true;
case VK_FORMAT_R16G16_UNORM:
*config = kRG_1616_GrPixelConfig;
return true;
- // Experimental (for Y416 and mutant P016/P010)
- case VK_FORMAT_R16G16B16A16_UNORM:
- *config = kRGBA_16161616_GrPixelConfig;
- return true;
- case VK_FORMAT_R16G16_SFLOAT:
- *config = kRG_half_GrPixelConfig;
- return true;
default:
return false;
}
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index 830ace4..2501f06 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -74,11 +74,9 @@
return VK_FORMAT_R32_SINT;
case kUint_GrVertexAttribType:
return VK_FORMAT_R32_UINT;
+ // Experimental (for P016 and P010)
case kUShort_norm_GrVertexAttribType:
return VK_FORMAT_R16_UNORM;
- // Experimental (for Y416)
- case kUShort4_norm_GrVertexAttribType:
- return VK_FORMAT_R16G16B16A16_UNORM;
}
SK_ABORT("Unknown vertex attrib type");
return VK_FORMAT_UNDEFINED;
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index f3ad00c..338cc3b 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -83,20 +83,13 @@
case kAlpha_half_as_Red_GrPixelConfig:
*format = VK_FORMAT_R16_SFLOAT;
return true;
+ // Experimental (for P016 and P010)
case kR_16_GrPixelConfig:
*format = VK_FORMAT_R16_UNORM;
return true;
case kRG_1616_GrPixelConfig:
*format = VK_FORMAT_R16G16_UNORM;
return true;
- // Experimental (for Y416 and mutant P016/P010)
- case kRGBA_16161616_GrPixelConfig:
- *format = VK_FORMAT_R16G16B16A16_UNORM;
- return true;
- case kRG_half_GrPixelConfig:
- *format = VK_FORMAT_R16G16_SFLOAT;
- return true;
-
}
SK_ABORT("Unexpected config");
return false;
@@ -143,15 +136,11 @@
case VK_FORMAT_R16_SFLOAT:
return kAlpha_half_GrPixelConfig == config ||
kAlpha_half_as_Red_GrPixelConfig == config;
+ // Experimental (for P016 and P010)
case VK_FORMAT_R16_UNORM:
return kR_16_GrPixelConfig == config;
case VK_FORMAT_R16G16_UNORM:
return kRG_1616_GrPixelConfig == config;
- // Experimental (for Y416 and mutant P016/P010)
- case VK_FORMAT_R16G16B16A16_UNORM:
- return kRGBA_16161616_GrPixelConfig == config;
- case VK_FORMAT_R16G16_SFLOAT:
- return kRG_half_GrPixelConfig == config;
default:
return false;
}
@@ -176,11 +165,10 @@
case VK_FORMAT_R32G32_SFLOAT:
case VK_FORMAT_R16G16B16A16_SFLOAT:
case VK_FORMAT_R16_SFLOAT:
+
+ // Experimental (for P016 and P010)
case VK_FORMAT_R16_UNORM:
case VK_FORMAT_R16G16_UNORM:
- // Experimental (for Y416 and mutant P016/P010)
- case VK_FORMAT_R16G16B16A16_UNORM:
- case VK_FORMAT_R16G16_SFLOAT:
return true;
default:
return false;
@@ -296,7 +284,6 @@
case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
case VK_FORMAT_R8G8_UNORM:
case VK_FORMAT_R16_SFLOAT:
- case VK_FORMAT_R16_UNORM:
return 2;
case VK_FORMAT_R8G8B8_UNORM:
@@ -307,7 +294,6 @@
case VK_FORMAT_B8G8R8A8_UNORM:
case VK_FORMAT_B8G8R8A8_SRGB:
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
- case VK_FORMAT_R16G16_UNORM:
return 4;
case VK_FORMAT_R16G16B16A16_SFLOAT:
@@ -320,10 +306,10 @@
case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:
return 0;
- // Experimental (for Y416 and mutant P016/P010)
- case VK_FORMAT_R16G16B16A16_UNORM:
- return 8;
- case VK_FORMAT_R16G16_SFLOAT:
+ // Experimental (for P016 and P010)
+ case VK_FORMAT_R16_UNORM:
+ return 2;
+ case VK_FORMAT_R16G16_UNORM:
return 4;
default:
diff --git a/tests/BackendAllocationTest.cpp b/tests/BackendAllocationTest.cpp
index 2861177..798ff6e 100644
--- a/tests/BackendAllocationTest.cpp
+++ b/tests/BackendAllocationTest.cpp
@@ -454,17 +454,12 @@
kRGB_ETC1_GrPixelConfig, SkColors::kRed },
{ kUnknown_SkColorType, GR_GL_COMPRESSED_ETC1_RGB8,
kRGB_ETC1_GrPixelConfig, SkColors::kRed },
+
+ // Experimental (for P016 and P010)
{ kUnknown_SkColorType, GR_GL_R16,
kR_16_GrPixelConfig, SkColors::kRed },
{ kUnknown_SkColorType, GR_GL_RG16,
- kRG_1616_GrPixelConfig, SkColors::kYellow },
-
- // Experimental (for Y416 and mutant P016/P010)
- { kUnknown_SkColorType, GR_GL_RGBA16,
- kRGBA_16161616_GrPixelConfig, SkColors::kLtGray },
- { kUnknown_SkColorType, GR_GL_RG16F,
- kRG_half_GrPixelConfig, SkColors::kYellow },
-
+ kRG_1616_GrPixelConfig, SkColors::kYellow },
};
for (auto combo : combinations) {
@@ -605,12 +600,10 @@
{ kUnknown_SkColorType, VK_FORMAT_R8G8_UNORM, { 0.5f, 0.5f, 0, 0 } },
{ kUnknown_SkColorType, VK_FORMAT_R16_SFLOAT, { 1.0f, 0, 0, 0.5f } },
{ kUnknown_SkColorType, VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, SkColors::kRed },
+
+ // Experimental (for P016 and P010)
{ kUnknown_SkColorType, VK_FORMAT_R16_UNORM, SkColors::kRed },
{ kUnknown_SkColorType, VK_FORMAT_R16G16_UNORM, SkColors::kYellow },
-
- // Experimental (for Y416 and mutant P016/P010)
- { kUnknown_SkColorType, VK_FORMAT_R16G16B16A16_UNORM, SkColors::kLtGray },
- { kUnknown_SkColorType, VK_FORMAT_R16G16_SFLOAT, SkColors::kYellow },
};
for (auto combo : combinations) {
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 87b9744..afe3f5c 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -105,12 +105,9 @@
kRGBA_half_Clamped_GrPixelConfig,
kRGB_ETC1_GrPixelConfig,
+ // Experimental (for P016 and P010)
kR_16_GrPixelConfig,
kRG_1616_GrPixelConfig,
-
- // Experimental (for Y416 and mutant P016/P010)
- kRGBA_16161616_GrPixelConfig,
- kRG_half_GrPixelConfig,
};
GR_STATIC_ASSERT(kGrPixelConfigCnt == SK_ARRAY_COUNT(configs));