Add frontend for ANDROID_extension_pack_es31a

- Add entry to registry_xml file
- Add handling in the DirectiveHandler

Bug: angleproject:3608
Change-Id: I1cc32a4a97fd9974f65786a9a972b4b541abf658
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3388405
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Brandon Schade <b.schade@samsung.com>
This commit is contained in:
Brandon Schade 2022-01-13 12:09:20 -08:00 коммит произвёл Angle LUCI CQ
Родитель 28f223acb4
Коммит 7dda50fc00
25 изменённых файлов: 127 добавлений и 21 удалений

Просмотреть файл

@ -71,6 +71,7 @@ using data from registry_xml.py and gl.xml.
| [GL_NV_EGL_stream_consumer_external](https://khronos.org/registry/OpenGL/extensions/NV/NV_EGL_stream_consumer_external.txt) | | | | | | |
| [GL_OES_EGL_sync](https://khronos.org/registry/OpenGL/extensions/OES/OES_EGL_sync.txt) | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; |
| [GL_OES_element_index_uint](https://khronos.org/registry/OpenGL/extensions/OES/OES_element_index_uint.txt) | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; |
| [GL_ANDROID_extension_pack_es31a](https://khronos.org/registry/OpenGL/extensions/ANDROID/ANDROID_extension_pack_es31a.txt) | | | | | | |
| [GL_EXT_external_buffer](https://khronos.org/registry/OpenGL/extensions/EXT/EXT_external_buffer.txt) | | | | | | &#x2714; |
| [GL_OES_fbo_render_mipmap](https://khronos.org/registry/OpenGL/extensions/OES/OES_fbo_render_mipmap.txt) | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; |
| [GL_NV_fence](https://khronos.org/registry/OpenGL/extensions/NV/NV_fence.txt) | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; | &#x2714; |

Просмотреть файл

@ -26,7 +26,7 @@
// Version number for shader translation API.
// It is incremented every time the API changes.
#define ANGLE_SH_VERSION 268
#define ANGLE_SH_VERSION 269
enum ShShaderSpec
{
@ -416,6 +416,7 @@ struct ShBuiltInResources
int EXT_clip_cull_distance;
int EXT_primitive_bounding_box;
int ANGLE_base_vertex_base_instance_shader_builtin;
int ANDROID_extension_pack_es31a;
// Set to 1 to enable replacing GL_EXT_draw_buffers #extension directives
// with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate

Просмотреть файл

@ -1,6 +1,6 @@
{
"doc/ExtensionSupport.md":
"d8c6c1f870a8c2cbac53fea3f2eb7439",
"29902812db94a55b4067fb526ce36be6",
"scripts/cl.xml":
"f923201d4ea3e1130763b19fa7faa7a2",
"scripts/egl.xml":
@ -26,13 +26,13 @@
"scripts/gl_angle_ext.xml":
"474989440f980a079935dff3ab4d7b24",
"scripts/registry_xml.py":
"838b5d91a4fe140b06b1a33341ff6272",
"c7e68268b6cfea2c705d273863ecce74",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/libANGLE/gen_extensions.py":
"186e7b22cb560bf4f32e2b1b8a025dd8",
"src/libANGLE/gles_extensions_autogen.cpp":
"010570a5d57c47700cb4d5f1efc3415a",
"0ca4b30896452e67bd9faea06adb3695",
"src/libANGLE/gles_extensions_autogen.h":
"e736895597b454b71655f89de808c73c"
"c167818862bb1a2b1f4ae445926da6bc"
}

Просмотреть файл

@ -12,7 +12,7 @@
"scripts/gl_angle_ext.xml":
"474989440f980a079935dff3ab4d7b24",
"scripts/registry_xml.py":
"838b5d91a4fe140b06b1a33341ff6272",
"c7e68268b6cfea2c705d273863ecce74",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/libEGL/egl_loader_autogen.cpp":

Просмотреть файл

@ -16,7 +16,7 @@
"scripts/gl_angle_ext.xml":
"474989440f980a079935dff3ab4d7b24",
"scripts/registry_xml.py":
"838b5d91a4fe140b06b1a33341ff6272",
"c7e68268b6cfea2c705d273863ecce74",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/common/entry_points_enum_autogen.cpp":
@ -42,7 +42,7 @@
"src/libANGLE/Context_gles_3_2_autogen.h":
"48567dca16fd881dfe6d61fee0e3106f",
"src/libANGLE/Context_gles_ext_autogen.h":
"35576e57a1a1c3c4bb34966c29822168",
"4f435eb90e92ae5f84778353489c24f3",
"src/libANGLE/capture/capture_gles_1_0_autogen.cpp":
"7ec7ef8f779b809a45d74b97502c419b",
"src/libANGLE/capture/capture_gles_1_0_autogen.h":
@ -66,7 +66,7 @@
"src/libANGLE/capture/capture_gles_ext_autogen.cpp":
"77f385678e62ecfe5a5faea3cc8ce2a6",
"src/libANGLE/capture/capture_gles_ext_autogen.h":
"c5784a842c304d6fcd17cb4aacb6c258",
"3ca406b8b1522a83a586dfcebbab4494",
"src/libANGLE/capture/frame_capture_replay_autogen.cpp":
"e2e6419d43bc96a65b8a8e94222a910a",
"src/libANGLE/capture/frame_capture_utils_autogen.cpp":
@ -88,7 +88,7 @@
"src/libANGLE/validationES3_autogen.h":
"0147506ce91c68d8ccbca9688c7251ba",
"src/libANGLE/validationESEXT_autogen.h":
"fb356f72147121ac9688a9914db4274c",
"e961fe18f50b1dfc825fff2d3030a91f",
"src/libANGLE/validationGL1_autogen.h":
"a247dddc40418180d4b2dbefeb75f233",
"src/libANGLE/validationGL2_autogen.h":
@ -162,17 +162,17 @@
"src/libGLESv2/entry_points_gles_3_2_autogen.h":
"647f932a299cdb4726b60bbba059f0d2",
"src/libGLESv2/entry_points_gles_ext_autogen.cpp":
"b3ec2c61304be996592de8098375584f",
"03b4cd7d24b85cc74eacd49c89575abe",
"src/libGLESv2/entry_points_gles_ext_autogen.h":
"dcfca78241b89714cfe7c1e9e25eca48",
"d4c6ff6c8b1931581e3134606c2d9108",
"src/libGLESv2/libGLESv2_autogen.cpp":
"3098b8d1364055bed7251d747a861375",
"4ab4913d56589003a5a5c970c7e5158e",
"src/libGLESv2/libGLESv2_autogen.def":
"de949b21fa3730340f3653589c4e970f",
"df38a627a47cd517f32f6bf96f4c957b",
"src/libGLESv2/libGLESv2_no_capture_autogen.def":
"d1ae52a184e954c2a1325be9348c5d11",
"b3f4b764d65a571d8d9d4e926d55f4f2",
"src/libGLESv2/libGLESv2_with_capture_autogen.def":
"3bd5b53e4e8806cba619441dd8dc136d",
"884836485f319c79075d10ab5687e0c2",
"src/libOpenCL/libOpenCL_autogen.cpp":
"10849978c910dc1af5dd4f0c815d1581"
}

Просмотреть файл

@ -6,7 +6,7 @@
"scripts/gl_angle_ext.xml":
"474989440f980a079935dff3ab4d7b24",
"scripts/registry_xml.py":
"838b5d91a4fe140b06b1a33341ff6272",
"c7e68268b6cfea2c705d273863ecce74",
"src/libANGLE/capture/gl_enum_utils_autogen.cpp":
"45a1968f41cfe2d3ac0de7f1678e03dc",
"src/libANGLE/capture/gl_enum_utils_autogen.h":

Просмотреть файл

@ -12,7 +12,7 @@
"scripts/gl_angle_ext.xml":
"474989440f980a079935dff3ab4d7b24",
"scripts/registry_xml.py":
"838b5d91a4fe140b06b1a33341ff6272",
"c7e68268b6cfea2c705d273863ecce74",
"scripts/wgl.xml":
"c36001431919e1c435f1215a85f7e1db",
"src/libGL/proc_table_wgl_autogen.cpp":

Просмотреть файл

@ -220,6 +220,7 @@ angle_es_only_extensions = [
]
gles_es_only_extensions = [
"GL_ANDROID_extension_pack_es31a",
"GL_ANGLE_depth_texture",
"GL_ANGLE_translated_shader_source",
"GL_EXT_debug_label",

Просмотреть файл

@ -162,6 +162,78 @@ void TDirectiveHandler::handleExtension(const angle::pp::SourceLocation &loc,
iter->second = behaviorVal;
}
}
// All the extensions listed in the spec here:
// https://www.khronos.org/registry/OpenGL/extensions/ANDROID/ANDROID_extension_pack_es31a.txt
// are implicitly enabled when GL_ANDROID_extension_pack_es31a is enabled
if (name == "GL_ANDROID_extension_pack_es31a")
{
constexpr char kGeometryShaderExtName[] = "GL_EXT_geometry_shader";
constexpr char kTessellationShaderExtName[] = "GL_EXT_tessellation_shader";
constexpr char kGpuShader5ExtName[] = "GL_EXT_gpu_shader5";
constexpr char kTextureBufferExtName[] = "GL_EXT_texture_buffer";
constexpr char kTextureCubeMapArrayExtName[] = "GL_EXT_texture_cube_map_array";
constexpr char kSampleVariablesExtName[] = "GL_OES_sample_variables";
constexpr char kShaderMultisampleInterpolationExtName[] =
"GL_OES_shader_multisample_interpolation";
constexpr char kShaderImageAtomicExtName[] = "GL_OES_shader_image_atomic";
constexpr char kTextureStorageMultisample2dArrayExtName[] =
"GL_OES_texture_storage_multisample_2d_array";
iter = mExtensionBehavior.find(GetExtensionByName(kGeometryShaderExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(GetExtensionByName(kTessellationShaderExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(GetExtensionByName(kGpuShader5ExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(GetExtensionByName(kTextureBufferExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(GetExtensionByName(kTextureCubeMapArrayExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(GetExtensionByName(kSampleVariablesExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter =
mExtensionBehavior.find(GetExtensionByName(kShaderMultisampleInterpolationExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(GetExtensionByName(kShaderImageAtomicExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
iter = mExtensionBehavior.find(
GetExtensionByName(kTextureStorageMultisample2dArrayExtName));
if (iter != mExtensionBehavior.end())
{
iter->second = behaviorVal;
}
}
// EXT_shader_io_blocks is implicitly enabled when EXT_geometry_shader or
// EXT_tessellation_shader is enabled.
if (name == "GL_EXT_geometry_shader" || name == "GL_EXT_tessellation_shader")

Просмотреть файл

@ -13,6 +13,7 @@
#include <string.h>
#define LIST_EXTENSIONS(OP) \
OP(ANDROID_extension_pack_es31a) \
OP(ANGLE_base_vertex_base_instance_shader_builtin) \
OP(ANGLE_multi_draw) \
OP(ANGLE_texture_multisample) \

Просмотреть файл

@ -19,6 +19,7 @@ enum class TExtension : uint8_t
{
UNDEFINED, // Special value used to indicate no extension.
ANDROID_extension_pack_es31a,
ANGLE_base_vertex_base_instance_shader_builtin,
ANGLE_multi_draw,
ANGLE_texture_multisample,

Просмотреть файл

@ -177,6 +177,10 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
extBehavior[TExtension::EXT_clip_cull_distance] = EBhUndefined;
}
if (resources.ANDROID_extension_pack_es31a)
{
extBehavior[TExtension::ANDROID_extension_pack_es31a] = EBhUndefined;
}
}
void ResetExtensionBehavior(const ShBuiltInResources &resources,

Просмотреть файл

@ -183,6 +183,9 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const State &state, egl::Disp
mResources.OES_sample_variables = extensions.sampleVariablesOES;
mResources.MaxSamples = caps.maxSamples;
// ANDROID_extension_pack_es31a
mResources.ANDROID_extension_pack_es31a = extensions.extensionPackEs31aANDROID;
// GLSL ES 3.1 constants
mResources.MaxProgramTextureGatherOffset = caps.maxProgramTextureGatherOffset;
mResources.MinProgramTextureGatherOffset = caps.minProgramTextureGatherOffset;

Просмотреть файл

@ -3499,6 +3499,7 @@ Extensions Context::generateSupportedExtensions() const
supportedExtensions.geometryShaderEXT = false;
supportedExtensions.geometryShaderOES = false;
supportedExtensions.tessellationShaderEXT = false;
supportedExtensions.extensionPackEs31aANDROID = false;
// TODO(http://anglebug.com/2775): Multisample arrays could be supported on ES 3.0 as well
// once 2D multisample texture extension is exposed there.

Просмотреть файл

@ -47,6 +47,7 @@
\
/* GLES2+ Extensions */ \
\
/* GL_ANDROID_extension_pack_es31a */ \
/* GL_ANGLE_depth_texture */ \
/* GL_ANGLE_framebuffer_blit */ \
/* GL_ANGLE_instanced_arrays */ \

Просмотреть файл

@ -19,6 +19,8 @@ namespace gl
// Method Captures
// GL_ANDROID_extension_pack_es31a
// GL_ANGLE_base_vertex_base_instance
angle::CallCapture CaptureDrawArraysInstancedBaseInstanceANGLE(const State &glState,
bool isCallValid,

Просмотреть файл

@ -87,6 +87,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_NV_EGL_stream_consumer_external"] = enableableExtension(&Extensions::EGLStreamConsumerExternalNV);
map["GL_OES_EGL_sync"] = esOnlyExtension(&Extensions::EGLSyncOES);
map["GL_OES_element_index_uint"] = enableableExtension(&Extensions::elementIndexUintOES);
map["GL_ANDROID_extension_pack_es31a"] = esOnlyExtension(&Extensions::extensionPackEs31aANDROID);
map["GL_EXT_external_buffer"] = enableableExtension(&Extensions::externalBufferEXT);
map["GL_OES_fbo_render_mipmap"] = enableableExtension(&Extensions::fboRenderMipmapOES);
map["GL_NV_fence"] = esOnlyExtension(&Extensions::fenceNV);

Просмотреть файл

@ -214,6 +214,9 @@ struct Extensions
// GL_OES_element_index_uint
bool elementIndexUintOES = false;
// GL_ANDROID_extension_pack_es31a
bool extensionPackEs31aANDROID = false;
// GL_EXT_external_buffer
bool externalBufferEXT = false;

Просмотреть файл

@ -18,6 +18,8 @@ namespace gl
{
class Context;
// GL_ANDROID_extension_pack_es31a
// GL_ANGLE_base_vertex_base_instance
bool ValidateDrawArraysInstancedBaseInstanceANGLE(const Context *context,
angle::EntryPoint entryPoint,

Просмотреть файл

@ -36,6 +36,8 @@ using namespace gl;
extern "C" {
// GL_ANDROID_extension_pack_es31a
// GL_ANGLE_base_vertex_base_instance
void GL_APIENTRY GL_DrawArraysInstancedBaseInstanceANGLE(GLenum mode,
GLint first,

Просмотреть файл

@ -20,6 +20,8 @@
extern "C" {
// GL_ANDROID_extension_pack_es31a
// GL_ANGLE_base_vertex_base_instance
ANGLE_EXPORT void GL_APIENTRY GL_DrawArraysInstancedBaseInstanceANGLE(GLenum mode,
GLint first,

Просмотреть файл

@ -2713,6 +2713,8 @@ void GL_APIENTRY glVertexPointer(GLint size, GLenum type, GLsizei stride, const
return GL_VertexPointer(size, type, stride, pointer);
}
// GL_ANDROID_extension_pack_es31a
// GL_ANGLE_base_vertex_base_instance
void GL_APIENTRY glDrawArraysInstancedBaseInstanceANGLE(GLenum mode,
GLint first,

Просмотреть файл

@ -460,6 +460,8 @@ EXPORTS
glTranslatex
glVertexPointer
; GL_ANDROID_extension_pack_es31a
; GL_ANGLE_base_vertex_base_instance
glDrawArraysInstancedBaseInstanceANGLE
glDrawElementsInstancedBaseVertexBaseInstanceANGLE

Просмотреть файл

@ -460,6 +460,8 @@ EXPORTS
glTranslatex
glVertexPointer
; GL_ANDROID_extension_pack_es31a
; GL_ANGLE_base_vertex_base_instance
glDrawArraysInstancedBaseInstanceANGLE
glDrawElementsInstancedBaseVertexBaseInstanceANGLE

Просмотреть файл

@ -460,6 +460,8 @@ EXPORTS
glTranslatex
glVertexPointer
; GL_ANDROID_extension_pack_es31a
; GL_ANGLE_base_vertex_base_instance
glDrawArraysInstancedBaseInstanceANGLE
glDrawElementsInstancedBaseVertexBaseInstanceANGLE