• Paul Berry's avatar
    Add vbo support to shader_runner. · f9d224d0
    Paul Berry authored
    This patch adds the ability for shader_runner tests to include a
    "[vertex data]" section containing data in columnar format, for example:
    
    [vertex data]
    vertex/float/3 foo/uint/1 bar/int/2
    0.0 0.0 0.0    0xe0000000 0 0
    0.0 1.0 0.0    0x70000000 1 1
    1.0 1.0 0.0    0x00000000 0 1
    
    Each column header is of the form ATTRNAME/TYPE/COUNT, where ATTRNAME
    is the name of the vertex attribute to be bound to this column, TYPE
    is the type of data that follows ("float", "int", or "uint"), and
    COUNT is the vector length of the data (e.g. "3" for vec3 data).
    
    To send vertex data to the shader, use the new shader_runner command
    "draw arrays".  The parameters are the same as for the glDrawArrays()
    command, so for example to draw triangle primitives using 3 elements
    from the vertex data array starting at element 0, use the command:
    
    draw arrays GL_TRIANGLES 0 3
    
    More detailed examples can be found in the tests/shaders/vbo
    directory.
    
    The implementation is largely in a new file, piglit-vbo.cpp, so that
    it can be re-used by other piglit tests if necessary.
    f9d224d0
piglit-vbo.h 1.32 KB