diff options
author | Marek Olšák <[email protected]> | 2020-05-12 16:22:29 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-13 20:10:42 +0000 |
commit | 64c7363f7efb6c5bf39cf4443245a82fc9904fb8 (patch) | |
tree | 6932c04c8b271a1644404756066841bf0102e4af /src | |
parent | 1152af2edacb93126b66e19399d971036fc02d79 (diff) |
glthread: stop using GLenum16 to get correct GL errors for out-of-bounds enums
Reported by Ian Romanick.
Reviewed-by: Eric Anholt <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5016>
Diffstat (limited to 'src')
-rw-r--r-- | src/mapi/glapi/gen/gl_marshal.py | 7 | ||||
-rw-r--r-- | src/mesa/main/glthread_draw.c | 12 |
2 files changed, 8 insertions, 11 deletions
diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index 29032645fce..6e8ad20f5cd 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -152,9 +152,9 @@ class PrintCode(gl_XML.gl_print_base): 'GLboolean': 1, 'GLbyte': 1, 'GLubyte': 1, - 'GLenum': 2, # uses GLenum16 'GLshort': 2, 'GLushort': 2, + 'GLenum': 4, 'GLint': 4, 'GLuint': 4, 'GLbitfield': 4, @@ -192,10 +192,7 @@ class PrintCode(gl_XML.gl_print_base): out('{0} {1}[{2}];'.format( p.get_base_type_string(), p.name, p.count)) else: - type = p.type_string() - if type == 'GLenum': - type = 'GLenum16' - out('{0} {1};'.format(type, p.name)) + out('{0} {1};'.format(p.type_string(), p.name)) for p in func.variable_params: if p.img_null_flag: diff --git a/src/mesa/main/glthread_draw.c b/src/mesa/main/glthread_draw.c index 8e6aeca002a..5607ced4125 100644 --- a/src/mesa/main/glthread_draw.c +++ b/src/mesa/main/glthread_draw.c @@ -164,7 +164,7 @@ upload_vertices(struct gl_context *ctx, unsigned attrib_mask, struct marshal_cmd_DrawArraysInstancedBaseInstance { struct marshal_cmd_base cmd_base; - GLenum16 mode; + GLenum mode; GLint first; GLsizei count; GLsizei instance_count; @@ -267,7 +267,7 @@ _mesa_marshal_DrawArraysInstancedBaseInstance(GLenum mode, GLint first, struct marshal_cmd_MultiDrawArrays { struct marshal_cmd_base cmd_base; - GLenum16 mode; + GLenum mode; GLsizei draw_count; GLuint non_vbo_attrib_mask; }; @@ -399,8 +399,8 @@ struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance { struct marshal_cmd_base cmd_base; bool index_bounds_valid; - GLenum16 mode; - GLenum16 type; + GLenum mode; + GLenum type; GLsizei count; GLsizei instance_count; GLint basevertex; @@ -590,8 +590,8 @@ struct marshal_cmd_MultiDrawElementsBaseVertex { struct marshal_cmd_base cmd_base; bool has_base_vertex; - GLenum16 mode; - GLenum16 type; + GLenum mode; + GLenum type; GLsizei draw_count; GLuint non_vbo_attrib_mask; struct gl_buffer_object *index_buffer; |