summaryrefslogtreecommitdiff
path: root/chromium/third_party/angle/src/libANGLE/formatutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/angle/src/libANGLE/formatutils.cpp')
-rw-r--r--chromium/third_party/angle/src/libANGLE/formatutils.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/chromium/third_party/angle/src/libANGLE/formatutils.cpp b/chromium/third_party/angle/src/libANGLE/formatutils.cpp
index 76273f3be34..40149533119 100644
--- a/chromium/third_party/angle/src/libANGLE/formatutils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/formatutils.cpp
@@ -549,6 +549,21 @@ bool InternalFormat::isDepthOrStencil() const
return depthBits != 0 || stencilBits != 0;
}
+GLuint InternalFormat::getEGLConfigBufferSize() const
+{
+ // EGL config's EGL_BUFFER_SIZE is measured in bits and is the sum of all the color channels for
+ // color formats or the luma channels for luma formats. It ignores unused bits so compute the
+ // bit count by summing instead of using pixelBytes.
+ if (isLUMA())
+ {
+ return luminanceBits + alphaBits;
+ }
+ else
+ {
+ return redBits + greenBits + blueBits + alphaBits;
+ }
+}
+
Format::Format(GLenum internalFormat) : Format(GetSizedInternalFormatInfo(internalFormat)) {}
Format::Format(const InternalFormat &internalFormat) : info(&internalFormat) {}
@@ -1141,10 +1156,10 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
AddRGBAFormat(&map, GL_BGR10_A2_ANGLEX, true, 10, 10, 10, 2, 0, GL_BGRA_EXT, GL_UNSIGNED_INT_2_10_10_10_REV, GL_UNSIGNED_NORMALIZED, false, NeverSupported, NeverSupported, NeverSupported, NeverSupported, NeverSupported);
// Special format to emulate RGB8 with RGBA8 within ANGLE.
- AddRGBAFormat(&map, GL_RGBX8_ANGLE, true, 8, 8, 8, 0, 0, GL_RGB, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, AlwaysSupported, AlwaysSupported, AlwaysSupported, AlwaysSupported, NeverSupported);
+ AddRGBAXFormat(&map, GL_RGBX8_ANGLE, true, FB< 8, 8, 8, 0, 8, 0>(), GL_RGB, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, AlwaysSupported, AlwaysSupported, AlwaysSupported, AlwaysSupported, NeverSupported);
// Special format to emulate BGR8 with BGRA8 within ANGLE.
- AddRGBAFormat(&map, GL_BGRX8_ANGLEX, true, 8, 8, 8, 0, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, NeverSupported, AlwaysSupported, NeverSupported, NeverSupported, NeverSupported);
+ AddRGBAXFormat(&map, GL_BGRX8_ANGLEX, true, FB< 8, 8, 8, 0, 8, 0>(), GL_BGRA_EXT, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, false, NeverSupported, AlwaysSupported, NeverSupported, NeverSupported, NeverSupported);
// This format is supported on ES 2.0 with two extensions, so keep it out-of-line to not widen the table above even more.
// | Internal format |sized| R | G | B | A |S | Format | Type | Component type | SRGB | Texture supported | Filterable | Texture attachment | Renderbuffer | Blend