Commit fba5b6d7 by Alexis Hetu Committed by Alexis Hétu

Hide ASTC support

Since we don't expose the ASTC related extension string, we need to hide support for ASTC related enums. ASTC_SUPPORT was added to easily re-enable ASTC, should we want to. Change-Id: I3c65906c4729df8a2efb1a9a78e155bccdc715f9 Reviewed-on: https://swiftshader-review.googlesource.com/13749Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 1b4eb7f0
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#define S3TC_SUPPORT 0 #define S3TC_SUPPORT 0
#endif #endif
#define ASTC_SUPPORT 0
// Worker thread count when not set by SwiftConfig // Worker thread count when not set by SwiftConfig
// 0 = process affinity count (recommended) // 0 = process affinity count (recommended)
// 1 = rendering on main thread (no worker threads), useful for debugging // 1 = rendering on main thread (no worker threads), useful for debugging
......
...@@ -4363,6 +4363,10 @@ const GLubyte *Context::getExtensions(GLuint index, GLuint *numExt) const ...@@ -4363,6 +4363,10 @@ const GLubyte *Context::getExtensions(GLuint index, GLuint *numExt) const
"GL_EXT_texture_filter_anisotropic", "GL_EXT_texture_filter_anisotropic",
"GL_EXT_texture_format_BGRA8888", "GL_EXT_texture_format_BGRA8888",
"GL_EXT_texture_rg", "GL_EXT_texture_rg",
#if (ASTC_SUPPORT)
"GL_KHR_texture_compression_astc_hdr",
"GL_KHR_texture_compression_astc_ldr",
#endif
"GL_ANGLE_framebuffer_blit", "GL_ANGLE_framebuffer_blit",
"GL_ANGLE_framebuffer_multisample", "GL_ANGLE_framebuffer_multisample",
"GL_ANGLE_instanced_arrays", "GL_ANGLE_instanced_arrays",
......
...@@ -126,6 +126,7 @@ const GLenum compressedTextureFormats[] = ...@@ -126,6 +126,7 @@ const GLenum compressedTextureFormats[] =
GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC,
GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
#if (ASTC_SUPPORT)
GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR,
GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR,
GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR,
...@@ -154,7 +155,8 @@ const GLenum compressedTextureFormats[] = ...@@ -154,7 +155,8 @@ const GLenum compressedTextureFormats[] =
GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,
#endif #endif // ASTC_SUPPORT
#endif // GL_ES_VERSION_3_0
}; };
const GLenum GL_TEXTURE_FILTERING_HINT_CHROMIUM = 0x8AF0; const GLenum GL_TEXTURE_FILTERING_HINT_CHROMIUM = 0x8AF0;
......
...@@ -491,6 +491,7 @@ namespace es2 ...@@ -491,6 +491,7 @@ namespace es2
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
case GL_COMPRESSED_RGBA8_ETC2_EAC: case GL_COMPRESSED_RGBA8_ETC2_EAC:
case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
return (clientVersion >= 3) ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;
case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: case GL_COMPRESSED_RGBA_ASTC_4x4_KHR:
case GL_COMPRESSED_RGBA_ASTC_5x4_KHR: case GL_COMPRESSED_RGBA_ASTC_5x4_KHR:
case GL_COMPRESSED_RGBA_ASTC_5x5_KHR: case GL_COMPRESSED_RGBA_ASTC_5x5_KHR:
...@@ -519,7 +520,11 @@ namespace es2 ...@@ -519,7 +520,11 @@ namespace es2
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
return (clientVersion >= 3) ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM; #if(ASTC_SUPPORT)
return ((clientVersion >= 3) && ()) ? (expectCompressedFormats ? GL_NONE : GL_INVALID_OPERATION) : GL_INVALID_ENUM;
#else
return GL_INVALID_ENUM;
#endif
default: default:
return expectCompressedFormats ? GL_INVALID_ENUM : GL_NONE; // Not compressed format return expectCompressedFormats ? GL_INVALID_ENUM : GL_NONE; // Not compressed format
} }
......
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