[Piglit] [PATCH] Edit multi-draw-elements-base-vertex.c: change indice offset from int to GLvoid*
Paul Berry
stereotype441 at gmail.com
Thu Aug 15 22:05:12 PDT 2013
On 13 August 2013 11:56, Jacob Penner <jkpenner91 at gmail.com> wrote:
> Passing an offset of type int typedcast to GLvoid* to
> glMultiDrawElementsBaseVertex would result in function
> receiving incorrect data.
>
The commit subject and message make it sound like the only change was to
the type of indices_offset. The other two changes (checking for errors and
dropping the unnecessary call to piglit_ortho_projection()) should be
briefly mentioned too.
With that fixed, this patch is:
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
> ---
> .../multi-draw-elements-base-vertex.c | 12
> ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git
> a/tests/spec/arb_draw_elements_base_vertex/multi-draw-elements-base-vertex.c
> b/tests/spec/arb_draw_elements_base_vertex/multi-draw-elements-base-vertex.c
> index 1d51b53..8fdd666 100644
> ---
> a/tests/spec/arb_draw_elements_base_vertex/multi-draw-elements-base-vertex.c
> +++
> b/tests/spec/arb_draw_elements_base_vertex/multi-draw-elements-base-vertex.c
> @@ -105,8 +105,8 @@ static GLuint indices[] = {
> };
> static GLsizei indices_size = sizeof(indices);
>
> -static int indices_offset[] = {
> - 0, 6 * sizeof(GLuint)
> +static const GLvoid * const indices_offset[] = {
> + (GLvoid*) 0, (GLvoid*)(6 * sizeof(GLuint))
> };
> static GLsizei indices_count[] = {
> 6, 6
> @@ -124,8 +124,6 @@ piglit_init(int argc, char **argv)
>
> piglit_require_extension("GL_ARB_draw_elements_base_vertex");
> }
>
> - piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
> -
> /* Create program */
> program = piglit_build_simple_program(vs_source, fs_source);
> glUseProgram(program);
> @@ -153,6 +151,9 @@ piglit_init(int argc, char **argv)
> glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer);
> glEnableVertexAttribArray(vertex_index);
> glVertexAttribPointer(vertex_index, 2, GL_FLOAT, GL_FALSE, 0, 0);
> +
> + if(!piglit_check_gl_error(GL_NO_ERROR))
> + piglit_report_result(PIGLIT_FAIL);
> }
>
> enum piglit_result
> @@ -178,6 +179,9 @@ piglit_display(void)
> pass = piglit_probe_pixel_rgb(100, 75, blue) && pass;
> pass = piglit_probe_pixel_rgb(100, 25, green) && pass;
>
> + if(!piglit_check_gl_error(GL_NO_ERROR))
> + pass = false;
> +
> piglit_present_results();
>
> return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130815/b5ad0312/attachment-0001.html>
More information about the Piglit
mailing list