mesa/main: Fix UBO/SSBO ACTIVE_VARIABLES query (ARB_gl_spirv)
authorAntia Puentes <apuentes@igalia.com>
Tue, 18 Dec 2018 10:55:04 +0000 (11:55 +0100)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Fri, 12 Jul 2019 21:42:41 +0000 (23:42 +0200)
commit0baa553fab5cfbee3410ca9f311e2bf61ccec5d4
tree9c22ca7ddc146d63e7db9eadd017ea4eaea77064
parent161de77e0feeab365f1a53464cb60eb3608ebe2e
mesa/main: Fix UBO/SSBO ACTIVE_VARIABLES query (ARB_gl_spirv)

When querying MAX_NUM_ACTIVE_VARIABLES, NUM_ACTIVE_VARIABLES and
ACTIVE_VARIABLES over SSBO and UBO interfaces, we filter the variables
which are active using the variable's name and looking for it in the
program resource list. If it is in the program resource list, the
variable will be considered active.

However due to ARB_gl_spirv where name reflection information is not
mandatory, we can use the UBO/SSBO binding and variable offset to
filter which variables which are active.

v2: use RESOURCE_UBO/UNI macros instead of direct castings, update
    comment (Alejandro)

v3: Change signature of _mesa_program_resource_find_active_variable
    to simplify calling it. Also, squash the fix for find_binding_offset
    for arrays of blocks (Arcady)

Signed-off-by: Antia Puentes <apuentes@igalia.com>
Signed-off-by: Alejandro Piñeiro <apinheiro@igalia.com>
Signed-off-by: Arcady Goldmints-Orlov <agoldmints@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
src/mesa/main/program_resource.c
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.h