glthread: don't declare pointers with const in unmarshal functions

so that GL functions with a non-const pointer don't print a warning when
we call them, such as glGetTexImage with a PBO where the pointer is really
just an offset.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9029>
This commit is contained in:
Marek Olšák 2021-02-11 22:50:55 -05:00
parent 2804d489e3
commit 0b6739ef80
1 changed files with 1 additions and 1 deletions

View File

@ -251,7 +251,7 @@ class PrintCode(gl_XML.gl_print_base):
p_decl = '{0} {1} = cmd->{1};'.format(
p.type_string(), p.name)
if not p_decl.startswith('const '):
if not p_decl.startswith('const ') and p.count:
# Declare all local function variables as const, even if
# the original parameter is not const.
p_decl = 'const ' + p_decl