mesa: add KHR_no_error support for gl*UniformHandleui64*ARB

Similar to _mesa_uniform() except that we have to call
validate_uniform_parameters() instead of validate_uniform().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
This commit is contained in:
Samuel Pitoiset
2017-06-14 11:27:44 +02:00
parent 304de4edb9
commit 10d104207a
+39 -19
View File
@@ -1359,28 +1359,48 @@ _mesa_uniform_handle(GLint location, GLsizei count, const GLvoid *values,
struct gl_context *ctx, struct gl_shader_program *shProg)
{
unsigned offset;
struct gl_uniform_storage *const uni =
validate_uniform_parameters(location, count, &offset,
ctx, shProg, "glUniformHandleui64*ARB");
if (uni == NULL)
return;
struct gl_uniform_storage *uni;
if (!uni->is_bindless) {
/* From section "Errors" of the ARB_bindless_texture spec:
if (_mesa_is_no_error_enabled(ctx)) {
/* From Section 7.6 (UNIFORM VARIABLES) of the OpenGL 4.5 spec:
*
* "The error INVALID_OPERATION is generated by
* UniformHandleui64{v}ARB if the sampler or image uniform being
* updated has the "bound_sampler" or "bound_image" layout qualifier."
*
* From section 4.4.6 of the ARB_bindless_texture spec:
*
* "In the absence of these qualifiers, sampler and image uniforms are
* considered "bound". Additionally, if GL_ARB_bindless_texture is not
* enabled, these uniforms are considered "bound"."
* "If the value of location is -1, the Uniform* commands will
* silently ignore the data passed in, and the current uniform values
* will not be changed.
*/
_mesa_error(ctx, GL_INVALID_OPERATION,
"glUniformHandleui64*ARB(non-bindless sampler/image uniform)");
return;
if (location == -1)
return;
uni = shProg->UniformRemapTable[location];
/* The array index specified by the uniform location is just the
* uniform location minus the base location of of the uniform.
*/
assert(uni->array_elements > 0 || location == (int)uni->remap_location);
offset = location - uni->remap_location;
} else {
uni = validate_uniform_parameters(location, count, &offset,
ctx, shProg, "glUniformHandleui64*ARB");
if (!uni)
return;
if (!uni->is_bindless) {
/* From section "Errors" of the ARB_bindless_texture spec:
*
* "The error INVALID_OPERATION is generated by
* UniformHandleui64{v}ARB if the sampler or image uniform being
* updated has the "bound_sampler" or "bound_image" layout qualifier."
*
* From section 4.4.6 of the ARB_bindless_texture spec:
*
* "In the absence of these qualifiers, sampler and image uniforms are
* considered "bound". Additionally, if GL_ARB_bindless_texture is
* not enabled, these uniforms are considered "bound"."
*/
_mesa_error(ctx, GL_INVALID_OPERATION,
"glUniformHandleui64*ARB(non-bindless sampler/image uniform)");
return;
}
}
const unsigned components = uni->type->vector_elements;