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

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon May 8 14:31:12 UTC 2017



On 04/28/2017 10:38 AM, Samuel Pitoiset wrote:
> 
> 
> On 04/28/2017 10:05 AM, Nicolai Hähnle wrote:
>> On 27.04.2017 22:12, Samuel Pitoiset wrote:
>>>
>>>
>>> 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.
>>
>> I'd like to get this clarified. My understanding was that, because of:
>>
>>     "In the absence of these qualifiers, sampler and image uniforms are
>>      considered "bound"."
>>
>> The behavior of an explicit bound_sampler uniform and a sampler 
>> uniform without any such qualifiers should be the same, i.e. 
>> UniformHandle* is forbidden in both cases.
> 
> To be honest, it was my first thought but after checking against the NV 
> blob they do accept UniformHandle* with implicit bound samplers. Well,
> it's well known that NVIDIA is too permissive so we are probably right.
> 
> I will send an email to the spec authors.

Nicolai, I have a got a confirmation.

glUniformHandle*() can only be used with bindless samplers. This is one 
of the difference between NV_bindless_texture and ARB_bindless_texture.

I will update this test.

>>
>> Cheers,
>> Nicolai
>>
>>
>>
>>>
>>>>
>>>>
>>>>>
>>>>> 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