Commit b76bf1b9 by Courtney Goeltzenleuchter Committed by Commit Bot

Refactor in preparation of adding OES_depth_texture

Rename existing depthTexture extension flag to depthTextureANGLE to distinguish it from OES depth texture extension to be added. Bug: angleproject:3103 Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTexture Change-Id: I44c69a69b925a84f931518e0374e662893813061 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575425 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f5115ed4
...@@ -174,7 +174,7 @@ Extensions::Extensions() ...@@ -174,7 +174,7 @@ Extensions::Extensions()
compressedEACRG11SignedTexture(false), compressedEACRG11SignedTexture(false),
compressedTextureETC(false), compressedTextureETC(false),
sRGB(false), sRGB(false),
depthTextures(false), depthTextureANGLE(false),
depth32(false), depth32(false),
textureStorage(false), textureStorage(false),
textureNPOT(false), textureNPOT(false),
...@@ -653,7 +653,7 @@ static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps) ...@@ -653,7 +653,7 @@ static bool DetermineSRGBTextureSupport(const TextureCapsMap &textureCaps)
} }
// Check for GL_ANGLE_depth_texture // Check for GL_ANGLE_depth_texture
static bool DetermineDepthTextureSupport(const TextureCapsMap &textureCaps) static bool DetermineDepthTextureANGLESupport(const TextureCapsMap &textureCaps)
{ {
constexpr GLenum requiredFormats[] = { constexpr GLenum requiredFormats[] = {
GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT16,
...@@ -783,7 +783,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps) ...@@ -783,7 +783,7 @@ void Extensions::setTextureExtensionSupport(const TextureCapsMap &textureCaps)
compressedEACRG11UnsignedTexture = DetermineEACRG11UnsignedTextureSupport(textureCaps); compressedEACRG11UnsignedTexture = DetermineEACRG11UnsignedTextureSupport(textureCaps);
compressedEACRG11SignedTexture = DetermineEACRG11SignedTextureSupport(textureCaps); compressedEACRG11SignedTexture = DetermineEACRG11SignedTextureSupport(textureCaps);
sRGB = DetermineSRGBTextureSupport(textureCaps); sRGB = DetermineSRGBTextureSupport(textureCaps);
depthTextures = DetermineDepthTextureSupport(textureCaps); depthTextureANGLE = DetermineDepthTextureANGLESupport(textureCaps);
depth32 = DetermineDepth32Support(textureCaps); depth32 = DetermineDepth32Support(textureCaps);
colorBufferFloatRGB = DetermineColorBufferFloatRGBSupport(textureCaps); colorBufferFloatRGB = DetermineColorBufferFloatRGBSupport(textureCaps);
colorBufferFloatRGBA = DetermineColorBufferFloatRGBASupport(textureCaps); colorBufferFloatRGBA = DetermineColorBufferFloatRGBASupport(textureCaps);
...@@ -845,7 +845,7 @@ const ExtensionInfoMap &GetExtensionInfoMap() ...@@ -845,7 +845,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["OES_compressed_EAC_RG11_signed_texture"] = enableableExtension(&Extensions::compressedEACRG11SignedTexture); map["OES_compressed_EAC_RG11_signed_texture"] = enableableExtension(&Extensions::compressedEACRG11SignedTexture);
map["GL_CHROMIUM_compressed_texture_etc"] = enableableExtension(&Extensions::compressedTextureETC); map["GL_CHROMIUM_compressed_texture_etc"] = enableableExtension(&Extensions::compressedTextureETC);
map["GL_EXT_sRGB"] = enableableExtension(&Extensions::sRGB); map["GL_EXT_sRGB"] = enableableExtension(&Extensions::sRGB);
map["GL_ANGLE_depth_texture"] = esOnlyExtension(&Extensions::depthTextures); map["GL_ANGLE_depth_texture"] = esOnlyExtension(&Extensions::depthTextureANGLE);
map["GL_OES_depth32"] = esOnlyExtension(&Extensions::depth32); map["GL_OES_depth32"] = esOnlyExtension(&Extensions::depth32);
map["GL_EXT_texture_storage"] = enableableExtension(&Extensions::textureStorage); map["GL_EXT_texture_storage"] = enableableExtension(&Extensions::textureStorage);
map["GL_OES_texture_npot"] = enableableExtension(&Extensions::textureNPOT); map["GL_OES_texture_npot"] = enableableExtension(&Extensions::textureNPOT);
......
...@@ -238,7 +238,7 @@ struct Extensions ...@@ -238,7 +238,7 @@ struct Extensions
bool sRGB; bool sRGB;
// GL_ANGLE_depth_texture // GL_ANGLE_depth_texture
bool depthTextures; bool depthTextureANGLE;
// GL_OES_depth32 // GL_OES_depth32
// Allows DEPTH_COMPONENT32_OES as a valid Renderbuffer format. // Allows DEPTH_COMPONENT32_OES as a valid Renderbuffer format.
......
...@@ -787,12 +787,12 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap() ...@@ -787,12 +787,12 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
// Depth stencil formats // Depth stencil formats
// | Internal format |sized| D |S | X | Format | Type | Component type | Texture supported | Filterable | Texture attachment | Renderbuffer | // | Internal format |sized| D |S | X | Format | Type | Component type | Texture supported | Filterable | Texture attachment | Renderbuffer |
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT16, true, 16, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, RequireESOrExt<3, 0, &Extensions::depthTextures>, RequireES<1, 0>, RequireES<1, 0> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT16, true, 16, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, GL_UNSIGNED_NORMALIZED, RequireES<1, 0>, RequireESOrExt<3, 0, &Extensions::depthTextureANGLE>, RequireES<1, 0>, RequireES<1, 0> );
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT24, true, 24, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_UNSIGNED_NORMALIZED, RequireES<3, 0>, RequireESOrExt<3, 0, &Extensions::depthTextures>, RequireES<3, 0>, RequireES<3, 0> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT24, true, 24, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_UNSIGNED_NORMALIZED, RequireES<3, 0>, RequireESOrExt<3, 0, &Extensions::depthTextureANGLE>, RequireES<3, 0>, RequireES<3, 0> );
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT32F, true, 32, 0, 0, GL_DEPTH_COMPONENT, GL_FLOAT, GL_FLOAT, RequireES<3, 0>, RequireESOrExt<3, 0, &Extensions::depthTextures>, RequireES<3, 0>, RequireES<3, 0> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT32F, true, 32, 0, 0, GL_DEPTH_COMPONENT, GL_FLOAT, GL_FLOAT, RequireES<3, 0>, RequireESOrExt<3, 0, &Extensions::depthTextureANGLE>, RequireES<3, 0>, RequireES<3, 0> );
AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT32_OES, true, 32, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_UNSIGNED_NORMALIZED, RequireExtOrExt<&Extensions::depthTextures, &Extensions::depth32>, AlwaysSupported, RequireExtOrExt<&Extensions::depthTextures, &Extensions::depth32>, RequireExtOrExt<&Extensions::depthTextures, &Extensions::depth32> ); AddDepthStencilFormat(&map, GL_DEPTH_COMPONENT32_OES, true, 32, 0, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, GL_UNSIGNED_NORMALIZED, RequireExtOrExt<&Extensions::depthTextureANGLE, &Extensions::depth32>, AlwaysSupported, RequireExtOrExt<&Extensions::depthTextureANGLE, &Extensions::depth32>, RequireExtOrExt<&Extensions::depthTextureANGLE, &Extensions::depth32> );
AddDepthStencilFormat(&map, GL_DEPTH24_STENCIL8, true, 24, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_UNSIGNED_NORMALIZED, RequireESOrExt<3, 0, &Extensions::depthTextures>, AlwaysSupported, RequireESOrExtOrExt<3, 0, &Extensions::depthTextures, &Extensions::packedDepthStencil>, RequireESOrExtOrExt<3, 0, &Extensions::depthTextures, &Extensions::packedDepthStencil>); AddDepthStencilFormat(&map, GL_DEPTH24_STENCIL8, true, 24, 8, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_UNSIGNED_NORMALIZED, RequireESOrExt<3, 0, &Extensions::depthTextureANGLE>, AlwaysSupported, RequireESOrExtOrExt<3, 0, &Extensions::depthTextureANGLE, &Extensions::packedDepthStencil>, RequireESOrExtOrExt<3, 0, &Extensions::depthTextureANGLE, &Extensions::packedDepthStencil>);
AddDepthStencilFormat(&map, GL_DEPTH32F_STENCIL8, true, 32, 8, 24, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_FLOAT, RequireES<3, 0>, AlwaysSupported, RequireES<3, 0>, RequireES<3, 0> ); AddDepthStencilFormat(&map, GL_DEPTH32F_STENCIL8, true, 32, 8, 24, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, GL_FLOAT, RequireES<3, 0>, AlwaysSupported, RequireES<3, 0>, RequireES<3, 0> );
// STENCIL_INDEX8 is special-cased, see around the bottom of the list. // STENCIL_INDEX8 is special-cased, see around the bottom of the list.
// Luminance alpha formats // Luminance alpha formats
......
...@@ -673,7 +673,7 @@ void GenerateCaps(IDirect3D9 *d3d9, ...@@ -673,7 +673,7 @@ void GenerateCaps(IDirect3D9 *d3d9,
// Disable depth texture support on AMD cards (See ANGLE issue 839) // Disable depth texture support on AMD cards (See ANGLE issue 839)
if (IsAMD(adapterId.VendorId)) if (IsAMD(adapterId.VendorId))
{ {
extensions->depthTextures = false; extensions->depthTextureANGLE = false;
} }
} }
else else
......
...@@ -732,7 +732,7 @@ bool ValidateES2CopyTexImageParameters(Context *context, ...@@ -732,7 +732,7 @@ bool ValidateES2CopyTexImageParameters(Context *context,
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
case GL_DEPTH_STENCIL_OES: case GL_DEPTH_STENCIL_OES:
case GL_DEPTH24_STENCIL8_OES: case GL_DEPTH24_STENCIL8_OES:
if (context->getExtensions().depthTextures) if (context->getExtensions().depthTextureANGLE)
{ {
context->validationError(GL_INVALID_OPERATION, kInvalidFormat); context->validationError(GL_INVALID_OPERATION, kInvalidFormat);
return false; return false;
...@@ -1497,7 +1497,7 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -1497,7 +1497,7 @@ bool ValidateES2TexImageParameters(Context *context,
break; 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().depthTextureANGLE)
{ {
context->validationError(GL_INVALID_ENUM, kEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
...@@ -1588,7 +1588,7 @@ bool ValidateES2TexImageParameters(Context *context, ...@@ -1588,7 +1588,7 @@ bool ValidateES2TexImageParameters(Context *context,
case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT:
case GL_DEPTH_STENCIL: case GL_DEPTH_STENCIL:
if (!context->getExtensions().depthTextures) if (!context->getExtensions().depthTextureANGLE)
{ {
context->validationError(GL_INVALID_ENUM, kInvalidFormat); context->validationError(GL_INVALID_ENUM, kInvalidFormat);
return false; return false;
...@@ -1884,7 +1884,7 @@ bool ValidateES2TexStorageParameters(Context *context, ...@@ -1884,7 +1884,7 @@ bool ValidateES2TexStorageParameters(Context *context,
case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT32_OES: case GL_DEPTH_COMPONENT32_OES:
case GL_DEPTH24_STENCIL8_OES: case GL_DEPTH24_STENCIL8_OES:
if (!context->getExtensions().depthTextures) if (!context->getExtensions().depthTextureANGLE)
{ {
context->validationError(GL_INVALID_ENUM, kEnumNotSupported); context->validationError(GL_INVALID_ENUM, kEnumNotSupported);
return false; return false;
......
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