Skip to content

Commit a01a566

Browse files
tychoAngle LUCI CQ
authored andcommitted
extension xmls: fix incorrect use of <ptype> tags
I was having trouble using some GL/EGL loader generators because of some errors in the XML definitions for ANGLE. The first major problem is the content of the <ptype> tags. Let's refer to the Khronos registry XML schema (which is annoyingly a PDF rather than an xsd that we can test against, though I don't know if an xsd would catch this anyway): https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/master/xml/readme.pdf In section 12.4.2, "Contents of <param> tags" it states: The <ptype> tag is optional, and contains text which is a valid type name found in <type> tag, and indicates that this type must be previously defined for the definition of the command to succeed. Builtin C types, and any derived types which are expected to be found in other header files, should not be wrapped in <ptype> tags Note that the above is repeated for the contents of <proto> tags as well. The extension XML files currently have a bunch of <ptype> tags which don't meet the expectations described above. The correct transformation for them would be, for example: <ptype>GLfloat *</ptype> -> <ptype>GLfloat</ptype> * <ptype>void *</ptype> -> void * <ptype>const char *</ptype> -> const char * <ptype>EGLAttrib *</ptype> -> <ptype>EGLAttrib</ptype> * The next issue is that some tags have some typos, such as "<pytpe>" instead of "<ptype>". (Now *that* is something an .xsd would catch...) The last issue is the use of the typename "GLvoid" which is not as serious a problem. It is still defined in Khronos' gl.xml <types> block, but Khronos no longer uses it in their XML registries. The comment for the "GLvoid" type in their <types> block states: <type comment="Not an actual GL type, though used in headers in the past">typedef void <name>GLvoid</name>;</type> So we might as well replace those with just plain "void". Anyway, long story short: to apply these transformations, I used Perl regular expressions, and applied these expressions in order: - Fix the tag misspellings: s#<(/?)pytpe>#<\1ptype>#g - Move the const qualifiers (if present) and pointer asterisk(s) (if any) outside the <ptype> tag itself: s#<ptype>(const )?([A-Za-z0-9]+)[ ]?(\*\*?)</ptype> #\1<ptype>\2</ptype> \3#g - Replace "GLvoid", "char", and "void" inside ptype tags to normal C types outside tags: s#<ptype>(GLvoid|void|char)</ptype>#\1#g Bug: angleproject:8190 Change-Id: Ib0bea79fecb7e714910b6e92124bb9f52994d0fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4603709 Commit-Queue: Shahbaz Youssefi <[email protected]> Reviewed-by: Shahbaz Youssefi <[email protected]>
1 parent d55c91c commit a01a566

19 files changed

+283
-336
lines changed

scripts/code_generation_hashes/Extension_files.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"doc/ExtensionSupport.md":
33
"26ed834d77af164e60e4304d029779f7",
44
"scripts/egl_angle_ext.xml":
5-
"2b6fe304b0425d0fa79f65b8bba30e23",
5+
"7ae2be7840b4dbf9db875688847606d4",
66
"scripts/extension_data/intel_630_linux.json":
77
"3b86832de6a7095f4617e273cba6d45e",
88
"scripts/extension_data/intel_630_win10.json":
@@ -20,7 +20,7 @@
2020
"scripts/extension_data/swiftshader_win10_gles1.json":
2121
"bea8e2106d62e1ea0e8938f150865a37",
2222
"scripts/gl_angle_ext.xml":
23-
"758f78e8bf6447f118643421110728b7",
23+
"49a0bf469d6f44c532098ef3a9fd087f",
2424
"scripts/registry_xml.py":
2525
"2175daaec34d2e6fe763d0c3efa93dea",
2626
"src/libANGLE/gen_extensions.py":

