[Piglit] [PATCH] genned-names: correct the parameter for glBindBufferRange

Ilia Mirkin imirkin at alum.mit.edu
Fri May 5 18:37:11 UTC 2017


>From the GL 4.5 core spec:

"""
An INVALID_VALUE error is generated by BindBufferRange if buffer is
non-zero and offset or size do not respectively satisfy the
constraints described
for those parameters for the specified target, as described in section 6.7.1.
"""

Here the target is GL_TRANSFORM_FEEDBACK_BUFFER. The only restriction
for TF bindings in section 6.7.1 is that it be a multiple of 4. It's
conceivable that the GL 3.1 spec says something materially different,
but I doubt it. Even if it does, the general approach is to do
whatever the later spec says.

So this test should, in fact, be adjusted to request a multiple of 4
instead of 1 for the size, but the uniform buffer offset alignment has
nothing to do with it.

Unrelatedly, please fix your indentation. piglit uses tabs for
indentation, you appear to be using 4 spaces. When in doubt, make sure
you're doing whatever the surrounding code is doing. Look at your
patch -- the lines you're adding look jagged relative to the existing
lines.

Cheers,

  -ilia


On Fri, May 5, 2017 at 2:26 PM, Sandra Koroniewska
<sandra.koroniewska at gmail.com> wrote:
> This fixes
> tests/spec/gl-3.1/genned-names on Windows Intel driver. According to OpenGL 3.1 Spec Page 63 for BindBufferRange "The error INVALID_VALUE is generated (...) if offset is not a multiple of the implementation-dependent required alignment
> (UNIFORM_BUFFER_OFFSET_ALIGNMENT)."
> ---
>  tests/spec/gl-3.1/genned-names.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tests/spec/gl-3.1/genned-names.c b/tests/spec/gl-3.1/genned-names.c
> index bc75ae4d6..38e02f159 100644
> --- a/tests/spec/gl-3.1/genned-names.c
> +++ b/tests/spec/gl-3.1/genned-names.c
> @@ -154,10 +154,13 @@ test_bindbuffer_tfb()
>  {
>         bool pass = true;
>
> +    GLint uniformBufferAlignSize = 0;
> +    glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &uniformBufferAlignSize);
> +
>         glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 600);
>         pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
>
> -       glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 601, 0, 1);
> +    glBindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 601, 0, uniformBufferAlignSize);
>         pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
>
>         return pass;
> --
> 2.11.0.windows.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list