[Mesa-dev] [PATCH 15/23] mesa: refactor GetActiveUniformsiv, use _mesa_program_resource_prop

Tapani Pälli tapani.palli at intel.com
Tue Mar 17 02:36:49 PDT 2015



On 03/17/2015 12:38 AM, Ilia Mirkin wrote:
> On Fri, Mar 13, 2015 at 4:38 AM, Tapani Pälli <tapani.palli at intel.com> wrote:
>> Signed-off-by: Tapani Pälli <tapani.palli at intel.com>
>> ---
>>   src/mesa/main/uniform_query.cpp | 107 ++++++++++++++--------------------------
>>   1 file changed, 38 insertions(+), 69 deletions(-)
>>
>> diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
>> index 9f82de9..217473a 100644
>> --- a/src/mesa/main/uniform_query.cpp
>> +++ b/src/mesa/main/uniform_query.cpp
>> @@ -79,6 +79,33 @@ _mesa_GetActiveUniform(GLuint program, GLuint index,
>>      }

8<

>> -
>> -      case GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX:
>> -         if (!ctx->Extensions.ARB_shader_atomic_counters)
>> -            goto invalid_enum;
>> -         params[i] = uni->atomic_buffer_index;
>> +      if (!_mesa_program_resource_prop(shProg, res, uniformIndices[i],
>> +                                       res_prop, &params[i],
>> +                                       "glGetActiveUniformsiv"))
>
> Will this return GL_INVALID_ENUM if res_prop == 0? If not, you need to
> handle that above.

Yes, it results in INVALID_ENUM error.

> With that answered or taken care of,
>
> Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
>
>>            break;
>> -
>> -      default:
>> -         goto invalid_enum;
>> -      }
>>      }
>> -
>> -   return;
>> -
>> - invalid_enum:
>> -   _mesa_error(ctx, GL_INVALID_ENUM, "glGetActiveUniformsiv(pname)");
>>   }
>>
>>   static struct gl_uniform_storage *
>> --
>> 2.1.0
>>
>> _______________________________________________
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list