diff --git a/doc/ExtensionSupport.md b/doc/ExtensionSupport.md index efa6fd367..b0c3d95f1 100644 --- a/doc/ExtensionSupport.md +++ b/doc/ExtensionSupport.md @@ -182,7 +182,6 @@ using data from registry_xml.py and gl.xml. | Extension Name | NVIDIA P400 Win10 | Intel 630 Win10 | NVIDIA P400 Linux | Intel 630 Linux | SwiftShader Win10 | Pixel 4 Android 11 | | -------------- | :---------------: | :-------------: | :---------------: | :-------------: | :---------------: | :----------------: | | [GL_ANGLE_base_vertex_base_instance](https://chromium.googlesource.com/angle/angle/+/refs/heads/main/extensions/ANGLE_base_vertex_base_instance.txt) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | -| [GL_ANGLE_base_vertex_base_instance_shader_builtin](https://chromium.googlesource.com/angle/angle/+/refs/heads/main/extensions/ANGLE_base_vertex_base_instance_shader_builtin.txt) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | [GL_CHROMIUM_bind_generates_resource](https://chromium.googlesource.com/angle/angle/+/refs/heads/main/extensions/CHROMIUM_bind_generates_resource.txt) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | [GL_CHROMIUM_bind_uniform_location](https://chromium.googlesource.com/angle/angle/+/refs/heads/main/extensions/CHROMIUM_bind_uniform_location.txt) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | | [GL_ANGLE_client_arrays](https://chromium.googlesource.com/angle/angle/+/refs/heads/main/extensions/ANGLE_client_arrays.txt) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | diff --git a/extensions/ANGLE_base_vertex_base_instance.txt b/extensions/ANGLE_base_vertex_base_instance.txt index e3f43cc09..83f7a1bf2 100644 --- a/extensions/ANGLE_base_vertex_base_instance.txt +++ b/extensions/ANGLE_base_vertex_base_instance.txt @@ -24,8 +24,8 @@ Status Version - Last Modified Date: Nov 19, 2021 - Author Revision: 3 + Last Modified Date: July 14, 2020 + Author Revision: 2 Number @@ -62,6 +62,15 @@ Overview of zero, and that of the set of elements are executed and the value of advances between each set. + Additionally, and builtins are added + to the shading language. + For any *BaseVertex* draw call variant, the of the draw may be + read by the vertex shader as . For non *BaseVertex* calls, + the value of is 0. + For any *BaseInstance draw call variant, the baseInstance of the draw may + be read by the vertex shader as . For non *BaseInstance + calls, the value of is 0. + IP Status No known IP claims. @@ -117,6 +126,9 @@ Additions to Chapter 10 of the OpenGL ES 3.2 Specification Behaves identically to DrawArraysInstanced except that is passed down to DrawArraysOneInstance instead of zero. + The base index of the instance may be read by a vertex shader as + . + The command void MultiDrawArraysInstancedBaseInstanceANGLE(GLenum mode, @@ -156,6 +168,13 @@ Additions to Chapter 10 of the OpenGL ES 3.2 Specification Behaves identically to DrawElementsInstanced except that and are passed down to DrawElementsOneInstance instead of zero. + The base index of the vertex may be read by a vertex shader as + . This value is also added to the . + + The base index of the instance may be read by a vertex shader as + . Note that this value is not added to the + . + The command void MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE(GLenum mode, @@ -201,6 +220,19 @@ Errors The error INVALID_VALUE is generated by the MultiDraw* functions if is less than zero. +Modifications to the OpenGL ES Shading Language Specification, Version 3.00 + + Including the following line in a shader can be used to control the + language featured described in this extension: + + #extension GL_ANGLE_base_vertex_base_instance : + + where is as specified in section 3.5. + + A new preprocessor #define is added to the OpenGL ES Shading Language: + + #define GL_ANGLE_base_vertex_base_instance 1 + Dependencies on GL_OES_draw_elements_base_vertex and GL_EXT_draw_elements_base_vertex @@ -218,4 +250,3 @@ Revision History ---- -------- ---------- -------------------------------------------- 1 08/13/19 Shrek Shao First revision. 2 07/14/20 Shrek Shao Fix baseInstance type from GLint to GLuint. - 3 11/19/21 Shrek Shao Decouple gl_BaseVertex/gl_BaseInstance. diff --git a/extensions/ANGLE_base_vertex_base_instance_shader_builtin.txt b/extensions/ANGLE_base_vertex_base_instance_shader_builtin.txt deleted file mode 100644 index 9ce541781..000000000 --- a/extensions/ANGLE_base_vertex_base_instance_shader_builtin.txt +++ /dev/null @@ -1,137 +0,0 @@ -Name - - ANGLE_base_vertex_base_instance_shader_builtin - -Name Strings - - GL_ANGLE_base_vertex_base_instance_shader_builtin - -Contributors - - Shrek Shao, Google Inc. - Contributors to the ANGLE_base_vertex_base_instance specification - Contributors to the ARB_shader_draw_parameters specification - -Contact - - Shrek Shao (shrekshao 'at' google.com) - -Status - - Incomplete - -Version - - Last Modified Date: Nov 19, 2021 - Author Revision: 1 - -Number - - OpenGL ES Extension XX - -Dependencies - - The extension is based on ANGLE_base_vertex_base_instance, all limitations of which - apply to this extension. - -Overview - - This extension is based on ANGLE_base_vertex_base_instance. It should be enabled - only if ANGLE_base_vertex_base_instance is enabled. - - Additional to the functionality exposed by ANGLE_base_vertex_base_instance, - and builtins are added to the shading language. - For any *BaseVertex* draw call variant, the of the draw may be - read by the vertex shader as . For non *BaseVertex* calls, - the value of is 0. - For any *BaseInstance draw call variant, the baseInstance of the draw may - be read by the vertex shader as . For non *BaseInstance - calls, the value of is 0. - -IP Status - - No known IP claims. - -New Procedures and Functions - - None. - -New Tokens - - None. - -Additions to Chapter 10 of the OpenGL ES 3.2 Specification - - Section 10.5 Drawing Commands Using Vertex Arrays: - - The base index of the instance may be read by a vertex shader as - , for the commands - - void DrawArraysInstancedBaseInstanceANGLE (GLenum mode, - GLint first, - GLsizei count, - GLsizei instanceCount, - GLuint baseInstance); - - and - - void MultiDrawArraysInstancedBaseInstanceANGLE(GLenum mode, - const GLint* firsts, - const GLsizei* counts, - const GLsizei* instanceCounts, - const GLuint* baseInstances, - GLsizei drawcount); - - The base index of the vertex may be read by a vertex shader as - . This value is also added to the . - - The base index of the instance may be read by a vertex shader as - . Note that this value is not added to the - , for the commands - - void DrawElementsInstancedBaseVertexBaseInstanceANGLE (GLenum mode, - GLsizei count, - GLenum type, - const GLvoid* indices, - GLsizei instanceCount, - GLint baseVertex, - GLuint baseInstance); - - and - - void MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE(GLenum mode, - const GLsizei* counts, - GLenum type, - const GLvoid* const* indices, - const GLsizei* instanceCounts, - const GLint* baseVertices, - const GLuint* baseInstances, - GLsizei drawcount); - -Errors - - None. - -Modifications to the OpenGL ES Shading Language Specification, Version 3.00 - - Including the following line in a shader controls the - language featured described in this extension: - - #extension GL_ANGLE_base_vertex_base_instance_shader_builtin : - - where is as specified in section 3.5. - - A new preprocessor #define is added to the OpenGL ES Shading Language: - - #define GL_ANGLE_base_vertex_base_instance_shader_builtin 1 - - -Issues - - None - -Revision History - - Rev. Date Author Changes - ---- -------- ---------- -------------------------------------------- - 1 11/19/21 Shrek Shao First revision. diff --git a/include/GLSLANG/ShaderLang.h b/include/GLSLANG/ShaderLang.h index d5003e4e1..74f523dc8 100644 --- a/include/GLSLANG/ShaderLang.h +++ b/include/GLSLANG/ShaderLang.h @@ -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 267 enum ShShaderSpec { @@ -400,7 +400,6 @@ struct ShBuiltInResources int OES_texture_3D; int ANGLE_texture_multisample; int ANGLE_multi_draw; - // TODO(angleproject:3402) remove after chromium side removal to pass compilation int ANGLE_base_vertex_base_instance; int WEBGL_video_texture; int APPLE_clip_distance; @@ -415,7 +414,6 @@ struct ShBuiltInResources int OES_sample_variables; int EXT_clip_cull_distance; int EXT_primitive_bounding_box; - int ANGLE_base_vertex_base_instance_shader_builtin; // 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 diff --git a/scripts/code_generation_hashes/Extension_files.json b/scripts/code_generation_hashes/Extension_files.json index 40512dd77..944c92d0a 100644 --- a/scripts/code_generation_hashes/Extension_files.json +++ b/scripts/code_generation_hashes/Extension_files.json @@ -1,6 +1,6 @@ { "doc/ExtensionSupport.md": - "14185ec747682e4a338a9fae6972e3f1", + "2780ba4f99ed42d86db6c48dd2b71894", "scripts/cl.xml": "f923201d4ea3e1130763b19fa7faa7a2", "scripts/egl.xml": @@ -8,31 +8,31 @@ "scripts/egl_angle_ext.xml": "bea2e9846b429ecf051a0a46e4f02374", "scripts/extension_data/intel_630_linux.json": - "dbcae14638684f9c094c216110fd4fa3", + "4131eaca8a8e4fca9b0c5ff25b16026f", "scripts/extension_data/intel_630_win10.json": - "4cf6bfad658bb2f0a818bed648042c23", + "bd89a6577d818c6d49f36df601cd99dd", "scripts/extension_data/nvidia_p400_linux.json": - "b9e39094658cf0378b0b6ca1fd69b32a", + "d5a85767739d7404ffb76cbc9f3dc57d", "scripts/extension_data/nvidia_p400_win10.json": - "476eca14731550002205aef95c8ce3f6", + "8a8bf15d0fb0168d1eadbb228f32fe29", "scripts/extension_data/pixel_4_android_11.json": - "3e482d5647efe6e938101584885a1994", + "2c05f8906022c6c5f99b56a7678e3d03", "scripts/extension_data/swiftshader_win10.json": - "6eac00fc10d4130e73323a048c92fca7", + "396fde2ceb0c833fe2ce405c9f1bd901", "scripts/extension_data/swiftshader_win10_gles1.json": - "fbf1c3dc83570c1e3fffdbee313bca30", + "368aa3eef8fcfc01ba322ea34ca505e9", "scripts/gl.xml": "a442a7aeff3a2f0a1fba52ee08089500", "scripts/gl_angle_ext.xml": "474989440f980a079935dff3ab4d7b24", "scripts/registry_xml.py": - "1962da4e017cd117dea42bc4d6d112a1", + "b7aba2b35bc12a88d2b2b1efd2efc096", "scripts/wgl.xml": "c36001431919e1c435f1215a85f7e1db", "src/libANGLE/gen_extensions.py": "db7ed1c2245bba536e074a1cf2bb2590", "src/libANGLE/gles_extensions_autogen.cpp": - "bec449f60a36c7615aaa331bada604a7", + "3c8b8918337a054e28c7078f7a4f609a", "src/libANGLE/gles_extensions_autogen.h": - "c33d6d019b639cd64a1723bded359e2c" + "b4c0a303b26639a8956131ee19d2d431" } \ No newline at end of file diff --git a/scripts/code_generation_hashes/GL_EGL_WGL_loader.json b/scripts/code_generation_hashes/GL_EGL_WGL_loader.json index 6f3a5208b..f9f9a2610 100644 --- a/scripts/code_generation_hashes/GL_EGL_WGL_loader.json +++ b/scripts/code_generation_hashes/GL_EGL_WGL_loader.json @@ -12,7 +12,7 @@ "scripts/gl_angle_ext.xml": "474989440f980a079935dff3ab4d7b24", "scripts/registry_xml.py": - "1962da4e017cd117dea42bc4d6d112a1", + "b7aba2b35bc12a88d2b2b1efd2efc096", "scripts/wgl.xml": "c36001431919e1c435f1215a85f7e1db", "src/libEGL/egl_loader_autogen.cpp": diff --git a/scripts/code_generation_hashes/GL_EGL_entry_points.json b/scripts/code_generation_hashes/GL_EGL_entry_points.json index b367a7f9a..6f7c808a5 100644 --- a/scripts/code_generation_hashes/GL_EGL_entry_points.json +++ b/scripts/code_generation_hashes/GL_EGL_entry_points.json @@ -16,7 +16,7 @@ "scripts/gl_angle_ext.xml": "474989440f980a079935dff3ab4d7b24", "scripts/registry_xml.py": - "1962da4e017cd117dea42bc4d6d112a1", + "b7aba2b35bc12a88d2b2b1efd2efc096", "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": - "56ace18f08e6531df8fcdbc258db5a84", + "658aaa61c874cf9fda0e9b420a1ce703", "src/libANGLE/capture/capture_gles_1_0_autogen.cpp": "7ec7ef8f779b809a45d74b97502c419b", "src/libANGLE/capture/capture_gles_1_0_autogen.h": diff --git a/scripts/code_generation_hashes/GLenum_value_to_string_map.json b/scripts/code_generation_hashes/GLenum_value_to_string_map.json index baa16bfd2..497b77634 100644 --- a/scripts/code_generation_hashes/GLenum_value_to_string_map.json +++ b/scripts/code_generation_hashes/GLenum_value_to_string_map.json @@ -6,7 +6,7 @@ "scripts/gl_angle_ext.xml": "474989440f980a079935dff3ab4d7b24", "scripts/registry_xml.py": - "1962da4e017cd117dea42bc4d6d112a1", + "b7aba2b35bc12a88d2b2b1efd2efc096", "src/libANGLE/capture/gl_enum_utils_autogen.cpp": "2ea097051161668c1cef088043707735", "src/libANGLE/capture/gl_enum_utils_autogen.h": diff --git a/scripts/code_generation_hashes/Static_builtins.json b/scripts/code_generation_hashes/Static_builtins.json index 35a921ffd..d9c351b80 100644 --- a/scripts/code_generation_hashes/Static_builtins.json +++ b/scripts/code_generation_hashes/Static_builtins.json @@ -6,15 +6,15 @@ "src/compiler/translator/Operator_autogen.h": "cdaafd06e84ef6a8e4721678d622d844", "src/compiler/translator/SymbolTable_ESSL_autogen.cpp": - "3dd0c9b8e03b010e9644e5574480158f", + "d5aee25a82129a6fc7ae042a85a3cfdf", "src/compiler/translator/SymbolTable_autogen.cpp": - "2a521e5bcffe7bf36b60de5307688fdb", + "21d720b15db0dc774066d94da8635708", "src/compiler/translator/SymbolTable_autogen.h": "291eba34a070f5fddbf2827a1577c598", "src/compiler/translator/builtin_function_declarations.txt": "cd5f022686be7e13174b672d6b32fc6d", "src/compiler/translator/builtin_variables.json": - "de6accceb23ac374122a14dd80584eaa", + "c8024a2d16554f32a8bc9e3f096772f7", "src/compiler/translator/gen_builtin_symbols.py": "74ac1eb203c04abfbb81174c5fdb257d", "src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h": diff --git a/scripts/code_generation_hashes/proc_table.json b/scripts/code_generation_hashes/proc_table.json index 14a92465b..e7592222a 100644 --- a/scripts/code_generation_hashes/proc_table.json +++ b/scripts/code_generation_hashes/proc_table.json @@ -12,7 +12,7 @@ "scripts/gl_angle_ext.xml": "474989440f980a079935dff3ab4d7b24", "scripts/registry_xml.py": - "1962da4e017cd117dea42bc4d6d112a1", + "b7aba2b35bc12a88d2b2b1efd2efc096", "scripts/wgl.xml": "c36001431919e1c435f1215a85f7e1db", "src/libGL/proc_table_wgl_autogen.cpp": diff --git a/scripts/extension_data/intel_630_linux.json b/scripts/extension_data/intel_630_linux.json index 21c03b19b..c5d9276bd 100644 --- a/scripts/extension_data/intel_630_linux.json +++ b/scripts/extension_data/intel_630_linux.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 3.20 (ANGLE 2.1.16847 git hash: a097ee2ea7a9)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_compressed_texture_etc", "GL_ANGLE_copy_texture_3d", diff --git a/scripts/extension_data/intel_630_win10.json b/scripts/extension_data/intel_630_win10.json index de28299d2..ab70e6468 100644 --- a/scripts/extension_data/intel_630_win10.json +++ b/scripts/extension_data/intel_630_win10.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 3.20 (ANGLE 2.1.16846 git hash: 22d8115a208b)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_compressed_texture_etc", "GL_ANGLE_copy_texture_3d", diff --git a/scripts/extension_data/nvidia_p400_linux.json b/scripts/extension_data/nvidia_p400_linux.json index 11c0b54be..8b238a94c 100644 --- a/scripts/extension_data/nvidia_p400_linux.json +++ b/scripts/extension_data/nvidia_p400_linux.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 3.20 (ANGLE 2.1.16847 git hash: a097ee2ea7a9)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_copy_texture_3d", "GL_ANGLE_depth_texture", diff --git a/scripts/extension_data/nvidia_p400_win10.json b/scripts/extension_data/nvidia_p400_win10.json index e0d7ce732..ac98ec941 100644 --- a/scripts/extension_data/nvidia_p400_win10.json +++ b/scripts/extension_data/nvidia_p400_win10.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 3.20 (ANGLE 2.1.16847 git hash: a097ee2ea7a9)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_copy_texture_3d", "GL_ANGLE_depth_texture", diff --git a/scripts/extension_data/pixel_4_android_11.json b/scripts/extension_data/pixel_4_android_11.json index cf73aee0e..1dafe4c26 100644 --- a/scripts/extension_data/pixel_4_android_11.json +++ b/scripts/extension_data/pixel_4_android_11.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 3.20 (ANGLE 2.1.16847 git hash: a097ee2ea7a9)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_compressed_texture_etc", "GL_ANGLE_copy_texture_3d", diff --git a/scripts/extension_data/swiftshader_win10.json b/scripts/extension_data/swiftshader_win10.json index 8cd8746fc..3d7ceee41 100644 --- a/scripts/extension_data/swiftshader_win10.json +++ b/scripts/extension_data/swiftshader_win10.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 3.10 (ANGLE 2.1.16782 git hash: 368c0ce94472)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_compressed_texture_etc", "GL_ANGLE_copy_texture_3d", diff --git a/scripts/extension_data/swiftshader_win10_gles1.json b/scripts/extension_data/swiftshader_win10_gles1.json index d70010afb..627a19001 100644 --- a/scripts/extension_data/swiftshader_win10_gles1.json +++ b/scripts/extension_data/swiftshader_win10_gles1.json @@ -5,7 +5,6 @@ "ShaderLanguageVersion": "OpenGL ES GLSL ES 1.00 (ANGLE 2.1.16782 git hash: 368c0ce94472)", "Extensions": [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_client_arrays", "GL_ANGLE_compressed_texture_etc", "GL_ANGLE_depth_texture", diff --git a/scripts/registry_xml.py b/scripts/registry_xml.py index 7f415e28e..92bdfd6ae 100644 --- a/scripts/registry_xml.py +++ b/scripts/registry_xml.py @@ -40,7 +40,6 @@ angle_toggleable_extensions = [ angle_requestable_extensions = [ "GL_ANGLE_base_vertex_base_instance", - "GL_ANGLE_base_vertex_base_instance_shader_builtin", "GL_ANGLE_compressed_texture_etc", "GL_ANGLE_copy_texture_3d", "GL_ANGLE_framebuffer_multisample", diff --git a/src/compiler/translator/Compiler.cpp b/src/compiler/translator/Compiler.cpp index 2b4f99d0c..aee68b431 100644 --- a/src/compiler/translator/Compiler.cpp +++ b/src/compiler/translator/Compiler.cpp @@ -426,8 +426,7 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[], (compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0; if (!glBaseVertexBaseInstanceSupported) { - auto it = - mExtensionBehavior.find(TExtension::ANGLE_base_vertex_base_instance_shader_builtin); + auto it = mExtensionBehavior.find(TExtension::ANGLE_base_vertex_base_instance); if (it != mExtensionBehavior.end()) { mExtensionBehavior.erase(it); @@ -861,8 +860,7 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root, } if (mShaderType == GL_VERTEX_SHADER && - IsExtensionEnabled(mExtensionBehavior, - TExtension::ANGLE_base_vertex_base_instance_shader_builtin)) + IsExtensionEnabled(mExtensionBehavior, TExtension::ANGLE_base_vertex_base_instance)) { if ((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0) { @@ -1160,7 +1158,7 @@ bool TCompiler::compile(const char *const shaderStrings[], (compileOptions & SH_EMULATE_GL_DRAW_ID) != 0; bool lookForBaseVertexBaseInstance = IsExtensionEnabled(mExtensionBehavior, - TExtension::ANGLE_base_vertex_base_instance_shader_builtin) && + TExtension::ANGLE_base_vertex_base_instance) && (compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0; if (lookForDrawID || lookForBaseVertexBaseInstance) @@ -1258,7 +1256,7 @@ void TCompiler::setResourceString() << ":MaxViewsOVR:" << mResources.MaxViewsOVR << ":NV_draw_buffers:" << mResources.NV_draw_buffers << ":ANGLE_multi_draw:" << mResources.ANGLE_multi_draw - << ":ANGLE_base_vertex_base_instance_shader_builtin:" << mResources.ANGLE_base_vertex_base_instance_shader_builtin + << ":ANGLE_base_vertex_base_instance:" << mResources.ANGLE_base_vertex_base_instance << ":APPLE_clip_distance:" << mResources.APPLE_clip_distance << ":OES_texture_cube_map_array:" << mResources.OES_texture_cube_map_array << ":EXT_texture_cube_map_array:" << mResources.EXT_texture_cube_map_array diff --git a/src/compiler/translator/ExtensionBehavior.cpp b/src/compiler/translator/ExtensionBehavior.cpp index 5476da083..4089aaa39 100644 --- a/src/compiler/translator/ExtensionBehavior.cpp +++ b/src/compiler/translator/ExtensionBehavior.cpp @@ -12,47 +12,47 @@ #include -#define LIST_EXTENSIONS(OP) \ - OP(ANGLE_base_vertex_base_instance_shader_builtin) \ - OP(ANGLE_multi_draw) \ - OP(ANGLE_texture_multisample) \ - OP(APPLE_clip_distance) \ - OP(ARB_texture_rectangle) \ - OP(ARM_shader_framebuffer_fetch) \ - OP(EXT_blend_func_extended) \ - OP(EXT_clip_cull_distance) \ - OP(EXT_draw_buffers) \ - OP(EXT_frag_depth) \ - OP(EXT_geometry_shader) \ - OP(OES_geometry_shader) \ - OP(OES_shader_io_blocks) \ - OP(EXT_shader_io_blocks) \ - OP(EXT_gpu_shader5) \ - OP(EXT_primitive_bounding_box) \ - OP(EXT_shader_framebuffer_fetch) \ - OP(EXT_shader_framebuffer_fetch_non_coherent) \ - OP(EXT_shader_non_constant_global_initializers) \ - OP(EXT_shader_texture_lod) \ - OP(EXT_shadow_samplers) \ - OP(EXT_tessellation_shader) \ - OP(EXT_texture_buffer) \ - OP(EXT_texture_cube_map_array) \ - OP(EXT_YUV_target) \ - OP(NV_EGL_stream_consumer_external) \ - OP(NV_shader_framebuffer_fetch) \ - OP(NV_shader_noperspective_interpolation) \ - OP(OES_EGL_image_external) \ - OP(OES_EGL_image_external_essl3) \ - OP(OES_sample_variables) \ - OP(OES_shader_multisample_interpolation) \ - OP(OES_shader_image_atomic) \ - OP(OES_standard_derivatives) \ - OP(OES_texture_3D) \ - OP(OES_texture_buffer) \ - OP(OES_texture_cube_map_array) \ - OP(OES_texture_storage_multisample_2d_array) \ - OP(OVR_multiview) \ - OP(OVR_multiview2) \ +#define LIST_EXTENSIONS(OP) \ + OP(ANGLE_base_vertex_base_instance) \ + OP(ANGLE_multi_draw) \ + OP(ANGLE_texture_multisample) \ + OP(APPLE_clip_distance) \ + OP(ARB_texture_rectangle) \ + OP(ARM_shader_framebuffer_fetch) \ + OP(EXT_blend_func_extended) \ + OP(EXT_clip_cull_distance) \ + OP(EXT_draw_buffers) \ + OP(EXT_frag_depth) \ + OP(EXT_geometry_shader) \ + OP(OES_geometry_shader) \ + OP(OES_shader_io_blocks) \ + OP(EXT_shader_io_blocks) \ + OP(EXT_gpu_shader5) \ + OP(EXT_primitive_bounding_box) \ + OP(EXT_shader_framebuffer_fetch) \ + OP(EXT_shader_framebuffer_fetch_non_coherent) \ + OP(EXT_shader_non_constant_global_initializers) \ + OP(EXT_shader_texture_lod) \ + OP(EXT_shadow_samplers) \ + OP(EXT_tessellation_shader) \ + OP(EXT_texture_buffer) \ + OP(EXT_texture_cube_map_array) \ + OP(EXT_YUV_target) \ + OP(NV_EGL_stream_consumer_external) \ + OP(NV_shader_framebuffer_fetch) \ + OP(NV_shader_noperspective_interpolation) \ + OP(OES_EGL_image_external) \ + OP(OES_EGL_image_external_essl3) \ + OP(OES_sample_variables) \ + OP(OES_shader_multisample_interpolation) \ + OP(OES_shader_image_atomic) \ + OP(OES_standard_derivatives) \ + OP(OES_texture_3D) \ + OP(OES_texture_buffer) \ + OP(OES_texture_cube_map_array) \ + OP(OES_texture_storage_multisample_2d_array) \ + OP(OVR_multiview) \ + OP(OVR_multiview2) \ OP(WEBGL_video_texture) namespace sh diff --git a/src/compiler/translator/ExtensionBehavior.h b/src/compiler/translator/ExtensionBehavior.h index 079dc67bc..2b2ad8297 100644 --- a/src/compiler/translator/ExtensionBehavior.h +++ b/src/compiler/translator/ExtensionBehavior.h @@ -19,7 +19,7 @@ enum class TExtension : uint8_t { UNDEFINED, // Special value used to indicate no extension. - ANGLE_base_vertex_base_instance_shader_builtin, + ANGLE_base_vertex_base_instance, ANGLE_multi_draw, ANGLE_texture_multisample, APPLE_clip_distance, diff --git a/src/compiler/translator/Initialize.cpp b/src/compiler/translator/Initialize.cpp index a6f644a67..37bbe8996 100644 --- a/src/compiler/translator/Initialize.cpp +++ b/src/compiler/translator/Initialize.cpp @@ -125,9 +125,9 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi { extBehavior[TExtension::ANGLE_multi_draw] = EBhUndefined; } - if (resources.ANGLE_base_vertex_base_instance_shader_builtin) + if (resources.ANGLE_base_vertex_base_instance) { - extBehavior[TExtension::ANGLE_base_vertex_base_instance_shader_builtin] = EBhUndefined; + extBehavior[TExtension::ANGLE_base_vertex_base_instance] = EBhUndefined; } if (resources.WEBGL_video_texture) { diff --git a/src/compiler/translator/ShaderLang.cpp b/src/compiler/translator/ShaderLang.cpp index 4af045283..849f12453 100644 --- a/src/compiler/translator/ShaderLang.cpp +++ b/src/compiler/translator/ShaderLang.cpp @@ -191,48 +191,47 @@ void InitBuiltInResources(ShBuiltInResources *resources) resources->MaxDrawBuffers = 1; // Extensions. - resources->OES_standard_derivatives = 0; - resources->OES_EGL_image_external = 0; - resources->OES_EGL_image_external_essl3 = 0; - resources->NV_EGL_stream_consumer_external = 0; - resources->ARB_texture_rectangle = 0; - resources->EXT_blend_func_extended = 0; - resources->EXT_draw_buffers = 0; - resources->EXT_frag_depth = 0; - resources->EXT_shader_texture_lod = 0; - resources->EXT_shader_framebuffer_fetch = 0; - resources->EXT_shader_framebuffer_fetch_non_coherent = 0; - resources->NV_shader_framebuffer_fetch = 0; - resources->ARM_shader_framebuffer_fetch = 0; - resources->OVR_multiview = 0; - resources->OVR_multiview2 = 0; - resources->EXT_YUV_target = 0; - resources->EXT_geometry_shader = 0; - resources->OES_geometry_shader = 0; - resources->EXT_gpu_shader5 = 0; - resources->OES_shader_io_blocks = 0; - resources->EXT_shader_io_blocks = 0; - resources->EXT_shader_non_constant_global_initializers = 0; - resources->NV_shader_noperspective_interpolation = 0; - resources->OES_texture_storage_multisample_2d_array = 0; - resources->OES_texture_3D = 0; - resources->ANGLE_texture_multisample = 0; - resources->ANGLE_multi_draw = 0; - resources->ANGLE_base_vertex_base_instance = 0; - resources->ANGLE_base_vertex_base_instance_shader_builtin = 0; - resources->WEBGL_video_texture = 0; - resources->APPLE_clip_distance = 0; - resources->OES_texture_cube_map_array = 0; - resources->EXT_texture_cube_map_array = 0; - resources->EXT_shadow_samplers = 0; - resources->OES_shader_multisample_interpolation = 0; - resources->NV_draw_buffers = 0; - resources->OES_shader_image_atomic = 0; - resources->EXT_tessellation_shader = 0; - resources->OES_texture_buffer = 0; - resources->EXT_texture_buffer = 0; - resources->OES_sample_variables = 0; - resources->EXT_clip_cull_distance = 0; + resources->OES_standard_derivatives = 0; + resources->OES_EGL_image_external = 0; + resources->OES_EGL_image_external_essl3 = 0; + resources->NV_EGL_stream_consumer_external = 0; + resources->ARB_texture_rectangle = 0; + resources->EXT_blend_func_extended = 0; + resources->EXT_draw_buffers = 0; + resources->EXT_frag_depth = 0; + resources->EXT_shader_texture_lod = 0; + resources->EXT_shader_framebuffer_fetch = 0; + resources->EXT_shader_framebuffer_fetch_non_coherent = 0; + resources->NV_shader_framebuffer_fetch = 0; + resources->ARM_shader_framebuffer_fetch = 0; + resources->OVR_multiview = 0; + resources->OVR_multiview2 = 0; + resources->EXT_YUV_target = 0; + resources->EXT_geometry_shader = 0; + resources->OES_geometry_shader = 0; + resources->EXT_gpu_shader5 = 0; + resources->OES_shader_io_blocks = 0; + resources->EXT_shader_io_blocks = 0; + resources->EXT_shader_non_constant_global_initializers = 0; + resources->NV_shader_noperspective_interpolation = 0; + resources->OES_texture_storage_multisample_2d_array = 0; + resources->OES_texture_3D = 0; + resources->ANGLE_texture_multisample = 0; + resources->ANGLE_multi_draw = 0; + resources->ANGLE_base_vertex_base_instance = 0; + resources->WEBGL_video_texture = 0; + resources->APPLE_clip_distance = 0; + resources->OES_texture_cube_map_array = 0; + resources->EXT_texture_cube_map_array = 0; + resources->EXT_shadow_samplers = 0; + resources->OES_shader_multisample_interpolation = 0; + resources->NV_draw_buffers = 0; + resources->OES_shader_image_atomic = 0; + resources->EXT_tessellation_shader = 0; + resources->OES_texture_buffer = 0; + resources->EXT_texture_buffer = 0; + resources->OES_sample_variables = 0; + resources->EXT_clip_cull_distance = 0; resources->MaxClipDistances = 8; resources->MaxCullDistances = 8; diff --git a/src/compiler/translator/SymbolTable_ESSL_autogen.cpp b/src/compiler/translator/SymbolTable_ESSL_autogen.cpp index a3ac5ae83..073be4e2a 100644 --- a/src/compiler/translator/SymbolTable_ESSL_autogen.cpp +++ b/src/compiler/translator/SymbolTable_ESSL_autogen.cpp @@ -2222,30 +2222,30 @@ namespace BuiltInVariable constexpr const unsigned int kArraySize4[1] = {4}; -constexpr const TVariable kangle_BaseInstance( - BuiltInId::angle_BaseInstance, - BuiltInName::angle_BaseInstance, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); -constexpr const TVariable kangle_BaseVertex( - BuiltInId::angle_BaseVertex, - BuiltInName::angle_BaseVertex, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); -constexpr const TVariable kgl_BaseInstance( - BuiltInId::gl_BaseInstance, - BuiltInName::gl_BaseInstance, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); -constexpr const TVariable kgl_BaseVertex( - BuiltInId::gl_BaseVertex, - BuiltInName::gl_BaseVertex, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); +constexpr const TVariable kangle_BaseInstance(BuiltInId::angle_BaseInstance, + BuiltInName::angle_BaseInstance, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); +constexpr const TVariable kangle_BaseVertex(BuiltInId::angle_BaseVertex, + BuiltInName::angle_BaseVertex, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); +constexpr const TVariable kgl_BaseInstance(BuiltInId::gl_BaseInstance, + BuiltInName::gl_BaseInstance, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); +constexpr const TVariable kgl_BaseVertex(BuiltInId::gl_BaseVertex, + BuiltInName::gl_BaseVertex, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); constexpr const TVariable kgl_DrawID(BuiltInId::gl_DrawID, BuiltInName::gl_DrawID, SymbolType::BuiltIn, @@ -21013,25 +21013,13 @@ constexpr SymbolRule kRules[] = { Rule::Get(&BuiltInVariable::kgl_VertexID), Rule::Get( &BuiltInVariable::kgl_DrawID), - Rule::Get( + Rule::Get( &BuiltInVariable::kgl_BaseVertex), - Rule::Get( + Rule::Get( &BuiltInVariable::kgl_BaseInstance), - Rule::Get( + Rule::Get( &BuiltInVariable::kangle_BaseVertex), - Rule::Get( + Rule::Get( &BuiltInVariable::kangle_BaseInstance), Rule::Get(&BuiltInVariable::kgl_NumWorkGroups), Rule::Get(&BuiltInVariable::kgl_WorkGroupSize), diff --git a/src/compiler/translator/SymbolTable_autogen.cpp b/src/compiler/translator/SymbolTable_autogen.cpp index f074415a3..3575537c8 100644 --- a/src/compiler/translator/SymbolTable_autogen.cpp +++ b/src/compiler/translator/SymbolTable_autogen.cpp @@ -3419,30 +3419,30 @@ namespace BuiltInVariable constexpr const unsigned int kArraySize4[1] = {4}; -constexpr const TVariable kangle_BaseInstance( - BuiltInId::angle_BaseInstance, - BuiltInName::angle_BaseInstance, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); -constexpr const TVariable kangle_BaseVertex( - BuiltInId::angle_BaseVertex, - BuiltInName::angle_BaseVertex, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); -constexpr const TVariable kgl_BaseInstance( - BuiltInId::gl_BaseInstance, - BuiltInName::gl_BaseInstance, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); -constexpr const TVariable kgl_BaseVertex( - BuiltInId::gl_BaseVertex, - BuiltInName::gl_BaseVertex, - SymbolType::BuiltIn, - std::array{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}}, - StaticType::Get()); +constexpr const TVariable kangle_BaseInstance(BuiltInId::angle_BaseInstance, + BuiltInName::angle_BaseInstance, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); +constexpr const TVariable kangle_BaseVertex(BuiltInId::angle_BaseVertex, + BuiltInName::angle_BaseVertex, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); +constexpr const TVariable kgl_BaseInstance(BuiltInId::gl_BaseInstance, + BuiltInName::gl_BaseInstance, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); +constexpr const TVariable kgl_BaseVertex(BuiltInId::gl_BaseVertex, + BuiltInName::gl_BaseVertex, + SymbolType::BuiltIn, + std::array{ + {TExtension::ANGLE_base_vertex_base_instance}}, + StaticType::Get()); constexpr const TVariable kgl_DrawID(BuiltInId::gl_DrawID, BuiltInName::gl_DrawID, SymbolType::BuiltIn, @@ -34597,25 +34597,13 @@ constexpr SymbolRule kRules[] = { Rule::Get(&BuiltInVariable::kgl_VertexID), Rule::Get( &BuiltInVariable::kgl_DrawID), - Rule::Get( + Rule::Get( &BuiltInVariable::kgl_BaseVertex), - Rule::Get( + Rule::Get( &BuiltInVariable::kgl_BaseInstance), - Rule::Get( + Rule::Get( &BuiltInVariable::kangle_BaseVertex), - Rule::Get( + Rule::Get( &BuiltInVariable::kangle_BaseInstance), Rule::Get(&BuiltInVariable::kgl_NumWorkGroups), Rule::Get(&BuiltInVariable::kgl_NumWorkGroups), diff --git a/src/compiler/translator/TranslatorESSL.cpp b/src/compiler/translator/TranslatorESSL.cpp index 9136f7e96..f31523357 100644 --- a/src/compiler/translator/TranslatorESSL.cpp +++ b/src/compiler/translator/TranslatorESSL.cpp @@ -165,7 +165,7 @@ void TranslatorESSL::writeExtensionBehavior(ShCompileOptions compileOptions) ASSERT((compileOptions & SH_EMULATE_GL_DRAW_ID) != 0); continue; } - else if (iter->first == TExtension::ANGLE_base_vertex_base_instance_shader_builtin) + else if (iter->first == TExtension::ANGLE_base_vertex_base_instance) { // Don't emit anything. This extension is emulated ASSERT((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0); diff --git a/src/compiler/translator/builtin_variables.json b/src/compiler/translator/builtin_variables.json index 4523df546..b357ab2a8 100644 --- a/src/compiler/translator/builtin_variables.json +++ b/src/compiler/translator/builtin_variables.json @@ -1091,7 +1091,7 @@ "variables":{ "gl_BaseVertex":{ "essl_level":"ESSL3_BUILTINS", - "essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin", + "essl_extension":"ANGLE_base_vertex_base_instance", "type":{ "basic":"Int", "precision":"High", @@ -1100,7 +1100,7 @@ }, "gl_BaseInstance":{ "essl_level":"ESSL3_BUILTINS", - "essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin", + "essl_extension":"ANGLE_base_vertex_base_instance", "type":{ "basic":"Int", "precision":"High", @@ -1109,7 +1109,7 @@ }, "angle_BaseVertex":{ "essl_level":"COMMON_BUILTINS", - "essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin", + "essl_extension":"ANGLE_base_vertex_base_instance", "type":{ "basic":"Int", "precision":"High", @@ -1118,7 +1118,7 @@ }, "angle_BaseInstance":{ "essl_level":"COMMON_BUILTINS", - "essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin", + "essl_extension":"ANGLE_base_vertex_base_instance", "type":{ "basic":"Int", "precision":"High", diff --git a/src/libANGLE/Compiler.cpp b/src/libANGLE/Compiler.cpp index 4a7f1a8fc..7dd1c25af 100644 --- a/src/libANGLE/Compiler.cpp +++ b/src/libANGLE/Compiler.cpp @@ -112,12 +112,11 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const State &state, egl::Disp mResources.EXT_shader_io_blocks = extensions.shaderIoBlocksEXT; mResources.OES_texture_storage_multisample_2d_array = extensions.textureStorageMultisample2dArrayOES; - mResources.OES_texture_3D = extensions.texture3DOES; - mResources.ANGLE_texture_multisample = extensions.textureMultisampleANGLE; - mResources.ANGLE_multi_draw = extensions.multiDrawANGLE; - mResources.ANGLE_base_vertex_base_instance_shader_builtin = - extensions.baseVertexBaseInstanceShaderBuiltinANGLE; - mResources.APPLE_clip_distance = extensions.clipDistanceAPPLE; + mResources.OES_texture_3D = extensions.texture3DOES; + mResources.ANGLE_texture_multisample = extensions.textureMultisampleANGLE; + mResources.ANGLE_multi_draw = extensions.multiDrawANGLE; + mResources.ANGLE_base_vertex_base_instance = extensions.baseVertexBaseInstanceANGLE; + mResources.APPLE_clip_distance = extensions.clipDistanceAPPLE; // OES_shader_multisample_interpolation mResources.OES_shader_multisample_interpolation = extensions.shaderMultisampleInterpolationOES; mResources.OES_shader_image_atomic = extensions.shaderImageAtomicOES; diff --git a/src/libANGLE/Context_gles_ext_autogen.h b/src/libANGLE/Context_gles_ext_autogen.h index 13853c88b..a6daace46 100644 --- a/src/libANGLE/Context_gles_ext_autogen.h +++ b/src/libANGLE/Context_gles_ext_autogen.h @@ -312,7 +312,6 @@ PrimitiveMode modePacked, const GLsizei *counts, DrawElementsType typePacked, \ const GLvoid *const *indices, const GLsizei *instanceCounts, const GLint *baseVertices, \ const GLuint *baseInstances, GLsizei drawcount); \ - /* GL_ANGLE_base_vertex_base_instance_shader_builtin */ \ /* GL_ANGLE_client_arrays */ \ /* GL_ANGLE_compressed_texture_etc */ \ /* GL_ANGLE_copy_texture_3d */ \ diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp index 67797d551..fc9f4c09d 100644 --- a/src/libANGLE/Program.cpp +++ b/src/libANGLE/Program.cpp @@ -4444,7 +4444,7 @@ void Program::postResolveLink(const gl::Context *context) mState.mDrawIDLocation = getUniformLocation("gl_DrawID").value; } - if (context->getExtensions().baseVertexBaseInstanceShaderBuiltinANGLE) + if (context->getExtensions().baseVertexBaseInstanceANGLE) { mState.mBaseVertexLocation = getUniformLocation("gl_BaseVertex").value; mState.mBaseInstanceLocation = getUniformLocation("gl_BaseInstance").value; diff --git a/src/libANGLE/Program.h b/src/libANGLE/Program.h index f66417d8f..967c4481e 100644 --- a/src/libANGLE/Program.h +++ b/src/libANGLE/Program.h @@ -398,7 +398,7 @@ class ProgramState final : angle::NonCopyable // GL_ANGLE_multi_draw int mDrawIDLocation; - // GL_ANGLE_base_vertex_base_instance_shader_builtin + // GL_ANGLE_base_vertex_base_instance int mBaseVertexLocation; int mBaseInstanceLocation; // Cached value of base vertex and base instance diff --git a/src/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp index ec6f377f9..689bc894b 100644 --- a/src/libANGLE/Shader.cpp +++ b/src/libANGLE/Shader.cpp @@ -342,7 +342,8 @@ void Shader::compile(const Context *context) mState.mCompileStatus = CompileStatus::COMPILE_REQUESTED; mBoundCompiler.set(context, context->getCompiler()); - ShCompileOptions options = (SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_DRAW_ID); + ShCompileOptions options = (SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_DRAW_ID | + SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE); // Add default options to WebGL shaders to prevent unexpected behavior during // compilation. @@ -354,12 +355,6 @@ void Shader::compile(const Context *context) options |= SH_ENFORCE_PACKING_RESTRICTIONS; options |= SH_INIT_SHARED_VARIABLES; } - else - { - // Per https://github.com/KhronosGroup/WebGL/pull/3278 gl_BaseVertex/gl_BaseInstance are - // removed from WebGL - options |= SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE; - } // Some targets (e.g. D3D11 Feature Level 9_3 and below) do not support non-constant loop // indexes in fragment shaders. Shader compilation will fail. To provide a better error diff --git a/src/libANGLE/gles_extensions_autogen.cpp b/src/libANGLE/gles_extensions_autogen.cpp index 2db7f6199..617e275ef 100644 --- a/src/libANGLE/gles_extensions_autogen.cpp +++ b/src/libANGLE/gles_extensions_autogen.cpp @@ -194,7 +194,6 @@ const ExtensionInfoMap &GetExtensionInfoMap() // ANGLE unofficial extension strings // ---------------------------------- map["GL_ANGLE_base_vertex_base_instance"] = enableableExtension(&Extensions::baseVertexBaseInstanceANGLE); - map["GL_ANGLE_base_vertex_base_instance_shader_builtin"] = enableableExtension(&Extensions::baseVertexBaseInstanceShaderBuiltinANGLE); map["GL_CHROMIUM_bind_generates_resource"] = esOnlyExtension(&Extensions::bindGeneratesResourceCHROMIUM); map["GL_CHROMIUM_bind_uniform_location"] = esOnlyExtension(&Extensions::bindUniformLocationCHROMIUM); map["GL_ANGLE_client_arrays"] = esOnlyExtension(&Extensions::clientArraysANGLE); diff --git a/src/libANGLE/gles_extensions_autogen.h b/src/libANGLE/gles_extensions_autogen.h index 65f913d29..fbefcb66a 100644 --- a/src/libANGLE/gles_extensions_autogen.h +++ b/src/libANGLE/gles_extensions_autogen.h @@ -529,9 +529,6 @@ struct Extensions // GL_ANGLE_base_vertex_base_instance bool baseVertexBaseInstanceANGLE = false; - // GL_ANGLE_base_vertex_base_instance_shader_builtin - bool baseVertexBaseInstanceShaderBuiltinANGLE = false; - // GL_CHROMIUM_bind_generates_resource bool bindGeneratesResourceCHROMIUM = false; diff --git a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp index a7e690769..c300f0847 100644 --- a/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp +++ b/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp @@ -1648,11 +1648,10 @@ void GenerateCaps(ID3D11Device *device, extensions->provokingVertexANGLE = true; extensions->blendFuncExtendedEXT = true; // http://anglebug.com/4926 - extensions->texture3DOES = false; - extensions->baseVertexBaseInstanceANGLE = true; - extensions->baseVertexBaseInstanceShaderBuiltinANGLE = true; - extensions->drawElementsBaseVertexOES = true; - extensions->drawElementsBaseVertexEXT = true; + extensions->texture3DOES = false; + extensions->baseVertexBaseInstanceANGLE = true; + extensions->drawElementsBaseVertexOES = true; + extensions->drawElementsBaseVertexEXT = true; if (!strstr(description, "Adreno")) { extensions->multisampledRenderToTextureEXT = true; diff --git a/src/libANGLE/renderer/gl/renderergl_utils.cpp b/src/libANGLE/renderer/gl/renderergl_utils.cpp index 2cbb5067f..138c8a5b5 100644 --- a/src/libANGLE/renderer/gl/renderergl_utils.cpp +++ b/src/libANGLE/renderer/gl/renderergl_utils.cpp @@ -1692,9 +1692,6 @@ void GenerateCaps(const FunctionsGL *functions, functions->hasGLESExtension("GL_OES_draw_elements_base_vertex") || functions->hasGLESExtension("GL_EXT_draw_elements_base_vertex"); - // ANGLE_base_vertex_base_instance_shader_builtin - extensions->baseVertexBaseInstanceShaderBuiltinANGLE = extensions->baseVertexBaseInstanceANGLE; - // OES_draw_elements_base_vertex extensions->drawElementsBaseVertexOES = functions->isAtLeastGL(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) || diff --git a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp index 10ca63004..36e050df7 100644 --- a/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp +++ b/src/libANGLE/renderer/vulkan/vk_caps_utils.cpp @@ -382,8 +382,7 @@ void RendererVk::ensureCapsInitialized() const mNativeExtensions.multiDrawIndirectEXT = true; // Enable ANGLE_base_vertex_base_instance - mNativeExtensions.baseVertexBaseInstanceANGLE = true; - mNativeExtensions.baseVertexBaseInstanceShaderBuiltinANGLE = true; + mNativeExtensions.baseVertexBaseInstanceANGLE = true; // Enable OES/EXT_draw_elements_base_vertex mNativeExtensions.drawElementsBaseVertexOES = true; diff --git a/src/tests/compiler_tests/EmulateGLBaseVertexBaseInstance_test.cpp b/src/tests/compiler_tests/EmulateGLBaseVertexBaseInstance_test.cpp index 10074106a..a196004f0 100644 --- a/src/tests/compiler_tests/EmulateGLBaseVertexBaseInstance_test.cpp +++ b/src/tests/compiler_tests/EmulateGLBaseVertexBaseInstance_test.cpp @@ -21,19 +21,17 @@ class EmulateGLBaseVertexBaseInstanceTest : public MatchOutputCodeTest EmulateGLBaseVertexBaseInstanceTest() : MatchOutputCodeTest(GL_VERTEX_SHADER, SH_VARIABLES, SH_GLSL_COMPATIBILITY_OUTPUT) { - getResources()->ANGLE_base_vertex_base_instance_shader_builtin = 1; + getResources()->ANGLE_base_vertex_base_instance = 1; } protected: - void CheckCompileFailure(const std::string &shaderString, - const char *expectedError = nullptr, - ShCompileOptions compileOptions = SH_VARIABLES) + void CheckCompileFailure(const std::string &shaderString, const char *expectedError = nullptr) { std::string translatedCode; std::string infoLog; bool success = compileTestShader(GL_VERTEX_SHADER, SH_GLES3_SPEC, SH_GLSL_COMPATIBILITY_OUTPUT, shaderString, getResources(), - compileOptions, &translatedCode, &infoLog); + SH_VARIABLES, &translatedCode, &infoLog); EXPECT_FALSE(success); if (expectedError) { @@ -47,39 +45,25 @@ class EmulateGLBaseVertexBaseInstanceTest : public MatchOutputCodeTest TEST_F(EmulateGLBaseVertexBaseInstanceTest, RequiresEmulation) { CheckCompileFailure( - "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "void main() {\n" " gl_Position = vec4(float(gl_BaseVertex), float(gl_BaseInstance), 0.0, 1.0);\n" "}\n", "extension is not supported"); } -// Check that compiling with emulation with gl_BaseVertex and gl_BaseInstance works +// Check that compiling with emulation with gl_BaseVertex and gl_BaseInstance works with different +// shader versions TEST_F(EmulateGLBaseVertexBaseInstanceTest, CheckCompile) { const std::string shaderString = - "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" - "void main() {\n" - " gl_Position = vec4(float(gl_BaseVertex), float(gl_BaseInstance), 0.0, 1.0);\n" - "}\n"; - - compile(shaderString, SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE); -} - -// Check that compiling with the old extension doesn't work -TEST_F(EmulateGLBaseVertexBaseInstanceTest, CheckCompileOldExtension) -{ - const std::string shaderString = - "#version 300 es\n" "#extension GL_ANGLE_base_vertex_base_instance : require\n" "void main() {\n" " gl_Position = vec4(float(gl_BaseVertex), float(gl_BaseInstance), 0.0, 1.0);\n" "}\n"; - CheckCompileFailure(shaderString, "extension is not supported", - SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE); + compile("#version 300 es\n" + shaderString, + SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE); } // Check that gl_BaseVertex and gl_BaseInstance is properly emulated @@ -97,7 +81,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, EmulatesUniform) const std::string &shaderString = "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "void main() {\n" " gl_Position = vec4(float(gl_BaseVertex), float(gl_BaseInstance), 0.0, 1.0);\n" "}\n"; @@ -108,7 +92,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, EmulatesUniform) EXPECT_TRUE(foundInCode("angle_BaseVertex")); EXPECT_TRUE(notFoundInCode("gl_BaseInstance")); EXPECT_TRUE(foundInCode("angle_BaseInstance")); - EXPECT_TRUE(notFoundInCode("GL_ANGLE_base_vertex_base_instance_shader_builtin")); + EXPECT_TRUE(notFoundInCode("GL_ANGLE_base_vertex_base_instance")); EXPECT_TRUE(foundInCode(SH_GLSL_COMPATIBILITY_OUTPUT, "uniform int angle_BaseVertex")); EXPECT_TRUE(foundInCode(SH_GLSL_COMPATIBILITY_OUTPUT, "uniform int angle_BaseInstance")); @@ -160,7 +144,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID) // Check that it is not permitted with the extension CheckCompileFailure( "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "uniform int gl_BaseVertex;\n" "void main() {\n" " gl_Position = vec4(float(gl_BaseVertex), 0.0, 0.0, 1.0);\n" @@ -169,7 +153,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID) CheckCompileFailure( "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "uniform int gl_BaseInstance;\n" "void main() {\n" " gl_Position = vec4(float(gl_BaseInstance), 0.0, 0.0, 1.0);\n" @@ -178,7 +162,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID) CheckCompileFailure( "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "void main() {\n" " int gl_BaseVertex = 0;\n" " gl_Position = vec4(float(gl_BaseVertex), 0.0, 0.0, 1.0);\n" @@ -187,7 +171,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID) CheckCompileFailure( "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "void main() {\n" " int gl_BaseInstance = 0;\n" " gl_Position = vec4(float(gl_BaseInstance), 0.0, 0.0, 1.0);\n" @@ -211,7 +195,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, AllowsUserDefinedANGLEDrawID) const std::string &shaderString = "#version 300 es\n" - "#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n" + "#extension GL_ANGLE_base_vertex_base_instance : require\n" "uniform int angle_BaseVertex;\n" "uniform int angle_BaseInstance;\n" "void main() {\n" diff --git a/src/tests/gl_tests/DrawBaseVertexBaseInstanceTest.cpp b/src/tests/gl_tests/DrawBaseVertexBaseInstanceTest.cpp index 1acffa1fb..c08f14c02 100644 --- a/src/tests/gl_tests/DrawBaseVertexBaseInstanceTest.cpp +++ b/src/tests/gl_tests/DrawBaseVertexBaseInstanceTest.cpp @@ -175,7 +175,7 @@ class DrawBaseVertexBaseInstanceTest std::stringstream shader; shader << ("#version 300 es\n") << (isMultiDraw ? "#extension GL_ANGLE_multi_draw : require\n" : "") - << ("#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n") + << ("#extension GL_ANGLE_base_vertex_base_instance : require\n") << "#define kCountX " << kCountX << "\n" << "#define kCountY " << kCountY << "\n" << R"( @@ -432,11 +432,6 @@ void main() return false; } - if (IsGLExtensionRequestable("GL_ANGLE_base_vertex_base_instance_shader_builtin")) - { - glRequestExtensionANGLE("GL_ANGLE_base_vertex_base_instance_shader_builtin"); - } - return true; } diff --git a/src/tests/gl_tests/DrawBaseVertexVariantsTest.cpp b/src/tests/gl_tests/DrawBaseVertexVariantsTest.cpp index b603a1b65..dbfc6d03f 100644 --- a/src/tests/gl_tests/DrawBaseVertexVariantsTest.cpp +++ b/src/tests/gl_tests/DrawBaseVertexVariantsTest.cpp @@ -339,12 +339,7 @@ void main() return false; } } - if (!EnsureGLExtensionEnabled("GL_ANGLE_base_vertex_base_instance")) - { - return false; - } - - return EnsureGLExtensionEnabled("GL_ANGLE_base_vertex_base_instance_shader_builtin"); + return EnsureGLExtensionEnabled("GL_ANGLE_base_vertex_base_instance"); } bool requestNativeBaseVertexExtensions()