summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2012-10-26 17:37:07 +0200
committerMarek Olšák <maraeo@gmail.com>2012-10-29 12:51:41 +0100
commitb3921e1f53833420e0a0fd581f741744e7957a05 (patch)
treee16146e47d22c009490dc9a0cf294c503b3a511c
parent00e6819e9964458395c597b9b1745a913c5c889b (diff)
mesa: bump MAX_VARYING to 32
We're starting to get apps utilizing more than 16 varyings and most current hardware supports 32 anyway. Tested with r600g. swrast, softpipe and llvmpipe still advertise 16 varyings. This fixes a WebGL crash after launching this demo: https://developer.mozilla.org/en-US/demos/detail/falling-cubes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54402 NOTE: This is a candidate for the stable branches. Acked-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c2
-rw-r--r--src/gallium/include/pipe/p_state.h4
-rw-r--r--src/mesa/main/config.h2
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/program/prog_print.c36
5 files changed, 39 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 3fe78e0b7f0..3c2a923181e 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -70,13 +70,13 @@ struct ureg_tokens {
unsigned order;
unsigned count;
};
#define UREG_MAX_INPUT PIPE_MAX_ATTRIBS
#define UREG_MAX_SYSTEM_VALUE PIPE_MAX_ATTRIBS
-#define UREG_MAX_OUTPUT PIPE_MAX_ATTRIBS
+#define UREG_MAX_OUTPUT PIPE_MAX_SHADER_OUTPUTS
#define UREG_MAX_CONSTANT_RANGE 32
#define UREG_MAX_IMMEDIATE 256
#define UREG_MAX_ADDR 2
#define UREG_MAX_PRED 1
struct const_decl {
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index 6d0db0f86f8..f84bfd79d6a 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -56,13 +56,13 @@ extern "C" {
#define PIPE_MAX_ATTRIBS 32
#define PIPE_MAX_CLIP_PLANES 8
#define PIPE_MAX_COLOR_BUFS 8
#define PIPE_MAX_CONSTANT_BUFFERS 32
#define PIPE_MAX_SAMPLERS 16
#define PIPE_MAX_SHADER_INPUTS 32
-#define PIPE_MAX_SHADER_OUTPUTS 32
+#define PIPE_MAX_SHADER_OUTPUTS 48 /* 32 GENERICs + POS, PSIZE, FOG, etc. */
#define PIPE_MAX_SHADER_SAMPLER_VIEWS 32
#define PIPE_MAX_SHADER_RESOURCES 32
#define PIPE_MAX_TEXTURE_LEVELS 16
#define PIPE_MAX_SO_BUFFERS 4
@@ -142,13 +142,13 @@ struct pipe_rasterizer_state
*/
unsigned clip_plane_enable:PIPE_MAX_CLIP_PLANES;
unsigned line_stipple_factor:8; /**< [1..256] actually */
unsigned line_stipple_pattern:16;
- unsigned sprite_coord_enable:PIPE_MAX_SHADER_OUTPUTS;
+ unsigned sprite_coord_enable; /* bitfield referring to 32 GENERIC inputs */
float line_width;
float point_size; /**< used when no per-vertex size */
float offset_units;
float offset_scale;
float offset_clamp;
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 1b72b5449fd..99910d7f36f 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -184,13 +184,13 @@
#define MAX_PROGRAM_MATRICES 8
#define MAX_PROGRAM_MATRIX_STACK_DEPTH 4
#define MAX_PROGRAM_CALL_DEPTH 8
#define MAX_PROGRAM_TEMPS 256
#define MAX_PROGRAM_ADDRESS_REGS 2
-#define MAX_VARYING 16 /**< number of float[4] vectors */
+#define MAX_VARYING 32 /**< number of float[4] vectors */
#define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS
#define MAX_PROGRAM_INPUTS 32
#define MAX_PROGRAM_OUTPUTS 64
/*@}*/
/** For GL_ARB_vertex_program */
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index b00c64233c2..a51073843f6 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -611,13 +611,13 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS;
ctx->Const.MaxRenderbufferSize = MAX_RENDERBUFFER_SIZE;
ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS;
- ctx->Const.MaxVarying = MAX_VARYING;
+ ctx->Const.MaxVarying = 16; /* old limit not to break tnl and swrast */
ctx->Const.MaxGeometryTextureImageUnits = MAX_GEOMETRY_TEXTURE_IMAGE_UNITS;
ctx->Const.MaxVertexVaryingComponents = MAX_VERTEX_VARYING_COMPONENTS;
ctx->Const.MaxGeometryVaryingComponents = MAX_GEOMETRY_VARYING_COMPONENTS;
ctx->Const.MaxGeometryOutputVertices = MAX_GEOMETRY_OUTPUT_VERTICES;
ctx->Const.MaxGeometryTotalOutputComponents = MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS;
diff --git a/src/mesa/program/prog_print.c b/src/mesa/program/prog_print.c
index a83cce4e3cd..dbaa4d01761 100644
--- a/src/mesa/program/prog_print.c
+++ b/src/mesa/program/prog_print.c
@@ -155,13 +155,29 @@ arb_input_attrib_string(GLint index, GLenum progType)
"fragment.varying[9]",
"fragment.varying[10]",
"fragment.varying[11]",
"fragment.varying[12]",
"fragment.varying[13]",
"fragment.varying[14]",
- "fragment.varying[15]" /* MAX_VARYING = 16 */
+ "fragment.varying[15]",
+ "fragment.varying[16]",
+ "fragment.varying[17]",
+ "fragment.varying[18]",
+ "fragment.varying[19]",
+ "fragment.varying[20]",
+ "fragment.varying[21]",
+ "fragment.varying[22]",
+ "fragment.varying[23]",
+ "fragment.varying[24]",
+ "fragment.varying[25]",
+ "fragment.varying[26]",
+ "fragment.varying[27]",
+ "fragment.varying[28]",
+ "fragment.varying[29]",
+ "fragment.varying[30]",
+ "fragment.varying[31]", /* MAX_VARYING = 32 */
};
/* sanity checks */
STATIC_ASSERT(Elements(vertAttribs) == VERT_ATTRIB_MAX);
STATIC_ASSERT(Elements(fragAttribs) == FRAG_ATTRIB_MAX);
assert(strcmp(vertAttribs[VERT_ATTRIB_TEX0], "vertex.texcoord[0]") == 0);
@@ -259,13 +275,29 @@ arb_output_attrib_string(GLint index, GLenum progType)
"result.varying[9]",
"result.varying[10]",
"result.varying[11]",
"result.varying[12]",
"result.varying[13]",
"result.varying[14]",
- "result.varying[15]" /* MAX_VARYING = 16 */
+ "result.varying[15]",
+ "result.varying[16]",
+ "result.varying[17]",
+ "result.varying[18]",
+ "result.varying[19]",
+ "result.varying[20]",
+ "result.varying[21]",
+ "result.varying[22]",
+ "result.varying[23]",
+ "result.varying[24]",
+ "result.varying[25]",
+ "result.varying[26]",
+ "result.varying[27]",
+ "result.varying[28]",
+ "result.varying[29]",
+ "result.varying[30]",
+ "result.varying[31]", /* MAX_VARYING = 32 */
};
static const char *const fragResults[] = {
"result.depth", /* FRAG_RESULT_DEPTH */
"result.(one)", /* FRAG_RESULT_STENCIL */
"result.color", /* FRAG_RESULT_COLOR */
"result.color[0]", /* FRAG_RESULT_DATA0 (named for GLSL's gl_FragData) */