зеркало из https://github.com/AvaloniaUI/angle.git
Decouple gl_BaseVertex/gl_BaseInstance uniforms
These are builtin uniforms removed in https://github.com/KhronosGroup/WebGL/pull/3278 Decouple them from the original ANGLE_base_vertex_base_instance extension. Make a new ANGLE_base_vertex_base_instance_shader_builtin extension for these builtin uniforms. Bug: angleproject:3402 Change-Id: I77b93917976ce435db9c578c0ade37bff18a42b0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3290304 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
This commit is contained in:
Родитель
8815245a8c
Коммит
36bf1ebe5e
|
@ -182,6 +182,7 @@ 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) | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
|
||||
|
|
|
@ -24,8 +24,8 @@ Status
|
|||
|
||||
Version
|
||||
|
||||
Last Modified Date: July 14, 2020
|
||||
Author Revision: 2
|
||||
Last Modified Date: Nov 19, 2021
|
||||
Author Revision: 3
|
||||
|
||||
Number
|
||||
|
||||
|
@ -62,15 +62,6 @@ Overview
|
|||
of zero, and that <instances> of the set of elements are executed and the
|
||||
value of <instance> advances between each set.
|
||||
|
||||
Additionally, <gl_BaseVertex> and <gl_BaseInstance> builtins are added
|
||||
to the shading language.
|
||||
For any *BaseVertex* draw call variant, the <baseVertex> of the draw may be
|
||||
read by the vertex shader as <gl_BaseVertex>. For non *BaseVertex* calls,
|
||||
the value of <gl_BaseVertex> is 0.
|
||||
For any *BaseInstance draw call variant, the baseInstance of the draw may
|
||||
be read by the vertex shader as <gl_BaseInstance>. For non *BaseInstance
|
||||
calls, the value of <gl_BaseInstance> is 0.
|
||||
|
||||
IP Status
|
||||
|
||||
No known IP claims.
|
||||
|
@ -126,9 +117,6 @@ Additions to Chapter 10 of the OpenGL ES 3.2 Specification
|
|||
Behaves identically to DrawArraysInstanced except that <baseInstance> is
|
||||
passed down to DrawArraysOneInstance instead of zero.
|
||||
|
||||
The base index of the instance may be read by a vertex shader as
|
||||
<gl_BaseInstance>.
|
||||
|
||||
The command
|
||||
|
||||
void MultiDrawArraysInstancedBaseInstanceANGLE(GLenum mode,
|
||||
|
@ -168,13 +156,6 @@ Additions to Chapter 10 of the OpenGL ES 3.2 Specification
|
|||
Behaves identically to DrawElementsInstanced except that <baseVertex> and
|
||||
<baseInstance> are passed down to DrawElementsOneInstance instead of zero.
|
||||
|
||||
The base index of the vertex may be read by a vertex shader as
|
||||
<gl_BaseVertex>. This value is also added to the <gl_VertexID>.
|
||||
|
||||
The base index of the instance may be read by a vertex shader as
|
||||
<gl_BaseInstance>. Note that this value is not added to the
|
||||
<gl_InstanceID>.
|
||||
|
||||
The command
|
||||
|
||||
void MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE(GLenum mode,
|
||||
|
@ -220,19 +201,6 @@ Errors
|
|||
The error INVALID_VALUE is generated by the MultiDraw* functions if
|
||||
<drawcount> 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 : <behavior>
|
||||
|
||||
where <behavior> 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
|
||||
|
||||
|
@ -250,3 +218,4 @@ 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.
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
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,
|
||||
<gl_BaseVertex> and <gl_BaseInstance> builtins are added to the shading language.
|
||||
For any *BaseVertex* draw call variant, the <baseVertex> of the draw may be
|
||||
read by the vertex shader as <gl_BaseVertex>. For non *BaseVertex* calls,
|
||||
the value of <gl_BaseVertex> is 0.
|
||||
For any *BaseInstance draw call variant, the baseInstance of the draw may
|
||||
be read by the vertex shader as <gl_BaseInstance>. For non *BaseInstance
|
||||
calls, the value of <gl_BaseInstance> 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
|
||||
<gl_BaseInstance>, 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
|
||||
<gl_BaseVertex>. This value is also added to the <gl_VertexID>.
|
||||
|
||||
The base index of the instance may be read by a vertex shader as
|
||||
<gl_BaseInstance>. Note that this value is not added to the
|
||||
<gl_InstanceID>, 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 : <behavior>
|
||||
|
||||
where <behavior> 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.
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
// Version number for shader translation API.
|
||||
// It is incremented every time the API changes.
|
||||
#define ANGLE_SH_VERSION 267
|
||||
#define ANGLE_SH_VERSION 268
|
||||
|
||||
enum ShShaderSpec
|
||||
{
|
||||
|
@ -400,6 +400,7 @@ 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;
|
||||
|
@ -414,6 +415,7 @@ 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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"doc/ExtensionSupport.md":
|
||||
"2780ba4f99ed42d86db6c48dd2b71894",
|
||||
"14185ec747682e4a338a9fae6972e3f1",
|
||||
"scripts/cl.xml":
|
||||
"f923201d4ea3e1130763b19fa7faa7a2",
|
||||
"scripts/egl.xml":
|
||||
|
@ -8,31 +8,31 @@
|
|||
"scripts/egl_angle_ext.xml":
|
||||
"bea2e9846b429ecf051a0a46e4f02374",
|
||||
"scripts/extension_data/intel_630_linux.json":
|
||||
"4131eaca8a8e4fca9b0c5ff25b16026f",
|
||||
"dbcae14638684f9c094c216110fd4fa3",
|
||||
"scripts/extension_data/intel_630_win10.json":
|
||||
"bd89a6577d818c6d49f36df601cd99dd",
|
||||
"4cf6bfad658bb2f0a818bed648042c23",
|
||||
"scripts/extension_data/nvidia_p400_linux.json":
|
||||
"d5a85767739d7404ffb76cbc9f3dc57d",
|
||||
"b9e39094658cf0378b0b6ca1fd69b32a",
|
||||
"scripts/extension_data/nvidia_p400_win10.json":
|
||||
"8a8bf15d0fb0168d1eadbb228f32fe29",
|
||||
"476eca14731550002205aef95c8ce3f6",
|
||||
"scripts/extension_data/pixel_4_android_11.json":
|
||||
"2c05f8906022c6c5f99b56a7678e3d03",
|
||||
"3e482d5647efe6e938101584885a1994",
|
||||
"scripts/extension_data/swiftshader_win10.json":
|
||||
"396fde2ceb0c833fe2ce405c9f1bd901",
|
||||
"6eac00fc10d4130e73323a048c92fca7",
|
||||
"scripts/extension_data/swiftshader_win10_gles1.json":
|
||||
"368aa3eef8fcfc01ba322ea34ca505e9",
|
||||
"fbf1c3dc83570c1e3fffdbee313bca30",
|
||||
"scripts/gl.xml":
|
||||
"a442a7aeff3a2f0a1fba52ee08089500",
|
||||
"scripts/gl_angle_ext.xml":
|
||||
"474989440f980a079935dff3ab4d7b24",
|
||||
"scripts/registry_xml.py":
|
||||
"b7aba2b35bc12a88d2b2b1efd2efc096",
|
||||
"1962da4e017cd117dea42bc4d6d112a1",
|
||||
"scripts/wgl.xml":
|
||||
"c36001431919e1c435f1215a85f7e1db",
|
||||
"src/libANGLE/gen_extensions.py":
|
||||
"db7ed1c2245bba536e074a1cf2bb2590",
|
||||
"src/libANGLE/gles_extensions_autogen.cpp":
|
||||
"3c8b8918337a054e28c7078f7a4f609a",
|
||||
"bec449f60a36c7615aaa331bada604a7",
|
||||
"src/libANGLE/gles_extensions_autogen.h":
|
||||
"b4c0a303b26639a8956131ee19d2d431"
|
||||
"c33d6d019b639cd64a1723bded359e2c"
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"scripts/gl_angle_ext.xml":
|
||||
"474989440f980a079935dff3ab4d7b24",
|
||||
"scripts/registry_xml.py":
|
||||
"b7aba2b35bc12a88d2b2b1efd2efc096",
|
||||
"1962da4e017cd117dea42bc4d6d112a1",
|
||||
"scripts/wgl.xml":
|
||||
"c36001431919e1c435f1215a85f7e1db",
|
||||
"src/libEGL/egl_loader_autogen.cpp":
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"scripts/gl_angle_ext.xml":
|
||||
"474989440f980a079935dff3ab4d7b24",
|
||||
"scripts/registry_xml.py":
|
||||
"b7aba2b35bc12a88d2b2b1efd2efc096",
|
||||
"1962da4e017cd117dea42bc4d6d112a1",
|
||||
"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":
|
||||
"658aaa61c874cf9fda0e9b420a1ce703",
|
||||
"56ace18f08e6531df8fcdbc258db5a84",
|
||||
"src/libANGLE/capture/capture_gles_1_0_autogen.cpp":
|
||||
"7ec7ef8f779b809a45d74b97502c419b",
|
||||
"src/libANGLE/capture/capture_gles_1_0_autogen.h":
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"scripts/gl_angle_ext.xml":
|
||||
"474989440f980a079935dff3ab4d7b24",
|
||||
"scripts/registry_xml.py":
|
||||
"b7aba2b35bc12a88d2b2b1efd2efc096",
|
||||
"1962da4e017cd117dea42bc4d6d112a1",
|
||||
"src/libANGLE/capture/gl_enum_utils_autogen.cpp":
|
||||
"2ea097051161668c1cef088043707735",
|
||||
"src/libANGLE/capture/gl_enum_utils_autogen.h":
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
"src/compiler/translator/Operator_autogen.h":
|
||||
"cdaafd06e84ef6a8e4721678d622d844",
|
||||
"src/compiler/translator/SymbolTable_ESSL_autogen.cpp":
|
||||
"d5aee25a82129a6fc7ae042a85a3cfdf",
|
||||
"3dd0c9b8e03b010e9644e5574480158f",
|
||||
"src/compiler/translator/SymbolTable_autogen.cpp":
|
||||
"21d720b15db0dc774066d94da8635708",
|
||||
"2a521e5bcffe7bf36b60de5307688fdb",
|
||||
"src/compiler/translator/SymbolTable_autogen.h":
|
||||
"291eba34a070f5fddbf2827a1577c598",
|
||||
"src/compiler/translator/builtin_function_declarations.txt":
|
||||
"cd5f022686be7e13174b672d6b32fc6d",
|
||||
"src/compiler/translator/builtin_variables.json":
|
||||
"c8024a2d16554f32a8bc9e3f096772f7",
|
||||
"de6accceb23ac374122a14dd80584eaa",
|
||||
"src/compiler/translator/gen_builtin_symbols.py":
|
||||
"74ac1eb203c04abfbb81174c5fdb257d",
|
||||
"src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h":
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"scripts/gl_angle_ext.xml":
|
||||
"474989440f980a079935dff3ab4d7b24",
|
||||
"scripts/registry_xml.py":
|
||||
"b7aba2b35bc12a88d2b2b1efd2efc096",
|
||||
"1962da4e017cd117dea42bc4d6d112a1",
|
||||
"scripts/wgl.xml":
|
||||
"c36001431919e1c435f1215a85f7e1db",
|
||||
"src/libGL/proc_table_wgl_autogen.cpp":
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"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",
|
||||
|
|
|
@ -40,6 +40,7 @@ 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",
|
||||
|
|
|
@ -426,7 +426,8 @@ 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);
|
||||
auto it =
|
||||
mExtensionBehavior.find(TExtension::ANGLE_base_vertex_base_instance_shader_builtin);
|
||||
if (it != mExtensionBehavior.end())
|
||||
{
|
||||
mExtensionBehavior.erase(it);
|
||||
|
@ -860,7 +861,8 @@ bool TCompiler::checkAndSimplifyAST(TIntermBlock *root,
|
|||
}
|
||||
|
||||
if (mShaderType == GL_VERTEX_SHADER &&
|
||||
IsExtensionEnabled(mExtensionBehavior, TExtension::ANGLE_base_vertex_base_instance))
|
||||
IsExtensionEnabled(mExtensionBehavior,
|
||||
TExtension::ANGLE_base_vertex_base_instance_shader_builtin))
|
||||
{
|
||||
if ((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0)
|
||||
{
|
||||
|
@ -1158,7 +1160,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) &&
|
||||
TExtension::ANGLE_base_vertex_base_instance_shader_builtin) &&
|
||||
(compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0;
|
||||
|
||||
if (lookForDrawID || lookForBaseVertexBaseInstance)
|
||||
|
@ -1256,7 +1258,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:" << mResources.ANGLE_base_vertex_base_instance
|
||||
<< ":ANGLE_base_vertex_base_instance_shader_builtin:" << mResources.ANGLE_base_vertex_base_instance_shader_builtin
|
||||
<< ":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
|
||||
|
|
|
@ -12,47 +12,47 @@
|
|||
|
||||
#include <string.h>
|
||||
|
||||
#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) \
|
||||
#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) \
|
||||
OP(WEBGL_video_texture)
|
||||
|
||||
namespace sh
|
||||
|
|
|
@ -19,7 +19,7 @@ enum class TExtension : uint8_t
|
|||
{
|
||||
UNDEFINED, // Special value used to indicate no extension.
|
||||
|
||||
ANGLE_base_vertex_base_instance,
|
||||
ANGLE_base_vertex_base_instance_shader_builtin,
|
||||
ANGLE_multi_draw,
|
||||
ANGLE_texture_multisample,
|
||||
APPLE_clip_distance,
|
||||
|
|
|
@ -125,9 +125,9 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
|
|||
{
|
||||
extBehavior[TExtension::ANGLE_multi_draw] = EBhUndefined;
|
||||
}
|
||||
if (resources.ANGLE_base_vertex_base_instance)
|
||||
if (resources.ANGLE_base_vertex_base_instance_shader_builtin)
|
||||
{
|
||||
extBehavior[TExtension::ANGLE_base_vertex_base_instance] = EBhUndefined;
|
||||
extBehavior[TExtension::ANGLE_base_vertex_base_instance_shader_builtin] = EBhUndefined;
|
||||
}
|
||||
if (resources.WEBGL_video_texture)
|
||||
{
|
||||
|
|
|
@ -191,47 +191,48 @@ 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->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->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->MaxClipDistances = 8;
|
||||
resources->MaxCullDistances = 8;
|
||||
|
|
|
@ -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, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kangle_BaseVertex(BuiltInId::angle_BaseVertex,
|
||||
BuiltInName::angle_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseInstance(BuiltInId::gl_BaseInstance,
|
||||
BuiltInName::gl_BaseInstance,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseVertex(BuiltInId::gl_BaseVertex,
|
||||
BuiltInName::gl_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kangle_BaseInstance(
|
||||
BuiltInId::angle_BaseInstance,
|
||||
BuiltInName::angle_BaseInstance,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kangle_BaseVertex(
|
||||
BuiltInId::angle_BaseVertex,
|
||||
BuiltInName::angle_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseInstance(
|
||||
BuiltInId::gl_BaseInstance,
|
||||
BuiltInName::gl_BaseInstance,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseVertex(
|
||||
BuiltInId::gl_BaseVertex,
|
||||
BuiltInName::gl_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_DrawID(BuiltInId::gl_DrawID,
|
||||
BuiltInName::gl_DrawID,
|
||||
SymbolType::BuiltIn,
|
||||
|
@ -21013,13 +21013,25 @@ constexpr SymbolRule kRules[] = {
|
|||
Rule::Get<Spec::ESSL, 300, Shader::VERTEX, 0>(&BuiltInVariable::kgl_VertexID),
|
||||
Rule::Get<Spec::ESSL, 0, Shader::VERTEX, EXT_INDEX(ANGLE_multi_draw)>(
|
||||
&BuiltInVariable::kgl_DrawID),
|
||||
Rule::Get<Spec::ESSL, 300, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
300,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kgl_BaseVertex),
|
||||
Rule::Get<Spec::ESSL, 300, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
300,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kgl_BaseInstance),
|
||||
Rule::Get<Spec::ESSL, 0, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
0,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kangle_BaseVertex),
|
||||
Rule::Get<Spec::ESSL, 0, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
0,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kangle_BaseInstance),
|
||||
Rule::Get<Spec::ESSL, 310, Shader::COMPUTE, 0>(&BuiltInVariable::kgl_NumWorkGroups),
|
||||
Rule::Get<Spec::ESSL, 310, Shader::COMPUTE, 0>(&BuiltInVariable::kgl_WorkGroupSize),
|
||||
|
|
|
@ -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, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kangle_BaseVertex(BuiltInId::angle_BaseVertex,
|
||||
BuiltInName::angle_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseInstance(BuiltInId::gl_BaseInstance,
|
||||
BuiltInName::gl_BaseInstance,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseVertex(BuiltInId::gl_BaseVertex,
|
||||
BuiltInName::gl_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{
|
||||
{TExtension::ANGLE_base_vertex_base_instance}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kangle_BaseInstance(
|
||||
BuiltInId::angle_BaseInstance,
|
||||
BuiltInName::angle_BaseInstance,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kangle_BaseVertex(
|
||||
BuiltInId::angle_BaseVertex,
|
||||
BuiltInName::angle_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseInstance(
|
||||
BuiltInId::gl_BaseInstance,
|
||||
BuiltInName::gl_BaseInstance,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_BaseVertex(
|
||||
BuiltInId::gl_BaseVertex,
|
||||
BuiltInName::gl_BaseVertex,
|
||||
SymbolType::BuiltIn,
|
||||
std::array<TExtension, 1u>{{TExtension::ANGLE_base_vertex_base_instance_shader_builtin}},
|
||||
StaticType::Get<EbtInt, EbpHigh, EvqUniform, 1, 1>());
|
||||
constexpr const TVariable kgl_DrawID(BuiltInId::gl_DrawID,
|
||||
BuiltInName::gl_DrawID,
|
||||
SymbolType::BuiltIn,
|
||||
|
@ -34597,13 +34597,25 @@ constexpr SymbolRule kRules[] = {
|
|||
Rule::Get<Spec::GLSL, 0, Shader::VERTEX, 0>(&BuiltInVariable::kgl_VertexID),
|
||||
Rule::Get<Spec::ESSL, 0, Shader::VERTEX, EXT_INDEX(ANGLE_multi_draw)>(
|
||||
&BuiltInVariable::kgl_DrawID),
|
||||
Rule::Get<Spec::ESSL, 300, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
300,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kgl_BaseVertex),
|
||||
Rule::Get<Spec::ESSL, 300, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
300,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kgl_BaseInstance),
|
||||
Rule::Get<Spec::ESSL, 0, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
0,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kangle_BaseVertex),
|
||||
Rule::Get<Spec::ESSL, 0, Shader::VERTEX, EXT_INDEX(ANGLE_base_vertex_base_instance)>(
|
||||
Rule::Get<Spec::ESSL,
|
||||
0,
|
||||
Shader::VERTEX,
|
||||
EXT_INDEX(ANGLE_base_vertex_base_instance_shader_builtin)>(
|
||||
&BuiltInVariable::kangle_BaseInstance),
|
||||
Rule::Get<Spec::ESSL, 310, Shader::COMPUTE, 0>(&BuiltInVariable::kgl_NumWorkGroups),
|
||||
Rule::Get<Spec::GLSL, 0, Shader::COMPUTE, 0>(&BuiltInVariable::kgl_NumWorkGroups),
|
||||
|
|
|
@ -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)
|
||||
else if (iter->first == TExtension::ANGLE_base_vertex_base_instance_shader_builtin)
|
||||
{
|
||||
// Don't emit anything. This extension is emulated
|
||||
ASSERT((compileOptions & SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE) != 0);
|
||||
|
|
|
@ -1091,7 +1091,7 @@
|
|||
"variables":{
|
||||
"gl_BaseVertex":{
|
||||
"essl_level":"ESSL3_BUILTINS",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin",
|
||||
"type":{
|
||||
"basic":"Int",
|
||||
"precision":"High",
|
||||
|
@ -1100,7 +1100,7 @@
|
|||
},
|
||||
"gl_BaseInstance":{
|
||||
"essl_level":"ESSL3_BUILTINS",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin",
|
||||
"type":{
|
||||
"basic":"Int",
|
||||
"precision":"High",
|
||||
|
@ -1109,7 +1109,7 @@
|
|||
},
|
||||
"angle_BaseVertex":{
|
||||
"essl_level":"COMMON_BUILTINS",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin",
|
||||
"type":{
|
||||
"basic":"Int",
|
||||
"precision":"High",
|
||||
|
@ -1118,7 +1118,7 @@
|
|||
},
|
||||
"angle_BaseInstance":{
|
||||
"essl_level":"COMMON_BUILTINS",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance",
|
||||
"essl_extension":"ANGLE_base_vertex_base_instance_shader_builtin",
|
||||
"type":{
|
||||
"basic":"Int",
|
||||
"precision":"High",
|
||||
|
|
|
@ -112,11 +112,12 @@ 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 = extensions.baseVertexBaseInstanceANGLE;
|
||||
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_shader_builtin =
|
||||
extensions.baseVertexBaseInstanceShaderBuiltinANGLE;
|
||||
mResources.APPLE_clip_distance = extensions.clipDistanceAPPLE;
|
||||
// OES_shader_multisample_interpolation
|
||||
mResources.OES_shader_multisample_interpolation = extensions.shaderMultisampleInterpolationOES;
|
||||
mResources.OES_shader_image_atomic = extensions.shaderImageAtomicOES;
|
||||
|
|
|
@ -312,6 +312,7 @@
|
|||
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 */ \
|
||||
|
|
|
@ -4444,7 +4444,7 @@ void Program::postResolveLink(const gl::Context *context)
|
|||
mState.mDrawIDLocation = getUniformLocation("gl_DrawID").value;
|
||||
}
|
||||
|
||||
if (context->getExtensions().baseVertexBaseInstanceANGLE)
|
||||
if (context->getExtensions().baseVertexBaseInstanceShaderBuiltinANGLE)
|
||||
{
|
||||
mState.mBaseVertexLocation = getUniformLocation("gl_BaseVertex").value;
|
||||
mState.mBaseInstanceLocation = getUniformLocation("gl_BaseInstance").value;
|
||||
|
|
|
@ -398,7 +398,7 @@ class ProgramState final : angle::NonCopyable
|
|||
// GL_ANGLE_multi_draw
|
||||
int mDrawIDLocation;
|
||||
|
||||
// GL_ANGLE_base_vertex_base_instance
|
||||
// GL_ANGLE_base_vertex_base_instance_shader_builtin
|
||||
int mBaseVertexLocation;
|
||||
int mBaseInstanceLocation;
|
||||
// Cached value of base vertex and base instance
|
||||
|
|
|
@ -342,8 +342,7 @@ 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 |
|
||||
SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE);
|
||||
ShCompileOptions options = (SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_DRAW_ID);
|
||||
|
||||
// Add default options to WebGL shaders to prevent unexpected behavior during
|
||||
// compilation.
|
||||
|
@ -355,6 +354,12 @@ 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
|
||||
|
|
|
@ -194,6 +194,7 @@ 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);
|
||||
|
|
|
@ -529,6 +529,9 @@ 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;
|
||||
|
||||
|
|
|
@ -1648,10 +1648,11 @@ void GenerateCaps(ID3D11Device *device,
|
|||
extensions->provokingVertexANGLE = true;
|
||||
extensions->blendFuncExtendedEXT = true;
|
||||
// http://anglebug.com/4926
|
||||
extensions->texture3DOES = false;
|
||||
extensions->baseVertexBaseInstanceANGLE = true;
|
||||
extensions->drawElementsBaseVertexOES = true;
|
||||
extensions->drawElementsBaseVertexEXT = true;
|
||||
extensions->texture3DOES = false;
|
||||
extensions->baseVertexBaseInstanceANGLE = true;
|
||||
extensions->baseVertexBaseInstanceShaderBuiltinANGLE = true;
|
||||
extensions->drawElementsBaseVertexOES = true;
|
||||
extensions->drawElementsBaseVertexEXT = true;
|
||||
if (!strstr(description, "Adreno"))
|
||||
{
|
||||
extensions->multisampledRenderToTextureEXT = true;
|
||||
|
|
|
@ -1692,6 +1692,9 @@ 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)) ||
|
||||
|
|
|
@ -382,7 +382,8 @@ void RendererVk::ensureCapsInitialized() const
|
|||
mNativeExtensions.multiDrawIndirectEXT = true;
|
||||
|
||||
// Enable ANGLE_base_vertex_base_instance
|
||||
mNativeExtensions.baseVertexBaseInstanceANGLE = true;
|
||||
mNativeExtensions.baseVertexBaseInstanceANGLE = true;
|
||||
mNativeExtensions.baseVertexBaseInstanceShaderBuiltinANGLE = true;
|
||||
|
||||
// Enable OES/EXT_draw_elements_base_vertex
|
||||
mNativeExtensions.drawElementsBaseVertexOES = true;
|
||||
|
|
|
@ -21,17 +21,19 @@ class EmulateGLBaseVertexBaseInstanceTest : public MatchOutputCodeTest
|
|||
EmulateGLBaseVertexBaseInstanceTest()
|
||||
: MatchOutputCodeTest(GL_VERTEX_SHADER, SH_VARIABLES, SH_GLSL_COMPATIBILITY_OUTPUT)
|
||||
{
|
||||
getResources()->ANGLE_base_vertex_base_instance = 1;
|
||||
getResources()->ANGLE_base_vertex_base_instance_shader_builtin = 1;
|
||||
}
|
||||
|
||||
protected:
|
||||
void CheckCompileFailure(const std::string &shaderString, const char *expectedError = nullptr)
|
||||
void CheckCompileFailure(const std::string &shaderString,
|
||||
const char *expectedError = nullptr,
|
||||
ShCompileOptions compileOptions = SH_VARIABLES)
|
||||
{
|
||||
std::string translatedCode;
|
||||
std::string infoLog;
|
||||
bool success = compileTestShader(GL_VERTEX_SHADER, SH_GLES3_SPEC,
|
||||
SH_GLSL_COMPATIBILITY_OUTPUT, shaderString, getResources(),
|
||||
SH_VARIABLES, &translatedCode, &infoLog);
|
||||
compileOptions, &translatedCode, &infoLog);
|
||||
EXPECT_FALSE(success);
|
||||
if (expectedError)
|
||||
{
|
||||
|
@ -45,25 +47,39 @@ class EmulateGLBaseVertexBaseInstanceTest : public MatchOutputCodeTest
|
|||
TEST_F(EmulateGLBaseVertexBaseInstanceTest, RequiresEmulation)
|
||||
{
|
||||
CheckCompileFailure(
|
||||
"#extension GL_ANGLE_base_vertex_base_instance : require\n"
|
||||
"#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",
|
||||
"extension is not supported");
|
||||
}
|
||||
|
||||
// Check that compiling with emulation with gl_BaseVertex and gl_BaseInstance works with different
|
||||
// shader versions
|
||||
// Check that compiling with emulation with gl_BaseVertex and gl_BaseInstance works
|
||||
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";
|
||||
|
||||
compile("#version 300 es\n" + shaderString,
|
||||
SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE);
|
||||
CheckCompileFailure(shaderString, "extension is not supported",
|
||||
SH_OBJECT_CODE | SH_VARIABLES | SH_EMULATE_GL_BASE_VERTEX_BASE_INSTANCE);
|
||||
}
|
||||
|
||||
// Check that gl_BaseVertex and gl_BaseInstance is properly emulated
|
||||
|
@ -81,7 +97,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, EmulatesUniform)
|
|||
|
||||
const std::string &shaderString =
|
||||
"#version 300 es\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance : require\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";
|
||||
|
@ -92,7 +108,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"));
|
||||
EXPECT_TRUE(notFoundInCode("GL_ANGLE_base_vertex_base_instance_shader_builtin"));
|
||||
|
||||
EXPECT_TRUE(foundInCode(SH_GLSL_COMPATIBILITY_OUTPUT, "uniform int angle_BaseVertex"));
|
||||
EXPECT_TRUE(foundInCode(SH_GLSL_COMPATIBILITY_OUTPUT, "uniform int angle_BaseInstance"));
|
||||
|
@ -144,7 +160,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 : require\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n"
|
||||
"uniform int gl_BaseVertex;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(float(gl_BaseVertex), 0.0, 0.0, 1.0);\n"
|
||||
|
@ -153,7 +169,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID)
|
|||
|
||||
CheckCompileFailure(
|
||||
"#version 300 es\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance : require\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n"
|
||||
"uniform int gl_BaseInstance;\n"
|
||||
"void main() {\n"
|
||||
" gl_Position = vec4(float(gl_BaseInstance), 0.0, 0.0, 1.0);\n"
|
||||
|
@ -162,7 +178,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID)
|
|||
|
||||
CheckCompileFailure(
|
||||
"#version 300 es\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance : require\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n"
|
||||
"void main() {\n"
|
||||
" int gl_BaseVertex = 0;\n"
|
||||
" gl_Position = vec4(float(gl_BaseVertex), 0.0, 0.0, 1.0);\n"
|
||||
|
@ -171,7 +187,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, DisallowsUserDefinedGLDrawID)
|
|||
|
||||
CheckCompileFailure(
|
||||
"#version 300 es\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance : require\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n"
|
||||
"void main() {\n"
|
||||
" int gl_BaseInstance = 0;\n"
|
||||
" gl_Position = vec4(float(gl_BaseInstance), 0.0, 0.0, 1.0);\n"
|
||||
|
@ -195,7 +211,7 @@ TEST_F(EmulateGLBaseVertexBaseInstanceTest, AllowsUserDefinedANGLEDrawID)
|
|||
|
||||
const std::string &shaderString =
|
||||
"#version 300 es\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance : require\n"
|
||||
"#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n"
|
||||
"uniform int angle_BaseVertex;\n"
|
||||
"uniform int angle_BaseInstance;\n"
|
||||
"void main() {\n"
|
||||
|
|
|
@ -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 : require\n")
|
||||
<< ("#extension GL_ANGLE_base_vertex_base_instance_shader_builtin : require\n")
|
||||
<< "#define kCountX " << kCountX << "\n"
|
||||
<< "#define kCountY " << kCountY << "\n"
|
||||
<< R"(
|
||||
|
@ -432,6 +432,11 @@ 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -339,7 +339,12 @@ void main()
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return EnsureGLExtensionEnabled("GL_ANGLE_base_vertex_base_instance");
|
||||
if (!EnsureGLExtensionEnabled("GL_ANGLE_base_vertex_base_instance"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return EnsureGLExtensionEnabled("GL_ANGLE_base_vertex_base_instance_shader_builtin");
|
||||
}
|
||||
|
||||
bool requestNativeBaseVertexExtensions()
|
||||
|
|
Загрузка…
Ссылка в новой задаче