Commit cdacacdd by Geoff Lang

Add validation for unsized BGRA texture formats.

BUG=angle:620 Change-Id: I956b7fc4ed0be99239e4ed1c63b51732727cc87f Reviewed-on: https://chromium-review.googlesource.com/196840Tested-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent f67115ce
......@@ -3879,6 +3879,13 @@ void Context::initExtensionString()
if (mClientVersion == 3)
{
mExtensionStringList.push_back("GL_EXT_color_buffer_float");
mExtensionStringList.push_back("GL_EXT_read_format_bgra");
if (supportsBGRATextures())
{
mExtensionStringList.push_back("GL_EXT_texture_format_BGRA8888");
}
}
// Join the extension strings to one long string for use with GetString
......
......@@ -319,6 +319,9 @@ ES3FormatSet BuildES3FormatSet()
set.insert(FormatInfo(GL_LUMINANCE, GL_LUMINANCE, GL_HALF_FLOAT ));
set.insert(FormatInfo(GL_ALPHA, GL_ALPHA, GL_HALF_FLOAT ));
// From GL_EXT_texture_format_BGRA8888
set.insert(FormatInfo(GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE ));
// From GL_EXT_texture_storage
// | Internal format | Format | Type |
// | | | |
......@@ -332,6 +335,7 @@ ES3FormatSet BuildES3FormatSet()
set.insert(FormatInfo(GL_LUMINANCE16F_EXT, GL_LUMINANCE, GL_HALF_FLOAT ));
set.insert(FormatInfo(GL_LUMINANCE_ALPHA16F_EXT, GL_LUMINANCE_ALPHA, GL_HALF_FLOAT ));
// From GL_EXT_texture_storage and GL_EXT_texture_format_BGRA8888
set.insert(FormatInfo(GL_BGRA8_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE ));
set.insert(FormatInfo(GL_BGRA4_ANGLEX, GL_BGRA_EXT, GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT));
set.insert(FormatInfo(GL_BGRA4_ANGLEX, GL_BGRA_EXT, GL_UNSIGNED_BYTE ));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment