Revert "glsl: move xfb BufferStride into gl_transform_feedback_info"
authorTimothy Arceri <timothy.arceri@collabora.com>
Sat, 24 Sep 2016 00:17:26 +0000 (10:17 +1000)
committerTimothy Arceri <timothy.arceri@collabora.com>
Sat, 24 Sep 2016 00:17:26 +0000 (10:17 +1000)
This reverts commit f5a6aab4031bc4754756c1773411728ad9a73381.

This broke some tests. It seems gl_transform_feedback_info gets memset
to 0 so we were losing the values in BufferStride before we used them.

src/compiler/glsl/link_varyings.cpp
src/compiler/glsl/linker.cpp
src/mesa/main/mtypes.h

index e339823a5fed7d13dc8f98b86314704aa0679c09..e622b3e46bc8e06629b599ecd99a3c4d8b6aba09 100644 (file)
@@ -1136,11 +1136,11 @@ store_tfeedback_info(struct gl_context *ctx, struct gl_shader_program *prog,
       /* Apply any xfb_stride global qualifiers */
       if (has_xfb_qualifiers) {
          for (unsigned j = 0; j < MAX_FEEDBACK_BUFFERS; j++) {
-            if (prog->LinkedTransformFeedback.BufferStride[j]) {
+            if (prog->TransformFeedback.BufferStride[j]) {
                buffers |= 1 << j;
                explicit_stride[j] = true;
                prog->LinkedTransformFeedback.Buffers[j].Stride =
-                  prog->LinkedTransformFeedback.BufferStride[j] / 4;
+                  prog->TransformFeedback.BufferStride[j] / 4;
             }
          }
       }
index 18062848e7aa8f3d278ce93f9273bfcb7da270b8..929a653e13700320cf9a618b791da006fcaec4a2 100644 (file)
@@ -1600,19 +1600,19 @@ link_xfb_stride_layout_qualifiers(struct gl_context *ctx,
 
    for (unsigned j = 0; j < MAX_FEEDBACK_BUFFERS; j++) {
       if (linked_shader->info.TransformFeedback.BufferStride[j]) {
-         prog->LinkedTransformFeedback.BufferStride[j] =
+         prog->TransformFeedback.BufferStride[j] =
             linked_shader->info.TransformFeedback.BufferStride[j];
 
          /* We will validate doubles at a later stage */
-         if (prog->LinkedTransformFeedback.BufferStride[j] % 4) {
+         if (prog->TransformFeedback.BufferStride[j] % 4) {
             linker_error(prog, "invalid qualifier xfb_stride=%d must be a "
                          "multiple of 4 or if its applied to a type that is "
                          "or contains a double a multiple of 8.",
-                         prog->LinkedTransformFeedback.BufferStride[j]);
+                         prog->TransformFeedback.BufferStride[j]);
             return;
          }
 
-         if (prog->LinkedTransformFeedback.BufferStride[j] / 4 >
+         if (prog->TransformFeedback.BufferStride[j] / 4 >
              ctx->Const.MaxTransformFeedbackInterleavedComponents) {
             linker_error(prog,
                          "The MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS "
index 5bbfd13cba70ae4cbc878857666c908fd18af6ce..85aeb1e0df3fdb1b8e47baec294bed7c77109177 100644 (file)
@@ -1696,9 +1696,6 @@ struct gl_transform_feedback_info
    struct gl_transform_feedback_varying_info *Varyings;
    GLint NumVarying;
 
-   /** Global xfb_stride out qualifier if any */
-   GLuint BufferStride[MAX_FEEDBACK_BUFFERS];
-
    struct gl_transform_feedback_buffer Buffers[MAX_FEEDBACK_BUFFERS];
 };
 
@@ -2743,6 +2740,8 @@ struct gl_shader_program
     */
    struct {
       GLenum BufferMode;
+      /** Global xfb_stride out qualifier if any */
+      GLuint BufferStride[MAX_FEEDBACK_BUFFERS];
       GLuint NumVarying;
       GLchar **VaryingNames;  /**< Array [NumVarying] of char * */
    } TransformFeedback;