Key the format tables on internal format and type.
Keying the format tables on internal format alone is not enough to fully
validate the unsized formats which require additional type information.
This CL has no functional changes, it just splits the tables and updates
the calls to GetInternalFormat info to provide type information when the
format is not sized.
BUG=angleproject:1523
BUG=angleproject:1958
BUG=angleproject:1228
Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7
Reviewed-on: https://chromium-review.googlesource.com/468449
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/renderer_utils.cpp b/src/libANGLE/renderer/renderer_utils.cpp
index cc04dbb..9d0bf0e 100644
--- a/src/libANGLE/renderer/renderer_utils.cpp
+++ b/src/libANGLE/renderer/renderer_utils.cpp
@@ -187,7 +187,7 @@
inputPitch = -inputPitch;
}
- const auto &sourceGLInfo = gl::GetInternalFormatInfo(sourceFormat.glInternalFormat);
+ const auto &sourceGLInfo = gl::GetSizedInternalFormatInfo(sourceFormat.glInternalFormat);
if (sourceGLInfo.format == params.format && sourceGLInfo.type == params.type)
{
@@ -200,13 +200,12 @@
return;
}
- ASSERT(sourceGLInfo.pixelBytes > 0);
+ ASSERT(sourceGLInfo.sized);
gl::FormatType formatType(params.format, params.type);
ColorCopyFunction fastCopyFunc =
GetFastCopyFunction(sourceFormat.fastCopyFunctions, formatType);
- GLenum sizedDestInternalFormat = gl::GetSizedInternalFormat(formatType.format, formatType.type);
- const auto &destFormatInfo = gl::GetInternalFormatInfo(sizedDestInternalFormat);
+ const auto &destFormatInfo = gl::GetInternalFormatInfo(formatType.format, formatType.type);
if (fastCopyFunc)
{