Commit 6ea6f942 by Geoff Lang

Support GL_ETC1_RGB8_OES.

Passes all dEQP tests related to etc1. Reland: Updated to work with the D3D11 renderer and re-tested with chromium's gles2_conform_test. Change-Id: Id2ce1b0eb58129152f67016ce2dc3ab19208269c Reviewed-on: https://chromium-review.googlesource.com/299770Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent aa71b58c
...@@ -172,6 +172,7 @@ std::vector<std::string> Extensions::getStrings() const ...@@ -172,6 +172,7 @@ std::vector<std::string> Extensions::getStrings() const
InsertExtensionString("GL_ANGLE_texture_compression_dxt5", textureCompressionDXT5, &extensionStrings); InsertExtensionString("GL_ANGLE_texture_compression_dxt5", textureCompressionDXT5, &extensionStrings);
InsertExtensionString("GL_KHR_texture_compression_astc_hdr", textureCompressionASTCHDR, &extensionStrings); InsertExtensionString("GL_KHR_texture_compression_astc_hdr", textureCompressionASTCHDR, &extensionStrings);
InsertExtensionString("GL_KHR_texture_compression_astc_ldr", textureCompressionASTCLDR, &extensionStrings); InsertExtensionString("GL_KHR_texture_compression_astc_ldr", textureCompressionASTCLDR, &extensionStrings);
InsertExtensionString("GL_OES_compressed_ETC1_RGB8_texture", compressedETC1RGB8Texture, &extensionStrings);
InsertExtensionString("GL_EXT_sRGB", sRGB, &extensionStrings); InsertExtensionString("GL_EXT_sRGB", sRGB, &extensionStrings);
InsertExtensionString("GL_ANGLE_depth_texture", depthTextures, &extensionStrings); InsertExtensionString("GL_ANGLE_depth_texture", depthTextures, &extensionStrings);
InsertExtensionString("GL_EXT_texture_storage", textureStorage, &extensionStrings); InsertExtensionString("GL_EXT_texture_storage", textureStorage, &extensionStrings);
...@@ -397,6 +398,15 @@ static bool DetermineASTCTextureSupport(const TextureCapsMap &textureCaps) ...@@ -397,6 +398,15 @@ static bool DetermineASTCTextureSupport(const TextureCapsMap &textureCaps)
return GetFormatSupport(textureCaps, requiredFormats, true, true, false); return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
} }
// Check for GL_ETC1_RGB8_OES
static bool DetermineETC1RGB8TextureSupport(const TextureCapsMap &textureCaps)
{
std::vector<GLenum> requiredFormats;
requiredFormats.push_back(GL_ETC1_RGB8_OES);
return GetFormatSupport(textureCaps, requiredFormats, true, true, false);
}
// Check for GL_ANGLE_texture_compression_dxt5 // Check for GL_ANGLE_texture_compression_dxt5
static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps) static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps)
{ {
...@@ -452,6 +462,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) ...@@ -452,6 +462,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps); textureCompressionDXT5 = DetermineDXT5TextureSupport(textureCaps);
textureCompressionASTCHDR = DetermineASTCTextureSupport(textureCaps); textureCompressionASTCHDR = DetermineASTCTextureSupport(textureCaps);
textureCompressionASTCLDR = DetermineASTCTextureSupport(textureCaps); textureCompressionASTCLDR = DetermineASTCTextureSupport(textureCaps);
compressedETC1RGB8Texture = DetermineETC1RGB8TextureSupport(textureCaps);
sRGB = DetermineSRGBTextureSupport(textureCaps); sRGB = DetermineSRGBTextureSupport(textureCaps);
depthTextures = DetermineDepthTextureSupport(textureCaps); depthTextures = DetermineDepthTextureSupport(textureCaps);
colorBufferFloat = DetermineColorBufferFloatSupport(textureCaps); colorBufferFloat = DetermineColorBufferFloatSupport(textureCaps);
......
...@@ -81,6 +81,7 @@ struct Extensions ...@@ -81,6 +81,7 @@ struct Extensions
// GL_EXT_texture_rg // GL_EXT_texture_rg
// GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5 // GL_EXT_texture_compression_dxt1, GL_ANGLE_texture_compression_dxt3, GL_ANGLE_texture_compression_dxt5
// GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr // GL_KHR_texture_compression_astc_hdr, GL_KHR_texture_compression_astc_ldr
// GL_OES_compressed_ETC1_RGB8_texture
// GL_EXT_sRGB // GL_EXT_sRGB
// GL_ANGLE_depth_texture // GL_ANGLE_depth_texture
// GL_EXT_color_buffer_float // GL_EXT_color_buffer_float
...@@ -145,6 +146,10 @@ struct Extensions ...@@ -145,6 +146,10 @@ struct Extensions
// GL_KHR_texture_compression_astc_ldr // GL_KHR_texture_compression_astc_ldr
bool textureCompressionASTCLDR; bool textureCompressionASTCLDR;
// GL_OES_compressed_ETC1_RGB8_texture
// Implies that TextureCaps for GL_ETC1_RGB8_OES exist
bool compressedETC1RGB8Texture;
// GL_EXT_sRGB // GL_EXT_sRGB
// Implies that TextureCaps for GL_SRGB8_ALPHA8 and GL_SRGB8 exist // Implies that TextureCaps for GL_SRGB8_ALPHA8 and GL_SRGB8 exist
// TODO: Don't advertise this extension in ES3 // TODO: Don't advertise this extension in ES3
......
...@@ -466,15 +466,18 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -466,15 +466,18 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
map.insert(InternalFormatInfoPair(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_UNSIGNED_BYTE, true, RequireES<3>, NeverSupported, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_UNSIGNED_BYTE, true, RequireES<3>, NeverSupported, AlwaysSupported)));
// From GL_EXT_texture_compression_dxt1 // From GL_EXT_texture_compression_dxt1
// | Internal format | |W |H | BS |CC| Format | Type | SRGB | Supported | Renderable | Filterable | // | Internal format | |W |H | BS |CC| Format | Type | SRGB | Supported | Renderable | Filterable |
map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, CompressedFormat(4, 4, 64, 3, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT1>, NeverSupported, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB_S3TC_DXT1_EXT, CompressedFormat(4, 4, 64, 3, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT1>, NeverSupported, AlwaysSupported)));
map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, CompressedFormat(4, 4, 64, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT1>, NeverSupported, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, CompressedFormat(4, 4, 64, 4, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT1>, NeverSupported, AlwaysSupported)));
// From GL_ANGLE_texture_compression_dxt3 // From GL_ANGLE_texture_compression_dxt3
map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT5>, NeverSupported, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT5>, NeverSupported, AlwaysSupported)));
// From GL_ANGLE_texture_compression_dxt5 // From GL_ANGLE_texture_compression_dxt5
map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT5>, NeverSupported, AlwaysSupported))); map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, CompressedFormat(4, 4, 128, 4, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::textureCompressionDXT5>, NeverSupported, AlwaysSupported)));
// From GL_OES_compressed_ETC1_RGB8_texture
map.insert(InternalFormatInfoPair(GL_ETC1_RGB8_OES, CompressedFormat(4, 4, 64, 3, GL_ETC1_RGB8_OES, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::compressedETC1RGB8Texture>, NeverSupported, AlwaysSupported)));
// From KHR_texture_compression_astc_hdr // From KHR_texture_compression_astc_hdr
// | Internal format | | W | H | BS |CC| Format | Type | SRGB | Supported | Renderable | Filterable | // | Internal format | | W | H | BS |CC| Format | Type | SRGB | Supported | Renderable | Filterable |
......
...@@ -351,6 +351,9 @@ const D3D11ES3FormatMap &BuildD3D11FormatMap() ...@@ -351,6 +351,9 @@ const D3D11ES3FormatMap &BuildD3D11FormatMap()
InsertD3D11FormatInfo(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, OnlyFL10Plus); InsertD3D11FormatInfo(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, OnlyFL10Plus);
InsertD3D11FormatInfo(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, OnlyFL10Plus); InsertD3D11FormatInfo(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, OnlyFL10Plus);
// From GL_ETC1_RGB8_OES
InsertD3D11FormatInfo(&map, GL_ETC1_RGB8_OES, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, AnyDevice);
// From GL_EXT_texture_compression_dxt1 // From GL_EXT_texture_compression_dxt1
InsertD3D11FormatInfo(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, AnyDevice); InsertD3D11FormatInfo(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, AnyDevice);
InsertD3D11FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, AnyDevice); InsertD3D11FormatInfo(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, AnyDevice);
......
...@@ -219,6 +219,9 @@ const D3D11LoadFunctionMap &BuildD3D11LoadFunctionMap() ...@@ -219,6 +219,9 @@ const D3D11LoadFunctionMap &BuildD3D11LoadFunctionMap()
InsertLoadFunction(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_UNSIGNED_BYTE, DXGI_FORMAT_R8G8B8A8_UNORM, LoadETC2RGBA8ToRGBA8 ); InsertLoadFunction(&map, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_UNSIGNED_BYTE, DXGI_FORMAT_R8G8B8A8_UNORM, LoadETC2RGBA8ToRGBA8 );
InsertLoadFunction(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_UNSIGNED_BYTE, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, LoadETC2SRGBA8ToSRGBA8); InsertLoadFunction(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_UNSIGNED_BYTE, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, LoadETC2SRGBA8ToSRGBA8);
// From GL_ETC1_RGB8_OES
InsertLoadFunction(&map, GL_ETC1_RGB8_OES, GL_UNSIGNED_BYTE, DXGI_FORMAT_R8G8B8A8_UNORM, LoadETC1RGB8ToRGBA8 );
// From GL_EXT_texture_compression_dxt1 // From GL_EXT_texture_compression_dxt1
InsertLoadFunction(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, DXGI_FORMAT_UNKNOWN, LoadCompressedToNative<4, 4, 8> ); InsertLoadFunction(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, DXGI_FORMAT_UNKNOWN, LoadCompressedToNative<4, 4, 8> );
InsertLoadFunction(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, DXGI_FORMAT_UNKNOWN, LoadCompressedToNative<4, 4, 8> ); InsertLoadFunction(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_UNSIGNED_BYTE, DXGI_FORMAT_UNKNOWN, LoadCompressedToNative<4, 4, 8> );
......
...@@ -796,6 +796,20 @@ void LoadETC2RGBA8ToRGBA8(size_t width, ...@@ -796,6 +796,20 @@ void LoadETC2RGBA8ToRGBA8(size_t width,
} // anonymous namespace } // anonymous namespace
void LoadETC1RGB8ToRGBA8(size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch)
{
LoadETC2RGB8ToRGBA8(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
outputRowPitch, outputDepthPitch, false);
}
void LoadEACR11ToR8(size_t width, void LoadEACR11ToR8(size_t width,
size_t height, size_t height,
size_t depth, size_t depth,
...@@ -935,4 +949,5 @@ void LoadETC2SRGBA8ToSRGBA8(size_t width, ...@@ -935,4 +949,5 @@ void LoadETC2SRGBA8ToSRGBA8(size_t width,
LoadETC2RGBA8ToRGBA8(width, height, depth, input, inputRowPitch, inputDepthPitch, output, LoadETC2RGBA8ToRGBA8(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
outputRowPitch, outputDepthPitch, true); outputRowPitch, outputDepthPitch, true);
} }
} // namespace rx } // namespace rx
...@@ -16,6 +16,16 @@ ...@@ -16,6 +16,16 @@
namespace rx namespace rx
{ {
void LoadETC1RGB8ToRGBA8(size_t width,
size_t height,
size_t depth,
const uint8_t *input,
size_t inputRowPitch,
size_t inputDepthPitch,
uint8_t *output,
size_t outputRowPitch,
size_t outputDepthPitch);
void LoadEACR11ToR8(size_t width, void LoadEACR11ToR8(size_t width,
size_t height, size_t height,
size_t depth, size_t depth,
......
...@@ -227,15 +227,19 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -227,15 +227,19 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), Always(), Never(), VersionOnly(3, 0), Always(), Never()); InsertFormatMapping(&map, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), Always(), Never(), VersionOnly(3, 0), Always(), Never());
// From GL_EXT_texture_compression_dxt1 // From GL_EXT_texture_compression_dxt1
// | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | Render | // | Format | OpenGL texture support | Filter | Render | OpenGL ES texture support | Filter | Render |
InsertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_EXT_texture_compression_dxt1"), Always(), Never()); InsertFormatMapping(&map, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_EXT_texture_compression_dxt1"), Always(), Never());
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_EXT_texture_compression_dxt1"), Always(), Never()); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_EXT_texture_compression_dxt1"), Always(), Never());
// From GL_ANGLE_texture_compression_dxt3 // From GL_ANGLE_texture_compression_dxt3
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_ANGLE_texture_compression_dxt3"), Always(), Never()); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_ANGLE_texture_compression_dxt3"), Always(), Never());
// From GL_ANGLE_texture_compression_dxt5 // From GL_ANGLE_texture_compression_dxt5
InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_ANGLE_texture_compression_dxt5"), Always(), Never()); InsertFormatMapping(&map, GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE, ExtsOnly("GL_EXT_texture_compression_s3tc"), Always(), Never(), ExtsOnly("GL_ANGLE_texture_compression_dxt5"), Always(), Never());
// From GL_ETC1_RGB8_OES
InsertFormatMapping(&map, GL_ETC1_RGB8_OES, VersionOrExts(4, 3, "GL_ARB_ES3_compatibility"), Always(), Never(), VersionOrExts(3, 0, "GL_ETC1_RGB8_OES"), Always(), Never());
// clang-format on // clang-format on
return map; return map;
...@@ -372,6 +376,35 @@ static GLenum GetNativeFormat(const FunctionsGL *functions, ...@@ -372,6 +376,35 @@ static GLenum GetNativeFormat(const FunctionsGL *functions,
return result; return result;
} }
static GLenum GetNativeCompressedFormat(const FunctionsGL *functions,
const WorkaroundsGL &workarounds,
GLenum format)
{
GLenum result = format;
if (functions->standard == STANDARD_GL_DESKTOP)
{
if (format == GL_ETC1_RGB8_OES)
{
// GL_ETC1_RGB8_OES is not available in any desktop GL extension but the compression
// format is forwards compatible so just use the ETC2 format.
result = GL_COMPRESSED_RGB8_ETC2;
}
}
if (functions->isAtLeastGLES(gl::Version(3, 0)))
{
if (format == GL_ETC1_RGB8_OES)
{
// Pass GL_COMPRESSED_RGB8_ETC2 as the target format in ES3 and higher because it
// becomes a core format.
result = GL_COMPRESSED_RGB8_ETC2;
}
}
return result;
}
static GLenum GetNativeType(const FunctionsGL *functions, static GLenum GetNativeType(const FunctionsGL *functions,
const WorkaroundsGL &workarounds, const WorkaroundsGL &workarounds,
GLenum type) GLenum type)
...@@ -429,7 +462,7 @@ CompressedTexImageFormat GetCompressedTexImageFormat(const FunctionsGL *function ...@@ -429,7 +462,7 @@ CompressedTexImageFormat GetCompressedTexImageFormat(const FunctionsGL *function
GLenum internalFormat) GLenum internalFormat)
{ {
CompressedTexImageFormat result; CompressedTexImageFormat result;
result.internalFormat = internalFormat; result.internalFormat = GetNativeCompressedFormat(functions, workarounds, internalFormat);
return result; return result;
} }
...@@ -438,7 +471,7 @@ CompressedTexSubImageFormat GetCompressedSubTexImageFormat(const FunctionsGL *fu ...@@ -438,7 +471,7 @@ CompressedTexSubImageFormat GetCompressedSubTexImageFormat(const FunctionsGL *fu
GLenum format) GLenum format)
{ {
CompressedTexSubImageFormat result; CompressedTexSubImageFormat result;
result.format = format; result.format = GetNativeCompressedFormat(functions, workarounds, format);
return result; return result;
} }
......
...@@ -152,6 +152,13 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -152,6 +152,13 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (!context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
default: default:
context->recordError(Error( context->recordError(Error(
GL_INVALID_ENUM, "internalformat is not a supported compressed internal format")); GL_INVALID_ENUM, "internalformat is not a supported compressed internal format"));
...@@ -343,6 +350,18 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, ...@@ -343,6 +350,18 @@ bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level,
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_OPERATION));
return false;
}
else
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_STENCIL_OES: case GL_DEPTH_STENCIL_OES:
if (!context->getExtensions().depthTextures) if (!context->getExtensions().depthTextures)
...@@ -495,6 +514,7 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le ...@@ -495,6 +514,7 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
case GL_ETC1_RGB8_OES:
context->recordError(Error(GL_INVALID_OPERATION)); context->recordError(Error(GL_INVALID_OPERATION));
return false; return false;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
...@@ -635,6 +655,18 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le ...@@ -635,6 +655,18 @@ bool ValidateES2CopyTexImageParameters(Context* context, GLenum target, GLint le
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_OPERATION));
return false;
}
else
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
...@@ -752,6 +784,13 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le ...@@ -752,6 +784,13 @@ bool ValidateES2TexStorageParameters(Context *context, GLenum target, GLsizei le
return false; return false;
} }
break; break;
case GL_ETC1_RGB8_OES:
if (!context->getExtensions().compressedETC1RGB8Texture)
{
context->recordError(Error(GL_INVALID_ENUM));
return false;
}
break;
case GL_RGBA32F_EXT: case GL_RGBA32F_EXT:
case GL_RGB32F_EXT: case GL_RGB32F_EXT:
case GL_ALPHA32F_EXT: case GL_ALPHA32F_EXT:
......
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