On 13 August 2013 11:56, Jacob Penner <[email protected]> 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 <[email protected]> > --- > .../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 > [email protected] > http://lists.freedesktop.org/mailman/listinfo/piglit >
_______________________________________________ Piglit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/piglit
