mirrored from https://chromium.googlesource.com/angle/angle
-
Notifications
You must be signed in to change notification settings - Fork 620
/
ANGLE_provoking_vertex.txt
136 lines (88 loc) · 4.51 KB
/
ANGLE_provoking_vertex.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
Name
ANGLE_provoking_vertex
Name Strings
GL_ANGLE_provoking_vertex
Status
Complete
Version
Last Modified Date: Nov 1, 2022
Author Revision: 1
Number
OpenGL ES Extension XX
Dependencies
OpenGL ES 3.0 is required.
This extension is written against the OpenGL ES 3.0 specification.
OES_geometry_shader and EXT_geometry_shader interact with this extension.
Overview
This extension provides an alternative provoking vertex convention
for rendering lines and triangles.
The provoking vertex of a primitive is the vertex that determines the
constant output values when "flat" interpolation qualifier is used.
In OpenGL ES, the provoking vertex for triangle, line, and (trivially)
point primitives is the last vertex used to assemble the primitive.
Alternatively the provoking vertex could be the first vertex of
the primitive. Other APIs have adopted the "first vertex of the
primitive" convention to determine the provoking vertex.
The motivation for this extension is to allow convention-agnostic
applications to have better performance when running on top of layered
implementations of OpenGL ES (such as ANGLE) that use native APIs with
the "first vertex of the primitive" provoking vertex convention.
New Procedures and Functions
void ProvokingVertexANGLE(enum provokeMode);
New Tokens
Accepted by the <provokeMode> parameter of ProvokingVertex:
FIRST_VERTEX_CONVENTION_ANGLE 0x8E4D
LAST_VERTEX_CONVENTION_ANGLE 0x8E4E
Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
GetFloatv, and GetDoublev:
PROVOKING_VERTEX_ANGLE 0x8E4F
Additions to Chapter 2 of the OpenGL ES 3.0 Specification (OpenGL ES Operation)
Modify Section 2.17 "Flatshading"
(replace Table 2.12)
First vertex Last vertex
Primitive type of polygon i convention convention
=========================== ============ =============
point i i
independent line 2i-1 2i
line loop i i+1, if i<n
1, if i==n
line strip i i+1
independent triangle 3i-2 3i
triangle strip i i+2
triangle fan i+1 i+2
line adjacency 4i-2 4i-1
line strip adjacency i+1 i+2
triangle adjacency 6i-5 6i-1
triangle strip adjacency 2i-1 2i+3
Table 2.12: Provoking vertex selection. The output values used for
flatshading the <i>th primitive generated by drawing commands with the
indicated primitive type are derived from the corresponding values of
the vertex whose index is shown in the table. Vertices are numbered 1
through n, where n is the number of vertices drawn.
(add after the second paragraph)
The provoking vertex is controlled with the command
void ProvokingVertexANGLE(enum provokeMode);
<provokeMode> must be either FIRST_VERTEX_CONVENTION_ANGLE or
LAST_VERTEX_CONVENTION_ANGLE, and controls selection of the vertex whose
values are assigned to varying outputs, as shown in Table 2.12.
The state required for flatshading is one bit for the provoking vertex
mode. The initial value of the provoking vertex mode is
LAST_VERTEX_CONVENTION_ANGLE.
Dependencies on OES_geometry_shader, EXT_geometry_shader, and/or the geometry
shader functionality integrated into the core by OpenGL ES 3.2:
If none of OES_geometry_shader, EXT_geometry_shader, or OpenGL ES 3.2
are supported:
* ignore the rows of table 2.12 for line adjacency, line strip
adjacency, triangle adjacency, and triangle strip adjacency.
Errors
INVALID_ENUM is generated when ProvokingVertexANGLE is called with a
<provokeMode> that is not either FIRST_VERTEX_CONVENTION_ANGLE or
LAST_VERTEX_CONVENTION_ANGLE.
New State
(add a new table "Coloring" after the table 6.5)
Get Value Type Get Command Initial Value Description Sec
---------------- ---- ----------- ---------------------------- ---------------- ----
PROVOKING_VERTEX_ANGLE Z2 GetIntegerv LAST_VERTEX_CONVENTION_ANGLE Provoking vertex 2.17
convention
Revision History
11/1/2022 First revision