scripts/code_generation_hashes/GL_EGL_WGL_loader.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"2b6fe304b0425d0fa79f65b8bba30e23",
3+
"7ae2be7840b4dbf9db875688847606d4",
44
"scripts/generate_loader.py":
55
"93c78a8d11323fa311fed5118fbcf083",
66
"scripts/gl_angle_ext.xml":
7-
"758f78e8bf6447f118643421110728b7",
7+
"49a0bf469d6f44c532098ef3a9fd087f",
88
"scripts/registry_xml.py":
99
"2175daaec34d2e6fe763d0c3efa93dea",
1010
"src/libEGL/egl_loader_autogen.cpp":

scripts/code_generation_hashes/GL_EGL_entry_points.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"2b6fe304b0425d0fa79f65b8bba30e23",
3+
"7ae2be7840b4dbf9db875688847606d4",
44
"scripts/entry_point_packed_egl_enums.json":
55
"a72ae855c6b403912103b519139951a1",
66
"scripts/entry_point_packed_gl_enums.json":
77
"1c6b036918aabb9822a638fbf33f87f4",
88
"scripts/generate_entry_points.py":
99
"af2e7b9911842300f7cbdd3230e279cb",
1010
"scripts/gl_angle_ext.xml":
11-
"758f78e8bf6447f118643421110728b7",
11+
"49a0bf469d6f44c532098ef3a9fd087f",
1212
"scripts/registry_xml.py":
1313
"2175daaec34d2e6fe763d0c3efa93dea",
1414
"src/common/entry_points_enum_autogen.cpp":
1515
"9b818507180794d2c4a389d2260b40f5",
1616
"src/common/entry_points_enum_autogen.h":
1717
"344e665a9078882621b4b7b6f578a675",
1818
"src/common/frame_capture_utils_autogen.cpp":
19-
"cfb63f4c08a0f519a2f84f34f2f95060",
19+
"1984fe7b49b4d8fce4decbca540f71e0",
2020
"src/common/frame_capture_utils_autogen.h":
21-
"ee154690fc771e60fe7c7a9276e14d24",
21+
"48a21fd19220368da07e3e211ac8a188",
2222
"src/libANGLE/Context_gl_1_autogen.h":
2323
"47775529739b839b2e58db334050cfb0",
2424
"src/libANGLE/Context_gl_2_autogen.h":
@@ -38,7 +38,7 @@
3838
"src/libANGLE/Context_gles_3_2_autogen.h":
3939
"48567dca16fd881dfe6d61fee0e3106f",
4040
"src/libANGLE/Context_gles_ext_autogen.h":
41-
"95a6c31138fd76ceee2c2e37f1a88167",
41+
"77046ddf577d922a38845e8b4de6aac0",
4242
"src/libANGLE/capture/capture_egl_autogen.cpp":
4343
"a5b8f710309de8deab29f2e9d6414cd5",
4444
"src/libANGLE/capture/capture_egl_autogen.h":
@@ -80,9 +80,9 @@
8080
"src/libANGLE/capture/capture_gles_3_2_autogen.h":
8181
"74ed7366af3a46c0661397cfa29ec6fc",
8282
"src/libANGLE/capture/capture_gles_ext_autogen.cpp":
83-
"544c69a74a68eb1ee46a32ff707ae584",
83+
"158bce866c1a96f27602c6869401c299",
8484
"src/libANGLE/capture/capture_gles_ext_autogen.h":
85-
"f9233670a035b6281d72a2a8fa8f4a75",
85+
"acd990d31580a461eedcda4f60f7788b",
8686
"src/libANGLE/validationCL_autogen.h":
8787
"0022d0cdb6a9e2ef4a59b71164f62333",
8888
"src/libANGLE/validationEGL_autogen.h":
@@ -98,7 +98,7 @@
9898
"src/libANGLE/validationES3_autogen.h":
9999
"ffffaca63434b2b419614ddb25a57149",
100100
"src/libANGLE/validationESEXT_autogen.h":
101-
"47ddd7781adf5e7f4654b26666033803",
101+
"1f6da3b21db0b645e37cd6efaf5e3c60",
102102
"src/libANGLE/validationGL1_autogen.h":
103103
"31ab724bc94d19745c4783a4ab12bc4f",
104104
"src/libANGLE/validationGL2_autogen.h":
@@ -168,11 +168,11 @@
168168
"src/libGLESv2/entry_points_gles_3_2_autogen.h":
169169
"647f932a299cdb4726b60bbba059f0d2",
170170
"src/libGLESv2/entry_points_gles_ext_autogen.cpp":
171-
"e6695455270bbda7da7e4f30838905d2",
171+
"827e15c2f31276f9207f9687a4bc4c7a",
172172
"src/libGLESv2/entry_points_gles_ext_autogen.h":
173-
"a410e5f079226a62a48222243c91231b",
173+
"7bb44566362d1de21552faf427517085",
174174
"src/libGLESv2/libGLESv2_autogen.cpp":
175-
"deba7e2f57d77c229da03fdae13a28b1",
175+
"1dc4a7b439ac3feaf927d3b7f25105a8",
176176
"src/libGLESv2/libGLESv2_autogen.def":
177177
"82c15ed192f3f1289933d596d676051e",
178178
"src/libGLESv2/libGLESv2_no_capture_autogen.def":
@@ -192,5 +192,5 @@
192192
"third_party/OpenGL-Registry/src/xml/wgl.xml":
193193
"eae784bf4d1b983a42af5671b140b7c4",
194194
"util/capture/frame_capture_replay_autogen.cpp":
195-
"af9fe33e00cf0f9269aad5bec76fb7dc"
195+
"d2da61e3c43d91abadada2e2ba103cd9"
196196
}

