mesa: Fix ACTIVE_*_MAX_LENGTH program queries (ARB_gl_spirv)
authorAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 18 Nov 2017 09:04:42 +0000 (10:04 +0100)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 12 Jul 2019 21:42:41 +0000 (23:42 +0200)
commit3ebd60b4917bb45d5b5339a10ba3aa4561925c66
tree3c7be8bbe7238210e706edbb29c45d0290f0c358
parentcafc1a40d465a42805bb2ae45b18997e87bbac75
mesa: Fix ACTIVE_*_MAX_LENGTH program queries (ARB_gl_spirv)

Since ARB_gl_spirv it is possible to miss a lot of name reflection
information, so it is needed to add NULL name checks for several
queries, and return a specific value on those cases. This commit add
them for ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
ACTIVE_ATTRIBUTE_MAX_LENGTH and ACTIVE_UNIFORM_MAX_LENGTH.

From ARB_gl_spirv spec:

   "If pname is ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, the length of
    the longest active uniform block name, including the null
    terminator, is returned. If no active uniform blocks exist, zero
    is returned. If no name reflection information is available, one
    is returned.

    If pname is ACTIVE_ATTRIBUTE_MAX_LENGTH, the length of the longest
    active attribute name, including a null terminator, is returned.
    If no active attributes exist, zero is returned. If no name
    reflection information is available, one is returned.

    If pname is ACTIVE_UNIFORM_MAX_LENGTH, the length of the longest
    active uniform name, including a null terminator, is returned. If
    no active uniforms exist, zero is returned. If no name reflection
    information is available, one is returned."

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.c