[Mesa-dev] [PATCH 5/8] tgsi_exec: use defines for max inputs/outputs

Dave Airlie airlied at gmail.com
Mon Jun 9 22:57:05 PDT 2014


From: Dave Airlie <airlied at redhat.com>

This fixes the limits for GL 3.2, and subsequently fixes
some segfaults in some varying packing tests and max varying tests
after the limits bumped.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/gallium/auxiliary/tgsi/tgsi_exec.c | 6 +++---
 src/gallium/auxiliary/tgsi/tgsi_exec.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c
index 9be1d13..69d98fd 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c
@@ -689,7 +689,7 @@ tgsi_exec_machine_bind_shader(
       struct tgsi_exec_vector *outputs;
 
       inputs = align_malloc(sizeof(struct tgsi_exec_vector) *
-                            TGSI_MAX_PRIM_VERTICES * PIPE_MAX_ATTRIBS,
+                            TGSI_MAX_PRIM_VERTICES * PIPE_MAX_SHADER_INPUTS,
                             16);
 
       if (!inputs)
@@ -823,8 +823,8 @@ tgsi_exec_machine_create( void )
    mach->MaxGeometryShaderOutputs = TGSI_MAX_TOTAL_VERTICES;
    mach->Predicates = &mach->Temps[TGSI_EXEC_TEMP_P0];
 
-   mach->Inputs = align_malloc(sizeof(struct tgsi_exec_vector) * PIPE_MAX_ATTRIBS, 16);
-   mach->Outputs = align_malloc(sizeof(struct tgsi_exec_vector) * PIPE_MAX_ATTRIBS, 16);
+   mach->Inputs = align_malloc(sizeof(struct tgsi_exec_vector) * PIPE_MAX_SHADER_INPUTS, 16);
+   mach->Outputs = align_malloc(sizeof(struct tgsi_exec_vector) * PIPE_MAX_SHADER_OUTPUTS, 16);
    if (!mach->Inputs || !mach->Outputs)
       goto fail;
 
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index bb56934..7a82f69 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -213,7 +213,7 @@ struct tgsi_sampler
  * input register files, this is the stride between two 1D
  * arrays.
  */
-#define TGSI_EXEC_MAX_INPUT_ATTRIBS 17
+#define TGSI_EXEC_MAX_INPUT_ATTRIBS PIPE_MAX_SHADER_INPUTS
 
 /* The maximum number of constant vectors per constant buffer.
  */
-- 
1.9.3



More information about the mesa-dev mailing list