<div dir="ltr">On 14 October 2013 11:33, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 10/14/2013 11:20 AM, Paul Berry wrote:<br>
> On 1 October 2013 18:22, Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
</div><div class="im">> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
><br>
>     From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
</div>>     <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
<div class="im">><br>
>     Verify that the right shaders are used in the right combinations several<br>
>     ways.<br>
><br>
>     * The vertex shader has information baked-in that determines the X<br>
>     position<br>
>       of the block on the screen.<br>
><br>
>     * The fragment shader has information baked-in that determines how the<br>
>       block is colored.  This is combined with data passed from the vertex<br>
>       shader.<br>
><br>
>     Since data is passed from the vertex shader to the fragment shader, the<br>
>     test can use either rendezvous-by-name (default) or<br>
>     rendezvous-by-location<br>
>     (with --by-location command line parameter).<br>
><br>
>     This test passes in both modes on NVIDIA (304.64 on GTX 260).<br>
><br>
>     Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
</div>>     <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
<div><div class="h5">>     ---<br>
>      tests/all.tests                                    |   2 +<br>
>      .../arb_separate_shader_objects/400-combinations.c | 377<br>
>     +++++++++++++++++++++<br>
>      .../arb_separate_shader_objects/CMakeLists.gl.txt  |   1 +<br>
>      3 files changed, 380 insertions(+)<br>
>      create mode 100644<br>
>     tests/spec/arb_separate_shader_objects/400-combinations.c<br>
><br>
>     diff --git a/tests/all.tests b/tests/all.tests<br>
>     index 33556af..1e79514 100644<br>
>     --- a/tests/all.tests<br>
>     +++ b/tests/all.tests<br>
>     @@ -1279,6 +1279,8 @@ arb_separate_shader_objects['Mix<br>
>     BindProgramPipeline and UseProgram'] = concurre<br>
>      arb_separate_shader_objects['ProgramUniform coverage'] =<br>
>     concurrent_test('arb_separate_shader_object-ProgramUniform-coverage')<br>
>      arb_separate_shader_objects['Rendezvous by location'] =<br>
>     plain_test('arb_separate_shader_object-rendezvous_by_location -fbo')<br>
>      arb_separate_shader_objects['ValidateProgramPipeline'] =<br>
>     concurrent_test('arb_separate_shader_object-ValidateProgramPipeline')<br>
>     +arb_separate_shader_objects['400 combinations by location'] =<br>
>     plain_test('arb_separate_shader_object-400-combinations -fbo<br>
>     --by-location')<br>
>     +arb_separate_shader_objects['400 combinations by name'] =<br>
>     plain_test('arb_separate_shader_object-400-combinations -fbo')<br>
><br>
>      # Group ARB_sampler_objects<br>
>      arb_sampler_objects = Group()<br>
>     diff --git<br>
>     a/tests/spec/arb_separate_shader_objects/400-combinations.c<br>
>     b/tests/spec/arb_separate_shader_objects/400-combinations.c<br>
>     new file mode 100644<br>
>     index 0000000..8593b6e<br>
>     --- /dev/null<br>
>     +++ b/tests/spec/arb_separate_shader_objects/400-combinations.c<br>
>     @@ -0,0 +1,377 @@<br>
>     +/*<br>
>     + * Copyright © 2013 Intel Corporation<br>
>     + *<br>
>     + * Permission is hereby granted, free of charge, to any person<br>
>     obtaining a<br>
>     + * copy of this software and associated documentation files (the<br>
>     "Software"),<br>
>     + * to deal in the Software without restriction, including without<br>
>     limitation<br>
>     + * the rights to use, copy, modify, merge, publish, distribute,<br>
>     sublicense,<br>
>     + * and/or sell copies of the Software, and to permit persons to<br>
>     whom the<br>
>     + * Software is furnished to do so, subject to the following conditions:<br>
>     + *<br>
>     + * The above copyright notice and this permission notice (including<br>
>     the next<br>
>     + * paragraph) shall be included in all copies or substantial<br>
>     portions of the<br>
>     + * Software.<br>
>     + *<br>
>     + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,<br>
>     EXPRESS OR<br>
>     + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF<br>
>     MERCHANTABILITY,<br>
>     + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO<br>
>     EVENT SHALL<br>
>     + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,<br>
>     DAMAGES OR OTHER<br>
>     + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,<br>
>     ARISING<br>
>     + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR<br>
>     OTHER DEALINGS<br>
>     + * IN THE SOFTWARE.<br>
>     + */<br>
>     +<br>
>     +/**<br>
>     + * \file 400-combinations.c<br>
>     + * Combine 20 vertex shaders and 20 fragment shaders in various ways.<br>
>     + *<br>
>     + * Verify that the right shaders are used in the right combinations<br>
>     several<br>
>     + * ways.<br>
>     + *<br>
>     + * * The vertex shader has information baked-in that determines the<br>
>     X position<br>
>     + *   of the block on the screen.<br>
>     + *<br>
>     + * * The fragment shader has information baked-in that determines<br>
>     how the<br>
>     + *   block is colored.  This is combined with data passed from the<br>
>     vertex<br>
>     + *   shader.<br>
>     + *<br>
>     + * Since data is passed from the vertex shader to the fragment<br>
>     shader, the<br>
>     + * test can use either rendezvous-by-name (default) or<br>
>     rendezvous-by-location<br>
>     + * (with --by-location command line parameter).<br>
>     + */<br>
>     +#include "piglit-util-gl-common.h"<br>
>     +<br>
>     +PIGLIT_GL_TEST_CONFIG_BEGIN<br>
>     +<br>
>     +       config.supports_gl_compat_version = 10;<br>
>     +       config.supports_gl_core_version = 31;<br>
>     +       config.window_visual = PIGLIT_GL_VISUAL_RGB |<br>
>     PIGLIT_GL_VISUAL_DOUBLE;<br>
><br>
><br>
> I'd feel more comfortable if we added:<br>
><br>
> config.window_width = (tile_size + border_size) * ARRAY_SIZE(vs_programs);<br>
> config.window_height = (tile_size + border_size) * ARRAY_SIZE(fs_programs);<br>
><br>
> That way (a) the fact that this test requires a sufficiently large<br>
> window is explicit, and (b) if we try to run this test with a different<br>
> default piglit window size (as we often do when running piglit with a<br>
> hardware simulator) it won't fail.<br>
<br>
</div></div>Good call!  I like that.  I feel like we should collect some of these<br>
tricks into an "Effective piglit" wiki or something....<br>
<div><div class="h5"><br>
>     +<br>
>     +PIGLIT_GL_TEST_CONFIG_END<br>
>     +<br>
>     +/**<br>
>     + * Size of each square that will be drawn.<br>
>     + */<br>
>     +static const unsigned tile_size = 5;<br>
>     +<br>
>     +/**<br>
>     + * Size of the gap between the squares.<br>
>     + */<br>
>     +static const unsigned border_size = 2;<br>
>     +<br>
>     +static GLuint vs_programs[20];<br>
>     +static GLuint fs_programs[20];<br>
>     +<br>
>     +static GLuint pipe;<br>
>     +<br>
>     +static GLuint vao = 0;<br>
>     +static GLuint bo = 0;<br>
>     +<br>
>     +struct combination {<br>
>     +       unsigned char row;<br>
>     +       unsigned char col;<br>
>     +};<br>
>     +<br>
>     +static struct combination combinations[ARRAY_SIZE(vs_programs)<br>
>     +                                      * ARRAY_SIZE(fs_programs)];<br>
>     +<br>
>     +static const char *vs_code =<br>
>     +       "#version %d\n"<br>
>     +       "#extension GL_ARB_separate_shader_objects: require\n"<br>
>     +       "#extension GL_ARB_explicit_attrib_location: require\n"<br>
>     +       "\n"<br>
>     +       "layout(location = 0) in vec4 piglit_vertex;\n"<br>
>     +       "layout(location = 1) in vec3 vertex_color;\n"<br>
>     +       "\n"<br>
>     +       "%s out vec3 %s;\n"<br>
>     +       "\n"<br>
>     +       "const vec4 offset = vec4(%d, 0, 0, 0);\n"<br>
>     +       "\n"<br>
>     +       "uniform mat4 transform;\n"<br>
>     +       "\n"<br>
>     +       "void main()\n"<br>
>     +       "{\n"<br>
>     +       "    gl_Position = transform * (piglit_vertex + offset);\n"<br>
>     +       "    %s = vertex_color;\n"<br>
>     +       "}\n"<br>
>     +       ;<br>
>     +<br>
>     +static const char *fs_code =<br>
>     +       "#version %d\n"<br>
>     +       "#extension GL_ARB_separate_shader_objects: require\n"<br>
>     +       "#extension GL_ARB_explicit_attrib_location: enable\n"<br>
>     +       "\n"<br>
>     +       "#if __VERSION__ >= 130\n"<br>
>     +       "layout(location = 0) out vec4 out_color;\n"<br>
>     +       "#else\n"<br>
>     +       "#define out_color gl_FragColor\n"<br>
>     +       "#endif\n"<br>
>     +       "\n"<br>
>     +       "%s in vec3 %s;\n"<br>
>     +       "\n"<br>
>     +       "const vec3 color_offset = vec3(%d, %d, %d);\n"<br>
>     +       "\n"<br>
>     +       "void main()\n"<br>
>     +       "{\n"<br>
>     +       "    out_color = vec4(%s + color_offset, 1.);\n"<br>
>     +       "}\n"<br>
>     +       ;<br>
>     +<br>
>     +enum piglit_result<br>
>     +piglit_display(void)<br>
>     +{<br>
>     +       unsigned i;<br>
>     +       unsigned j;<br>
>     +<br>
>     +       static const float expected[] = {<br>
>     +               0.0f, 1.0f, 0.0f, 1.0f<br>
>     +       };<br>
>     +<br>
>     +       /* This is stored in row-major order.  Note the GL_TRUE<br>
>     parameter to<br>
>     +        * the glProgramUniformMatrix4fv call below.<br>
>     +        */<br>
>     +       const float transform[16] = {<br>
>     +               2.f / piglit_width, 0.0f, 0.0f, -1.0f,<br>
>     +               0.0f, 2.f / piglit_height, 0.0f, -1.0f,<br>
>     +               0.0f, 0.0f, 0.0f,  0.0f,<br>
>     +               0.0f, 0.0f, 0.0f, 1.0f,<br>
>     +       };<br>
>     +<br>
>     +       bool pass = true;<br>
>     +<br>
>     +       glClearColor(.5f, .5f, .5f, 1.f);<br>
>     +       glClear(GL_COLOR_BUFFER_BIT);<br>
>     +<br>
>     +       for (i = 0; i < ARRAY_SIZE(vs_programs); i++) {<br>
>     +               const GLint loc =<br>
>     +                       glGetUniformLocation(vs_programs[i],<br>
>     "transform");<br>
>     +<br>
>     +               glProgramUniformMatrix4fv(vs_programs[i], loc, 1,<br>
>     GL_TRUE,<br>
>     +                                         transform);<br>
>     +       }<br>
>     +<br>
>     +       glBindProgramPipeline(pipe);<br>
>     +<br>
>     +       for (i = 0; i < ARRAY_SIZE(combinations); i++) {<br>
>     +               const unsigned row = combinations[i].row;<br>
>     +               const unsigned col = combinations[i].col;<br>
>     +<br>
>     +               glUseProgramStages(pipe, GL_VERTEX_SHADER_BIT,<br>
>     +                                  vs_programs[col]);<br>
>     +               glUseProgramStages(pipe, GL_FRAGMENT_SHADER_BIT,<br>
>     +                                  fs_programs[row]);<br>
>     +               glDrawArrays(GL_TRIANGLE_FAN, row * 4, 4);<br>
>     +       }<br>
>     +<br>
>     +       glBindProgramPipeline(0);<br>
>     +<br>
>     +       for (i = 0; i < ARRAY_SIZE(vs_programs); i++) {<br>
>     +               for (j = 0; j < ARRAY_SIZE(fs_programs); j++) {<br>
>     +                       const unsigned x = (i * tile_size)<br>
>     +                               + ((i + 1) * border_size);<br>
>     +                       const unsigned y = (j * tile_size)<br>
>     +                               + ((j + 1) * border_size);<br>
>     +<br>
>     +                       pass = piglit_probe_rect_rgba(x, y,<br>
>     +                                                     tile_size,<br>
>     tile_size,<br>
>     +                                                     expected)<br>
>     +                               && pass;<br>
>     +               }<br>
>     +       }<br>
>     +<br>
>     +       piglit_present_results();<br>
>     +       return pass ? PIGLIT_PASS : PIGLIT_FAIL;<br>
>     +}<br>
>     +<br>
>     +#define RED(x)    ((int) (x / 2))<br>
>     +#define GREEN(x)  (-(int) x)<br>
>     +#define BLUE(x)   ((int) (x * 7))<br>
>     +<br>
>     +void<br>
>     +piglit_init(int argc, char **argv)<br>
>     +{<br>
>     +       unsigned glsl_version;<br>
>     +       unsigned i;<br>
>     +       unsigned j;<br>
>     +       unsigned idx;<br>
>     +       bool es;<br>
>     +       int glsl_major;<br>
>     +       int glsl_minor;<br>
>     +       const char *location;<br>
>     +       const char *vertex_name;<br>
>     +       const char *fragment_name;<br>
>     +<br>
>     +       struct vertex {<br>
>     +               float x;<br>
>     +               float y;<br>
>     +               float r;<br>
>     +               float g;<br>
>     +               float b;<br>
>     +       } *vert;<br>
>     +<br>
>     +       piglit_require_extension("GL_ARB_separate_shader_objects");<br>
>     +       piglit_require_extension("GL_ARB_explicit_attrib_location");<br>
>     +<br>
>     +       if (argc > 1 && strcmp(argv[1], "--by-location") == 0) {<br>
>     +               location = "layout(location = 3)";<br>
>     +               vertex_name = "a";<br>
>     +               fragment_name = "b";<br>
>     +       } else {<br>
>     +               location = "";<br>
>     +               vertex_name = "in_color";<br>
>     +               fragment_name = "in_color";<br>
>     +       }<br>
>     +<br>
>     +       /* Some NVIDIA drivers have issues with layout qualifiers, 'in'<br>
>     +        * keywords, and 'out' keywords in "lower" GLSL versions.<br>
>      If the<br>
>     +        * driver supports GLSL >= 1.40, use 1.40.  Otherwise, pick the<br>
>     +        * highest version that the driver supports.<br>
>     +        */<br>
>     +       piglit_get_glsl_version(&es, &glsl_major, &glsl_minor);<br>
>     +       glsl_version = ((glsl_major * 100) + glsl_minor) >= 140<br>
>     +               ? 140 : ((glsl_major * 100) + glsl_minor);<br>
>     +<br>
>     +       /* Generate the vertex shader programs.  Each vertex shader is<br>
>     +        * hardcoded to select a specific column on the display.<br>
>     +        */<br>
>     +       printf("Generating vertex shaders...\n");<br>
>     +       for (i = 0; i < ARRAY_SIZE(vs_programs); i++) {<br>
>     +               const unsigned base_x = (i * tile_size)<br>
>     +                       + ((i + 1) * border_size);<br>
>     +<br>
>     +               char *source = NULL;<br>
>     +<br>
>     +               asprintf(&source, vs_code,<br>
>     +                        glsl_version,<br>
>     +                        location,<br>
>     +                        vertex_name,<br>
>     +                        base_x,<br>
>     +                        vertex_name);<br>
>     +<br>
>     +               vs_programs[i] =<br>
>     +                       glCreateShaderProgramv(GL_VERTEX_SHADER, 1,<br>
>     +                                              (const GLchar *const<br>
>     *) &source);<br>
>     +               piglit_link_check_status(vs_programs[i]);<br>
>     +<br>
>     +               if (i == 0)<br>
>     +                       puts(source);<br>
>     +<br>
>     +               free(source);<br>
>     +       }<br>
>     +<br>
>     +       printf("Generating fragment shaders...\n");<br>
>     +       for (i = 0; i < ARRAY_SIZE(fs_programs); i++) {<br>
>     +               char *source = NULL;<br>
>     +<br>
>     +               asprintf(&source, fs_code,<br>
>     +                        glsl_version,<br>
>     +                        location,<br>
>     +                        fragment_name,<br>
>     +                        RED(i), GREEN(i), BLUE(i),<br>
>     +                        fragment_name);<br>
>     +<br>
>     +               fs_programs[i] =<br>
>     +                       glCreateShaderProgramv(GL_FRAGMENT_SHADER, 1,<br>
>     +                                              (const GLchar *const<br>
>     *) &source);<br>
>     +               piglit_link_check_status(fs_programs[i]);<br>
>     +<br>
>     +               if (i == 3)<br>
>     +                       puts(source);<br>
>     +<br>
>     +               free(source);<br>
>     +       }<br>
>     +<br>
>     +       glGenProgramPipelines(1, &pipe);<br>
>     +<br>
>     +       /* Generate vertex data for the tests.  The row of each block is<br>
>     +        * determined by the vertex data.  The color data for the<br>
>     block comes<br>
>     +        * from the vertex data and the data baked into the fragment<br>
>     shader.<br>
>     +        */<br>
>     +       if (piglit_get_gl_version() >= 30<br>
>     +           ||<br>
>     piglit_is_extension_supported("GL_ARB_vertex_array_object")) {<br>
>     +               glGenVertexArrays(1, &vao);<br>
>     +               glBindVertexArray(vao);<br>
>     +       }<br>
>     +<br>
>     +       glGenBuffers(1, &bo);<br>
>     +       glBindBuffer(GL_ARRAY_BUFFER, bo);<br>
>     +       glBufferData(GL_ARRAY_BUFFER,<br>
>     +                    sizeof(vert[0]) * 4 * ARRAY_SIZE(fs_programs),<br>
>     +                    NULL, GL_STATIC_DRAW);<br>
>     +<br>
>     +       vert = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);<br>
>     +<br>
>     +       for (i = 0; i < ARRAY_SIZE(fs_programs); i++) {<br>
>     +               const unsigned base_y = (i * tile_size)<br>
>     +                       + ((i + 1) * border_size);<br>
>     +<br>
>     +               vert[(i * 4) + 0].x = 0.f;<br>
>     +               vert[(i * 4) + 0].y = (float) base_y;<br>
>     +               vert[(i * 4) + 0].r = (float) -RED(i);<br>
>     +               vert[(i * 4) + 0].g = (float) 1 - GREEN(i);<br>
>     +               vert[(i * 4) + 0].b = (float) -BLUE(i);<br>
>     +<br>
>     +               vert[(i * 4) + 1].x = (float) tile_size;<br>
>     +               vert[(i * 4) + 1].y = (float) base_y;<br>
>     +               vert[(i * 4) + 1].r = (float) -RED(i);<br>
>     +               vert[(i * 4) + 1].g = (float) 1 - GREEN(i);<br>
>     +               vert[(i * 4) + 1].b = (float) -BLUE(i);<br>
>     +<br>
>     +               vert[(i * 4) + 2].x = (float) tile_size;<br>
>     +               vert[(i * 4) + 2].y = (float) (base_y + tile_size);<br>
>     +               vert[(i * 4) + 2].r = (float) -RED(i);<br>
>     +               vert[(i * 4) + 2].g = (float) 1 - GREEN(i);<br>
>     +               vert[(i * 4) + 2].b = (float) -BLUE(i);<br>
>     +<br>
>     +               vert[(i * 4) + 3].x = 0.f;<br>
>     +               vert[(i * 4) + 3].y = (float) (base_y + tile_size);<br>
>     +               vert[(i * 4) + 3].r = (float) -RED(i);<br>
>     +               vert[(i * 4) + 3].g = (float) 1 - GREEN(i);<br>
>     +               vert[(i * 4) + 3].b = (float) -BLUE(i);<br>
>     +       }<br>
>     +<br>
>     +       glUnmapBuffer(GL_ARRAY_BUFFER);<br>
>     +<br>
>     +       glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(vert[0]),<br>
>     +                             (void *)(intptr_t) offsetof(struct<br>
>     vertex, x));<br>
>     +       glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(vert[0]),<br>
>     +                             (void *)(intptr_t) offsetof(struct<br>
>     vertex, r));<br>
>     +       glEnableVertexAttribArray(0);<br>
>     +       glEnableVertexAttribArray(1);<br>
>     +<br>
>     +       /* Generate the set of combinations of vertex shader<br>
>     programs and<br>
>     +        * fragment shader programs that will be used together.<br>
>      This is all<br>
>     +        * the possible combinations.  The next step is to shuffle<br>
>     list so<br>
>     +        * that there's (hopefully) no pattern to the access<br>
>     combination... to<br>
>     +        * uncover driver bugs.<br>
>     +        */<br>
>     +       idx = 0;<br>
>     +       for (i = 0; i < ARRAY_SIZE(vs_programs); i++) {<br>
>     +               for (j = 0; j < ARRAY_SIZE(fs_programs); j++) {<br>
>     +                       combinations[idx].row = j;<br>
>     +                       combinations[idx].col = i;<br>
>     +                       idx++;<br>
>     +               }<br>
>     +       }<br>
>     +<br>
>     +       for (i = 0; i < (5 * ARRAY_SIZE(combinations)); i++) {<br>
>     +               /* Pick a random element from the array.<br>
>     +                */<br>
>     +               const unsigned src = rand() % ARRAY_SIZE(combinations);<br>
>     +<br>
>     +               /* Pick a random element from the array that is not<br>
>     the same<br>
>     +                * as the previous element.  This is done by picking<br>
>     a second<br>
>     +                * number on the range [1, ARRAY_SIZE(combinations)<br>
>     - 2] and<br>
>     +                * adding it (using modular addition) to the first.<br>
>     +                */<br>
>     +               const unsigned delta =<br>
>     +                       (rand() % (ARRAY_SIZE(combinations) - 1)) + 1;<br>
>     +               const unsigned dst = (src + delta) %<br>
>     ARRAY_SIZE(combinations);<br>
>     +<br>
>     +               /* Exchange the two selected elements.<br>
>     +                */<br>
>     +               const struct combination temp = combinations[dst];<br>
>     +               combinations[dst] = combinations[src];<br>
>     +               combinations[src] = temp;<br>
>     +       }<br>
><br>
><br>
> A less ad-hoc algorithm for shuffling an array is:<br>
><br>
> for (i = ARRAY_SIZE(combinations); i > 1; i--) {<br>
>    j = rand() % i;<br>
>    if (j != i - 1)<br>
>       swap elements j and i - 1<br>
> }<br>
><br>
> Neglecting deficiencies in rand(), this algorithm produces all possible<br>
> permutations with equal probability.<br>
<br>
</div></div>Okay... I like not having to rand() twice.<br>
<br>
I understand (and empathize) your reservations about using rand.  I<br>
think we can cope with them in a couple ways.<br>
<br>
1. Implement a piglit_rand.  This guarantees that we'll have the same<br>
generator on all platforms, compilers, etc.  This doesn't even have to<br>
be a great generator... a dumb LFSR should do it.  Most tests that want<br>
random numbers just want a shuffled sequence or some non-sequential data<br>
values.<br>
<br>
2. Implement some standard piglit options for controlling the generator.<br>
 These options would be parsed by the piglit framework code.  I'm<br>
