[Piglit] [PATCH 1/6] arb_bindless_texture: test bound samplers/image with glUniform1i()

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Apr 27 20:12:19 UTC 2017



On 04/27/2017 10:02 PM, Nicolai Hähnle wrote:
> On 27.04.2017 00:52, Samuel Pitoiset wrote:
>> From section 2.14.16 of the ARB_bindless_texture spec:
>>
>>     "When used as uniforms in the default block, the value of sampler
>>      variables may be specified with either Uniform1i{v} or
>>      UniformHandleui64{v}ARB."
>>
>> From section 2.14.X of the ARB_bindless_texture spec:
>>
>>     "When used as uniforms in the default block, the value of image
>>      variables may be specified with either Uniform1i{v} or
>>      UniformHandleui64{v}ARB."
>>
>> This test just ensures that setting a uniform to bound samplers
>> doesn't report any GL errors.
> 
> Okay, I'm very confused again. The spec *also* says this:
> 
>     "These modifiers control whether default-block uniforms of the
>      corresponding types may have their values set via both
>      UniformHandle* and Uniform1i (bindless_sampler and bindless_image)
>      or only via Uniform1i (bound_sampler and bound_image)."
> 
> Which would actually suggest that the current test is wrong *before* 
> this patch. What's going on here?

Not wrong, but incomplete, yes.

Basically, if my understanding of the spec is correct. The only GL call 
which should report an error is UniformHandle* when a sampler has the 
bound_sampler layout qualifier. That said, we can use UniformHandle* and 
Uniform1i when the bindless_sampler is set and when no layout qualifiers 
are present.

> 
> 
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>  tests/spec/arb_bindless_texture/uniform.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tests/spec/arb_bindless_texture/uniform.c 
>> b/tests/spec/arb_bindless_texture/uniform.c
>> index c4c06df05..1524eb18c 100644
>> --- a/tests/spec/arb_bindless_texture/uniform.c
>> +++ b/tests/spec/arb_bindless_texture/uniform.c
>> @@ -158,6 +158,7 @@ 
>> check_UniformHandleui64_with_implicit_bound_sampler(void *data)
>>       */
>>      glUniformHandleui64ARB(loc, handle);
>>      glProgramUniformHandleui64vARB(prog, loc, 1, &handle);
>> +    glUniform1i(loc, 5);
>>      if (!piglit_check_gl_error(GL_NO_ERROR))
>>          return PIGLIT_FAIL;
>>
>> @@ -223,6 +224,7 @@ 
>> check_UniformHandleui64_with_implicit_bound_image(void *data)
>>       */
>>      glUniformHandleui64ARB(loc, handle);
>>      glProgramUniformHandleui64vARB(prog, loc, 1, &handle);
>> +    glUniform1i(loc, 5);
>>      if (!piglit_check_gl_error(GL_NO_ERROR))
>>          return PIGLIT_FAIL;
>>
>>
> 
> 


More information about the Piglit mailing list