scripts/code_generation_hashes/GLenum_value_to_string_map.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"scripts/gen_gl_enum_utils.py":
33
"3ec60ab12923f4825b57fe183f2152b2",
44
"scripts/gl_angle_ext.xml":
5-
"758f78e8bf6447f118643421110728b7",
5+
"49a0bf469d6f44c532098ef3a9fd087f",
66
"scripts/registry_xml.py":
77
"2175daaec34d2e6fe763d0c3efa93dea",
88
"src/common/gl_enum_utils_autogen.cpp":

scripts/code_generation_hashes/interpreter_utils.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"2b6fe304b0425d0fa79f65b8bba30e23",
3+
"7ae2be7840b4dbf9db875688847606d4",
44
"scripts/gen_interpreter_utils.py":
55
"10ba16ee78604763fc883525dd275de8",
66
"scripts/gl_angle_ext.xml":
7-
"758f78e8bf6447f118643421110728b7",
7+
"49a0bf469d6f44c532098ef3a9fd087f",
88
"scripts/registry_xml.py":
99
"2175daaec34d2e6fe763d0c3efa93dea",
1010
"third_party/EGL-Registry/src/api/egl.xml":

scripts/code_generation_hashes/proc_table.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"scripts/egl_angle_ext.xml":
3-
"2b6fe304b0425d0fa79f65b8bba30e23",
3+
"7ae2be7840b4dbf9db875688847606d4",
44
"scripts/gen_proc_table.py":
55
"073351265b085943f816498cecaa281c",
66
"scripts/gl_angle_ext.xml":
7-
"758f78e8bf6447f118643421110728b7",
7+
"49a0bf469d6f44c532098ef3a9fd087f",
88
"scripts/registry_xml.py":
99
"2175daaec34d2e6fe763d0c3efa93dea",
1010
"src/libGLESv2/proc_table_cl_autogen.cpp":