thinking --random-seed-clock and --random-seed=<some value>.<br>
<br>
3. Make the random number generator log the seed used when it is first<br>
called.<br>
<br>
4. Have a default seed that can be overridden with one of the previously<br>
mentioned command line options.<br>
<br>
Thoughts?<br></blockquote><div><br></div><div>Personally, I'd vote for a combination of options 1 and 4.  That would ensure that vanilla piglit runs are repeatable (even across implementations, which is a nice bonus).  Options 2 and 3 would be nice, but I don't think they're strictly necessary--I bet if we didn't do them no one would notice/care.<br>
<br></div><div>Incidentally, in case it wasn't clear from my previous email, I think it's just fine to go ahead with this patch before we've resolved what to do about rand().<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im"><br>
> With the above two changes, this patch is:<br>
><br>
> Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a><br>
</div>> <mailto:<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>>><br>
<div class="im">><br>
><br>
>     +}<br>
>     diff --git<br>
>     a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt<br>
>     b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt<br>
>     index 32a28ba..2e2e1b8 100644<br>
>     --- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt<br>
>     +++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt<br>
>     @@ -9,6 +9,7 @@ link_libraries (<br>
>             ${OPENGL_glu_LIBRARY}<br>
>      )<br>
><br>
>     +piglit_add_executable (arb_separate_shader_object-400-combinations<br>
>     400-combinations.c)<br>
>      piglit_add_executable<br>
>     (arb_separate_shader_object-GetProgramPipelineiv GetProgramPipelineiv.c)<br>
>      piglit_add_executable (arb_separate_shader_object-IsProgramPipeline<br>
>     IsProgramPipeline.c)<br>
>      piglit_add_executable<br>
>     (arb_separate_shader_object-mix_pipeline_useprogram<br>
>     mix_pipeline_useprogram.c)<br>
>     --<br>
>     1.8.1.4<br>
><br>
>     _______________________________________________<br>
>     Piglit mailing list<br>
</div>>     <a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a> <mailto:<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a>><br>
>     <a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
<br>
</blockquote></div><br></div></div>