• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Name
2
3    ANGLE_base_vertex_base_instance_shader_builtin
4
5Name Strings
6
7    GL_ANGLE_base_vertex_base_instance_shader_builtin
8
9Contributors
10
11    Shrek Shao, Google Inc.
12    Contributors to the ANGLE_base_vertex_base_instance specification
13    Contributors to the ARB_shader_draw_parameters specification
14
15Contact
16
17    Shrek Shao (shrekshao 'at' google.com)
18
19Status
20
21    Incomplete
22
23Version
24
25    Last Modified Date: Nov 19, 2021
26    Author Revision: 1
27
28Number
29
30    OpenGL ES Extension XX
31
32Dependencies
33
34    The extension is based on ANGLE_base_vertex_base_instance, all limitations of which
35    apply to this extension.
36
37Overview
38
39    This extension is based on ANGLE_base_vertex_base_instance. It should be enabled
40    only if ANGLE_base_vertex_base_instance is enabled.
41
42    Additional to the functionality exposed by ANGLE_base_vertex_base_instance,
43    <gl_BaseVertex> and <gl_BaseInstance> builtins are added to the shading language.
44    For any *BaseVertex* draw call variant, the <baseVertex> of the draw may be
45    read by the vertex shader as <gl_BaseVertex>. For non *BaseVertex* calls,
46    the value of <gl_BaseVertex> is 0.
47    For any *BaseInstance draw call variant, the baseInstance of the draw may
48    be read by the vertex shader as <gl_BaseInstance>. For non *BaseInstance
49    calls, the value of <gl_BaseInstance> is 0.
50
51IP Status
52
53    No known IP claims.
54
55New Procedures and Functions
56
57    None.
58
59New Tokens
60
61    None.
62
63Additions to Chapter 10 of the OpenGL ES 3.2 Specification
64
65    Section 10.5 Drawing Commands Using Vertex Arrays:
66
67    The base index of the instance may be read by a vertex shader as
68    <gl_BaseInstance>, for the commands
69
70    void DrawArraysInstancedBaseInstanceANGLE(
71        enum mode,
72        int first,
73        sizei count,
74        sizei instanceCount,
75        uint baseInstance);
76
77    and
78
79    void MultiDrawArraysInstancedBaseInstanceANGLE(
80        enum mode,
81        const int *firsts,
82        const sizei *counts,
83        const sizei *instanceCounts,
84        const uint *baseInstances,
85        sizei drawcount);
86
87    The base index of the vertex may be read by a vertex shader as
88    <gl_BaseVertex>. This value is also added to the <gl_VertexID>.
89
90    The base index of the instance may be read by a vertex shader as
91    <gl_BaseInstance>. Note that this value is not added to the
92    <gl_InstanceID>, for the commands
93
94    void DrawElementsInstancedBaseVertexBaseInstanceANGLE(
95        enum mode,
96        sizei count,
97        enum type,
98        const void *indices,
99        sizei instanceCount,
100        int baseVertex,
101        uint baseInstance);
102
103    and
104
105    void MultiDrawElementsInstancedBaseVertexBaseInstanceANGLE(
106        enum mode,
107        const sizei *counts,
108        enum type,
109        const void *const *indices,
110        const sizei *instanceCounts,
111        const int *baseVertices,
112        const uint *baseInstances,
113        sizei drawcount);
114
115Errors
116
117    None.
118
119Modifications to the OpenGL ES Shading Language Specification, Version 3.00
120
121    Including the following line in a shader controls the
122    language featured described in this extension:
123
124      #extension GL_ANGLE_base_vertex_base_instance_shader_builtin : <behavior>
125
126    where <behavior> is as specified in section 3.5.
127
128    A new preprocessor #define is added to the OpenGL ES Shading Language:
129
130      #define GL_ANGLE_base_vertex_base_instance_shader_builtin 1
131
132
133Issues
134
135    None
136
137Revision History
138
139    Rev.    Date    Author            Changes
140    ----  --------  ----------------  --------------------------------------------
141    1     11/19/21   Shrek Shao       First revision.
142    2     06/21/22   Alexey Knyazev   Fixed typos and type usage.
143