[Piglit] [PATCH 01/31] util/gl: Remove primitive type GLenums from piglit_get_gl_enum_name.
Fabian Bieler
fabianbieler at fastmail.fm
Thu Dec 28 15:57:27 UTC 2017
Tests should use piglit_get_prim_name form primitive type GLenums.
This allows us to add GL_NONE/GL_FALSE/GL_NO_ERROR and GL_TRUE to
piglit_get_gl_enum_name.
Also for future-proofing treat every GLenum < 0x100 as a primitive type.
>From gl.xml:
<unused start="0x000F" end="0x00FF" comment="Unused for PrimitiveType"/>
---
tests/util/piglit-util-gl-enum-gen.c.mako | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/util/piglit-util-gl-enum-gen.c.mako b/tests/util/piglit-util-gl-enum-gen.c.mako
index 04b79b809..1a878c945 100644
--- a/tests/util/piglit-util-gl-enum-gen.c.mako
+++ b/tests/util/piglit-util-gl-enum-gen.c.mako
@@ -29,9 +29,14 @@
const char*
piglit_get_gl_enum_name(GLenum param)
{
+<% gl_accum = gl_registry.enums['GL_ACCUM'] %>\
>-------switch (param) {
+>-------case 0x0000: return "GL_NONE/GL_FALSE/GL_NO_ERROR";
+>-------case 0x0001: return "GL_TRUE";
% for enum in sorted_unique_enums_in_default_namespace:
+% if enum.num_value >= gl_accum.num_value:
>-------case ${enum.c_num_literal}: return "${enum.name}";
+% endif
% endfor
>-------default: return "(unrecognized enum)";
>-------}
@@ -40,10 +45,9 @@ piglit_get_gl_enum_name(GLenum param)
const char*
piglit_get_prim_name(GLenum prim)
{
-<% gl_patches = gl_registry.enums['GL_PATCHES'] %>\
>-------switch (prim) {
% for enum in sorted_unique_enums_in_default_namespace:
-% if enum.num_value <= gl_patches.num_value:
+% if enum.num_value < gl_accum.num_value:
>-------case ${enum.c_num_literal}: return "${enum.name}";
% endif
% endfor
--
2.15.1
More information about the Piglit
mailing list