scripts/egl_angle_ext.xml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<param><ptype>EGLint</ptype> <name>mode</name></param>
7777
</command>
7878
<command>
79-
<proto><ptype>const char *</ptype> <name>eglQueryStringiANGLE</name></proto>
79+
<proto>const char *<name>eglQueryStringiANGLE</name></proto>
8080
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
8181
<param><ptype>EGLint</ptype> <name>name</name></param>
8282
<param><ptype>EGLint</ptype> <name>index</name></param>
@@ -85,35 +85,35 @@
8585
<proto><ptype>EGLBoolean</ptype> <name>eglDisplayAttribANGLE</name></proto>
8686
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
8787
<param><ptype>EGLint</ptype> <name>attribute</name></param>
88-
<param><ptype>EGLAttrib *</ptype> <name>value</name></param>
88+
<param><ptype>EGLAttrib</ptype> *<name>value</name></param>
8989
</command>
9090
<command>
91-
<proto><pytpe>EGLBoolean</pytpe> <name>eglSwapBuffersWithFrameTokenANGLE</name></proto>
91+
<proto><ptype>EGLBoolean</ptype> <name>eglSwapBuffersWithFrameTokenANGLE</name></proto>
9292
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
9393
<param><ptype>EGLSurface</ptype> <name>surface</name></param>
9494
<param><ptype>EGLFrameTokenANGLE</ptype> <name>frametoken</name></param>
9595
</command>
9696
<command>
97-
<proto><pytpe>EGLBoolean</pytpe> <name>eglPrepareSwapBuffersANGLE</name></proto>
97+
<proto><ptype>EGLBoolean</ptype> <name>eglPrepareSwapBuffersANGLE</name></proto>
9898
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
9999
<param><ptype>EGLSurface</ptype> <name>surface</name></param>
100100
</command>
101101
<command>
102-
<proto><pytpe>void</pytpe> <name>eglReleaseHighPowerGPUANGLE</name></proto>
102+
<proto>void <name>eglReleaseHighPowerGPUANGLE</name></proto>
103103
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
104104
<param><ptype>EGLContext</ptype> <name>ctx</name></param>
105105
</command>
106106
<command>
107-
<proto><pytpe>void</pytpe> <name>eglReacquireHighPowerGPUANGLE</name></proto>
107+
<proto>void <name>eglReacquireHighPowerGPUANGLE</name></proto>
108108
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
109109
<param><ptype>EGLContext</ptype> <name>ctx</name></param>
110110
</command>
111111
<command>
112-
<proto><pytpe>void</pytpe> <name>eglHandleGPUSwitchANGLE</name></proto>
112+
<proto>void <name>eglHandleGPUSwitchANGLE</name></proto>
113113
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
114114
</command>
115115
<command>
116-
<proto><pytpe>void</pytpe> <name>eglForceGPUSwitchANGLE</name></proto>
116+
<proto>void <name>eglForceGPUSwitchANGLE</name></proto>
117117
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
118118
<param><ptype>EGLint</ptype> <name>gpuIDHigh</name></param>
119119
<param><ptype>EGLint</ptype> <name>gpuIDLow</name></param>
@@ -122,22 +122,22 @@
122122
<proto><ptype>EGLBoolean</ptype> <name>eglQueryDisplayAttribANGLE</name></proto>
123123
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
124124
<param><ptype>EGLint</ptype> <name>attribute</name></param>
125-
<param><ptype>EGLAttrib *</ptype> <name>value</name></param>
125+
<param><ptype>EGLAttrib</ptype> *<name>value</name></param>
126126
</command>
127127
<command>
128128
<proto><ptype>EGLBoolean</ptype> <name>eglExportVkImageANGLE</name></proto>
129129
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
130130
<param><ptype>EGLImage</ptype> <name>image</name></param>
131-
<param><ptype>void *</ptype> <name>vk_image</name></param>
132-
<param><ptype>void *</ptype> <name>vk_image_create_info</name></param>
131+
<param>void *<name>vk_image</name></param>
132+
<param>void *<name>vk_image_create_info</name></param>
133133
</command>
134134
<command>
135-
<proto><ptype>void *</ptype> <name>eglCopyMetalSharedEventANGLE</name></proto>
135+
<proto>void *<name>eglCopyMetalSharedEventANGLE</name></proto>
136136
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
137137
<param><ptype>EGLSyncKHR</ptype> <name>sync</name></param>
138138
</command>
139139
<command>
140-
<proto><ptype>void</ptype> <name>eglWaitUntilWorkScheduledANGLE</name></proto>
140+
<proto>void <name>eglWaitUntilWorkScheduledANGLE</name></proto>
141141
<param><ptype>EGLDisplay</ptype> <name>dpy</name></param>
142142
</command>
143143
</commands>

0 commit comments

Comments
 (0)