[Mesa-dev] [PATCH 1/6] main: fix ACTIVE_UNIFORM_BLOCKS value
Samuel Iglesias Gonsálvez
siglesias at igalia.com
Mon Sep 28 03:39:18 PDT 2015
On 27/09/15 23:15, Timothy Arceri wrote:
> On Fri, 2015-09-25 at 10:24 +0200, Samuel Iglesias Gonsalvez wrote:
>> NumUniformBlocks also counts shader storage blocks.
>> NumUniformBlocks variable will be renamed in a later patch to avoid
>> misunderstandings.
>>
>> Signed-off-by: Samuel Iglesias Gonsalvez <siglesias at igalia.com>
>> ---
>> src/mesa/main/shaderapi.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
>> index edc23bc..7866a20 100644
>> --- a/src/mesa/main/shaderapi.c
>> +++ b/src/mesa/main/shaderapi.c
>> @@ -725,12 +725,17 @@ get_programiv(struct gl_context *ctx, GLuint
>> program, GLenum pname,
>> *params = max_len;
>> return;
>> }
>> - case GL_ACTIVE_UNIFORM_BLOCKS:
>> + case GL_ACTIVE_UNIFORM_BLOCKS: {
>> + unsigned i;
>> +
>> if (!has_ubo)
>> break;
>>
>> - *params = shProg->NumUniformBlocks;
>> + for (i = 0, *params = 0; i < shProg->NumProgramResourceList;
>> i++)
>> + if (shProg->ProgramResourceList[i].Type ==
>> GL_UNIFORM_BLOCK)
>> + (*params)++;
>> return;
>> + }
>
> Rather than loop through the entire resource list you could just
> looping over the uniform block list right?
>
> for (unsigned i = 0; i < shProg->NumUniformBlocks; i++) {
> if (!shProg->UniformBlocks[i].IsShaderStorage) {
> (*params)++;;
> }
> }
>
Yeah, that works too. I will change it. Do you give R-b to this change?
Sam
>> case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
>> /* This enum isn't part of the OES extension for OpenGL ES
>> 2.0. It is
>> * only available with desktop OpenGL 3.0+ with the
>
More information about the mesa-dev
mailing list