<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 2012/1/5 6:47, Paul Berry wrote:
    <blockquote
cite="mid:CA+yLL64qEOcmq0z6pSFA1YP7vpHRwsW_GYvnOA+_xJ8SBFWbMg@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      On 4 January 2012 13:36, Ian Romanick <span dir="ltr">&lt;<a
          moz-do-not-send="true" href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>&gt;</span>
      wrote:<br>
      <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 01/02/2012 02:32 PM, Paul Berry wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              This test verifies that the implementation correctly
              detects all of<br>
              the errors specified in the "Errors" section of the<br>
              EXT_transform_feedback spec, with the following exceptions
              (which seem<br>
              like they should be handled in separate tests):<br>
              <br>
              - Errors related to BeginQuery and EndQuery.<br>
              <br>
              - Error due to mismatch of transform feedback mode and
              drawing mode<br>
              &nbsp; (e.g. drawing GL_LINES when transform feedback is
              expecting<br>
              &nbsp; GL_TRIANGLES).<br>
              <br>
              - Errors due to exceeding MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTIBS
              in<br>
              &nbsp; a call to TransformFeedbackVaryings,
              GetTransformFeedbackVarying,<br>
              &nbsp; or<br>
              &nbsp; Get{Integer,Boolean}Indexedv(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING).<br>
            </blockquote>
            <br>
          </div>
          Aside from one comment in the code below, the series is<br>
          <br>
          Reviewed-by: Ian Romanick &lt;<a moz-do-not-send="true"
            href="mailto:ian.d.romanick@intel.com" target="_blank">ian.d.romanick@intel.com</a>&gt;<br>
          <br>
          For future tests, I think we should structure them
          differently. &nbsp;Tests like this can be hard to follow because
          you have to look in N places to see what each subtest actually
          does. &nbsp;I'm not sure what the right answer is, or I'd suggest
          using it for this test. :)</blockquote>
        <div><br>
          Yeah, I know where you're coming from.&nbsp; The difficulty seems
          to be that the tests need to all do nearly the same thing,
          each with a special exception.&nbsp; How do we avoid duplicating
          all the stuff that's nearly the same, while at the same time
          making it easy to understand each subtest?<br>
          <br>
          I'll try to experiment with other designs; let me know if you
          have any ideas.<br>
          &nbsp;</div>
        <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div>
            <div class="h5"><br>
              <br>
              <blockquote class="gmail_quote" style="margin:0 0 0
                .8ex;border-left:1px #ccc solid;padding-left:1ex">
                ---<br>
                &nbsp;tests/all.tests &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp;
                18 +<br>
                &nbsp;.../spec/ext_transform_feedback/CMakeLists.gl.txt &nbsp;| &nbsp;
                &nbsp;1 +<br>
                &nbsp;tests/spec/ext_transform_feedback/api-errors.c &nbsp; &nbsp; |
                &nbsp;377 ++++++++++++++++++++<br>
                &nbsp;3 files changed, 396 insertions(+), 0 deletions(-)<br>
                &nbsp;create mode 100644 tests/spec/ext_transform_feedback/api-errors.c<br>
                <br>
                diff --git a/tests/all.tests b/tests/all.tests<br>
                index 9002ada..0290f4c 100644<br>
                --- a/tests/all.tests<br>
                +++ b/tests/all.tests<br>
                @@ -1392,6 +1392,24 @@ ext_timer_query['time-elapsed'] =
                concurrent_test('ext_timer_query-time-elapsed'<br>
                <br>
                &nbsp;ext_transform_feedback = Group()<br>
                &nbsp;spec['EXT_transform_feedback'] = ext_transform_feedback<br>
                +for mode in ['interleaved_ok_base',
                'interleaved_ok_range',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'interleaved_ok_offset',
                'interleaved_unbound',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'interleaved_no_varyings',
                'separate_ok_1',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'separate_unbound_0_1', 'separate_ok_2',
                'separate_unbound_0_2',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'separate_unbound_1_2',
                'separate_no_varyings', 'no_prog_active',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'begin_active', 'useprog_active',
                'link_current_active',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'link_other_active', 'bind_base_active',
                'bind_range_active',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_offset_active', 'end_inactive',
                'bind_base_max',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_range_max', 'bind_offset_max',
                'bind_range_size_m4',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_range_size_0', 'bind_range_size_1',
                'bind_range_size_2',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_range_size_3', 'bind_range_size_5',
                'bind_range_offset_1',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_range_offset_2',
                'bind_range_offset_3',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_range_offset_5',
                'bind_offset_offset_1',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_offset_offset_2',
                'bind_offset_offset_3',<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'bind_offset_offset_5', 'not_a_program']:<br>
                + &nbsp; &nbsp; &nbsp; &nbsp;test_name = 'api-errors {0}'.format(mode)<br>
                + &nbsp; &nbsp; &nbsp; &nbsp;ext_transform_feedback[test_name] =
                PlainExecTest(<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'ext_transform_feedback-{0}
                -auto'.format(test_name))<br>
                &nbsp;for varying in ['gl_Color', 'gl_SecondaryColor',
                'gl_TexCoord',<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'gl_FogFragCoord', 'gl_Position',
                'gl_PointSize',<br>
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'gl_ClipVertex', 'gl_ClipDistance']:<br>
                diff --git a/tests/spec/ext_transform_feedback/CMakeLists.gl.txt
                b/tests/spec/ext_transform_feedback/CMakeLists.gl.txt<br>
                index 8073a70..305f589 100644<br>
                --- a/tests/spec/ext_transform_feedback/CMakeLists.gl.txt<br>
                +++ b/tests/spec/ext_transform_feedback/CMakeLists.gl.txt<br>
                @@ -13,6 +13,7 @@ link_libraries (<br>
                &nbsp;)<br>
                <br>
                &nbsp;add_executable (ext_transform_feedback-alignment
                alignment.c)<br>
                +add_executable (ext_transform_feedback-api-errors
                api-errors.c)<br>
                &nbsp;add_executable (ext_transform_feedback-builtin-varyings
                builtin-varyings.c)<br>
                &nbsp;add_executable (ext_transform_feedback-discard-api
                discard-api.c)<br>
                &nbsp;add_executable (ext_transform_feedback-discard-bitmap
                discard-bitmap.c)<br>
                diff --git a/tests/spec/ext_transform_feedback/api-errors.c
                b/tests/spec/ext_transform_feedback/api-errors.c<br>
                new file mode 100644<br>
                index 0000000..486f5f4<br>
                --- /dev/null<br>
                +++ b/tests/spec/ext_transform_feedback/api-errors.c<br>
                @@ -0,0 +1,377 @@<br>
                +/*<br>
                + * Copyright &copy; 2011 Intel Corporation<br>
                + *<br>
                + * Permission is hereby granted, free of charge, to any
                person obtaining a<br>
                + * copy of this software and associated documentation
                files (the "Software"),<br>
                + * to deal in the Software without restriction,
                including without limitation<br>
                + * the rights to use, copy, modify, merge, publish,
                distribute, sublicense,<br>
                + * and/or sell copies of the Software, and to permit
                persons to 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 the next<br>
                + * paragraph) shall be included in all copies or
                substantial portions of the<br>
                + * Software.<br>
                + *<br>
                + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
                OF ANY KIND, EXPRESS OR<br>
                + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
                OF MERCHANTABILITY,<br>
                + * FITNESS FOR A PARTICULAR PURPOSE AND
                NONINFRINGEMENT. &nbsp;IN NO EVENT SHALL<br>
                + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
                CLAIM, DAMAGES OR OTHER<br>
                + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
                OTHERWISE, ARISING<br>
                + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
                THE USE OR OTHER<br>
                + * DEALINGS IN THE SOFTWARE.<br>
                + */<br>
                +<br>
                +/**<br>
                + * \file api-errors.c<br>
                + *<br>
                + * Test that the implementation flags various<br>
                + * transform-feedback-related error conditions.<br>
                + *<br>
                + * This test covers all of the error conditions as
                specified in the<br>
                + * "Errors" section of the EXT_transform_feedback spec,
                with the<br>
                + * following exceptions:<br>
                + *<br>
                + * - Errors related to BeginQuery and EndQuery.<br>
                + *<br>
                + * - Error due to mismatch of transform feedback mode
                and drawing mode<br>
                + * &nbsp; (e.g. drawing GL_LINES when transform feedback is
                expecting<br>
                + * &nbsp; GL_TRIANGLES).<br>
                + *<br>
                + * - Errors due to exceeding MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTIBS
                in<br>
                + * &nbsp; a call to TransformFeedbackVaryings,
                GetTransformFeedbackVarying,<br>
                + * &nbsp; or<br>
                + * &nbsp; Get{Integer,Boolean}Indexedv(GL_TRANSFORM_FEEDBACK_BUFFER_BINDING).<br>
                + *<br>
                + * In addition, there are a few tests which verify that
                errors do not<br>
                + * occur during normal operation ("interleaved_ok_*",
                "separate_ok_*",<br>
                + * and "link_other_active"). &nbsp;These tests help to
                verify that the<br>
                + * implementation is not overly aggressive in flagging
                errors.<br>
                + */<br>
                +<br>
                +#include "piglit-util.h"<br>
                +<br>
                +int piglit_width = 16;<br>
                +int piglit_height = 16;<br>
                +int piglit_window_mode = GLUT_DOUBLE | GLUT_RGB;<br>
                +<br>
                +#define XFB_BUFFER_SIZE 12<br>
                +#define NUM_BUFFERS 2<br>
                +<br>
                +enum test_mode {<br>
                + &nbsp; &nbsp; &nbsp; NORMAL,<br>
                + &nbsp; &nbsp; &nbsp; NO_VARYINGS,<br>
                + &nbsp; &nbsp; &nbsp; UNBOUND_BUFFER,<br>
                + &nbsp; &nbsp; &nbsp; SKIP_USE_PROGRAM,<br>
                + &nbsp; &nbsp; &nbsp; BEGIN_ACTIVE,<br>
                + &nbsp; &nbsp; &nbsp; USEPROG_ACTIVE,<br>
                + &nbsp; &nbsp; &nbsp; LINK_CURRENT_ACTIVE,<br>
                + &nbsp; &nbsp; &nbsp; LINK_OTHER_ACTIVE,<br>
                + &nbsp; &nbsp; &nbsp; BIND_ACTIVE,<br>
                + &nbsp; &nbsp; &nbsp; END_INACTIVE,<br>
                + &nbsp; &nbsp; &nbsp; BIND_MAX,<br>
                + &nbsp; &nbsp; &nbsp; BIND_BAD_SIZE,<br>
                + &nbsp; &nbsp; &nbsp; BIND_BAD_OFFSET,<br>
                + &nbsp; &nbsp; &nbsp; NOT_A_PROGRAM,<br>
                +};<br>
                +<br>
                +enum bind_mode {<br>
                + &nbsp; &nbsp; &nbsp; BASE,<br>
                + &nbsp; &nbsp; &nbsp; RANGE,<br>
                + &nbsp; &nbsp; &nbsp; OFFSET,<br>
                +};<br>
                +<br>
                +static const char *vstext =<br>
                + &nbsp; &nbsp; &nbsp; "varying vec4 foo;\n"<br>
                + &nbsp; &nbsp; &nbsp; "varying vec4 bar;\n"<br>
                + &nbsp; &nbsp; &nbsp; "\n"<br>
                + &nbsp; &nbsp; &nbsp; "void main()\n"<br>
                + &nbsp; &nbsp; &nbsp; "{\n"<br>
                + &nbsp; &nbsp; &nbsp; " &nbsp;foo = vec4(1.0);\n"<br>
                + &nbsp; &nbsp; &nbsp; " &nbsp;bar = vec4(1.0);\n"<br>
                + &nbsp; &nbsp; &nbsp; " &nbsp;gl_Position = vec4(1.0);\n"<br>
                + &nbsp; &nbsp; &nbsp; "}\n";<br>
                +<br>
                +static const char *varyings[] = { "foo", "bar" };<br>
                +<br>
                +static struct test_desc<br>
                +{<br>
                + &nbsp; &nbsp; &nbsp; const char *name;<br>
                + &nbsp; &nbsp; &nbsp; enum test_mode mode;<br>
                + &nbsp; &nbsp; &nbsp; int param;<br>
                + &nbsp; &nbsp; &nbsp; enum bind_mode bind_mode;<br>
                + &nbsp; &nbsp; &nbsp; GLenum buffer_mode;<br>
                + &nbsp; &nbsp; &nbsp; int num_buffers;<br>
                + &nbsp; &nbsp; &nbsp; GLboolean skip_use_program;<br>
                +} tests[] = {<br>
                + &nbsp; &nbsp; &nbsp; /* name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;mode &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; param &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; num_buffers<br>
                + &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp; &nbsp;bind_mode<br>
                + &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;buffer_mode<br>
                + &nbsp; &nbsp; &nbsp; &nbsp;*/<br>
                + &nbsp; &nbsp; &nbsp; { "interleaved_ok_base", &nbsp; &nbsp; NORMAL, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "interleaved_ok_range", &nbsp; &nbsp;NORMAL, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "interleaved_ok_offset", &nbsp; NORMAL, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "interleaved_unbound", &nbsp; &nbsp; UNBOUND_BUFFER, &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "interleaved_no_varyings", NO_VARYINGS, &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp;0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "separate_ok_1", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NORMAL, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_SEPARATE_ATTRIBS, &nbsp; &nbsp;1 },<br>
                + &nbsp; &nbsp; &nbsp; { "separate_unbound_0_1", &nbsp; &nbsp;UNBOUND_BUFFER, &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_SEPARATE_ATTRIBS, &nbsp; &nbsp;1 },<br>
                + &nbsp; &nbsp; &nbsp; { "separate_ok_2", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NORMAL, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_SEPARATE_ATTRIBS, &nbsp; &nbsp;2 },<br>
                + &nbsp; &nbsp; &nbsp; { "separate_unbound_0_2", &nbsp; &nbsp;UNBOUND_BUFFER, &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_SEPARATE_ATTRIBS, &nbsp; &nbsp;2 },<br>
                + &nbsp; &nbsp; &nbsp; { "separate_unbound_1_2", &nbsp; &nbsp;UNBOUND_BUFFER, &nbsp; &nbsp;
                &nbsp; 1, BASE, &nbsp; GL_SEPARATE_ATTRIBS, &nbsp; &nbsp;2 },<br>
                + &nbsp; &nbsp; &nbsp; { "separate_no_varyings", &nbsp; &nbsp;NO_VARYINGS, &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp;0, BASE, &nbsp; GL_SEPARATE_ATTRIBS, &nbsp; &nbsp;1 },<br>
                + &nbsp; &nbsp; &nbsp; { "no_prog_active", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;SKIP_USE_PROGRAM, &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "begin_active", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BEGIN_ACTIVE, &nbsp; &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "useprog_active", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;USEPROG_ACTIVE, &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "link_current_active", &nbsp; &nbsp;
                LINK_CURRENT_ACTIVE, &nbsp;0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS,
                1 },<br>
                + &nbsp; &nbsp; &nbsp; { "link_other_active", &nbsp; &nbsp; &nbsp; LINK_OTHER_ACTIVE,
                &nbsp; &nbsp;0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_base_active", &nbsp; &nbsp; &nbsp; &nbsp;BIND_ACTIVE, &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp;0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_active", &nbsp; &nbsp; &nbsp; BIND_ACTIVE, &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp;0, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_offset_active", &nbsp; &nbsp; &nbsp;BIND_ACTIVE, &nbsp; &nbsp; &nbsp;
                &nbsp; &nbsp;0, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "end_inactive", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END_INACTIVE, &nbsp; &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_base_max", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BIND_MAX, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_max", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BIND_MAX, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_offset_max", &nbsp; &nbsp; &nbsp; &nbsp; BIND_MAX, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                &nbsp; 0, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_size_m4", &nbsp; &nbsp; &nbsp;BIND_BAD_SIZE, &nbsp; &nbsp;
                &nbsp; -4, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_size_0", &nbsp; &nbsp; &nbsp; BIND_BAD_SIZE, &nbsp; &nbsp;
                &nbsp; &nbsp;0, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_size_1", &nbsp; &nbsp; &nbsp; BIND_BAD_SIZE, &nbsp; &nbsp;
                &nbsp; &nbsp;1, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_size_2", &nbsp; &nbsp; &nbsp; BIND_BAD_SIZE, &nbsp; &nbsp;
                &nbsp; &nbsp;2, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_size_3", &nbsp; &nbsp; &nbsp; BIND_BAD_SIZE, &nbsp; &nbsp;
                &nbsp; &nbsp;3, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_size_5", &nbsp; &nbsp; &nbsp; BIND_BAD_SIZE, &nbsp; &nbsp;
                &nbsp; &nbsp;5, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_offset_1", &nbsp; &nbsp; BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;1, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_offset_2", &nbsp; &nbsp; BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;2, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_offset_3", &nbsp; &nbsp; BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;3, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_range_offset_5", &nbsp; &nbsp; BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;5, RANGE, &nbsp;GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_offset_offset_1", &nbsp; &nbsp;BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;1, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_offset_offset_2", &nbsp; &nbsp;BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;2, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_offset_offset_3", &nbsp; &nbsp;BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;3, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "bind_offset_offset_5", &nbsp; &nbsp;BIND_BAD_OFFSET, &nbsp;
                &nbsp; &nbsp;5, OFFSET, GL_INTERLEAVED_ATTRIBS, 1 },<br>
                + &nbsp; &nbsp; &nbsp; { "not_a_program", &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NOT_A_PROGRAM, &nbsp; &nbsp;
                &nbsp; &nbsp;0, BASE, &nbsp; GL_INTERLEAVED_ATTRIBS, 1 },<br>
                +};<br>
                +<br>
                +static void<br>
                +do_bind(const struct test_desc *test, GLuint buf, int
                i)<br>
                +{<br>
                + &nbsp; &nbsp; &nbsp; int size = test-&gt;mode == BIND_BAD_SIZE<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? test-&gt;param :
                sizeof(float[XFB_BUFFER_SIZE]);<br>
                + &nbsp; &nbsp; &nbsp; int offset = test-&gt;mode == BIND_BAD_OFFSET<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? test-&gt;param : 0;<br>
                +<br>
                + &nbsp; &nbsp; &nbsp; switch (test-&gt;bind_mode) {<br>
                + &nbsp; &nbsp; &nbsp; case BASE:<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf("BindBufferBase(buffer %i)\n",
                i);<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; piglit_BindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER,
                i, buf);<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>
                + &nbsp; &nbsp; &nbsp; case RANGE:<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf("BindBufferRange(buffer %i,
                offset=%i, size=%i)\n", i,<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;offset, size);<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; piglit_BindBufferRange(GL_TRANSFORM_FEEDBACK_BUFFER,
                i, buf,<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;offset, size);<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>
                + &nbsp; &nbsp; &nbsp; case OFFSET:<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf("BindBufferOffsetEXT(buffer %i,
                offset=%i)\n", i,<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;offset);<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; glBindBufferOffsetEXT(GL_TRANSFORM_FEEDBACK_BUFFER,
                i, buf,<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; offset);<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>
                + &nbsp; &nbsp; &nbsp; }<br>
                +}<br>
                +<br>
                +static GLboolean<br>
                +do_test(const struct test_desc *test)<br>
                +{<br>
                + &nbsp; &nbsp; &nbsp; GLuint vs;<br>
                + &nbsp; &nbsp; &nbsp; GLuint progs[2];<br>
                + &nbsp; &nbsp; &nbsp; GLuint bufs[NUM_BUFFERS];<br>
                + &nbsp; &nbsp; &nbsp; float initial_xfb_buffer_contents[XFB_BUFFER_SIZE];<br>
                + &nbsp; &nbsp; &nbsp; GLboolean pass = GL_TRUE;<br>
                + &nbsp; &nbsp; &nbsp; int i;<br>
                + &nbsp; &nbsp; &nbsp; int num_varyings = test-&gt;mode == NO_VARYINGS
                ? 0 : test-&gt;num_buffers;<br>
                + &nbsp; &nbsp; &nbsp; GLint max_separate_attribs;<br>
                +<br>
                + &nbsp; &nbsp; &nbsp; glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &amp;max_separate_attribs);<br>
                + &nbsp; &nbsp; &nbsp; printf("MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTIBS=%i\n",<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max_separate_attribs);<br>
                +<br>
                + &nbsp; &nbsp; &nbsp; printf("Compile vertex shader\n");<br>
                + &nbsp; &nbsp; &nbsp; vs = piglit_compile_shader_text(GL_VERTEX_SHADER,
                vstext);<br>
                + &nbsp; &nbsp; &nbsp; if (test-&gt;mode == NOT_A_PROGRAM) {<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf("Create a buffer to use instead
                of a program\n");<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; glGenBuffers(1, progs);<br>
                + &nbsp; &nbsp; &nbsp; } else {<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progs[0] = piglit_CreateProgram();<br>
                + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; piglit_AttachShader(progs[0], vs);<br>
                + &nbsp; &nbsp; &nbsp; }<br>
              </blockquote>
              <br>
            </div>
          </div>
          This may work, but it's a bit sketchy. &nbsp;Each kind of object
          from a Gen function or Create function is in a separate
          namespace. &nbsp;It is conceivable that the name from GenBuffers
          and the handle from CreateProgram could have the same value.
          &nbsp;It should work in this case because no program has ever been
          created.<br>
          <br>
          A better approach is to create a program and immediately
          delete it. Since the program was never used, the delete will
          take effect immediately. &nbsp;As long as there are no intervening
          CreateProgram calls, you can be sure the deleted program will
          be invalid.<br>
        </blockquote>
        <div><br>
          Ah, I didn't realize that.&nbsp; I'll make the fix and retest on
          both Mesa and nVidia before pushing the patch.<br>
        </div>
      </div>
    </blockquote>
    <br>
    Oh, didn't notice you have been working on writing such a test,
    while I'm trying to reproduce the segmentation fault triggered by
    Oglconform case (GL30)transform_feedback(negative.noShaders)<br>
    Please ignore my little case just sent (Also that oglconform case
    passed now)<br>
    <br>
    Thanks<br>
    &nbsp;&nbsp;&nbsp; --Shuang<br>
    <br>
    <br>
    <blockquote
cite="mid:CA+yLL64qEOcmq0z6pSFA1YP7vpHRwsW_GYvnOA+_xJ8SBFWbMg@mail.gmail.com"
      type="cite">
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Piglit mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/piglit">http://lists.freedesktop.org/mailman/listinfo/piglit</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>