vc4: Drop maximum number of varyings down to 8.
authorEric Anholt <eric@anholt.net>
Wed, 24 Sep 2014 00:25:43 +0000 (17:25 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 24 Sep 2014 07:25:07 +0000 (00:25 -0700)
There are only 32 bits in the flatshade flags (which are 1 bit per
component), the simulator crashes when you use more than about this many
varyings, and the original Broadcom code drop only exposed 8 as well.

Fixes 26 piglit tests in the varying-packing group, and makes many others
go from crash to fail (due to not checking their varying counts and
treating link failures as failures).  Regresses ARB_fp/minmax (due to 8
varyings instead of 10).

src/gallium/drivers/vc4/vc4_screen.c

index 4a5ce4feee7f51047e3a76ce7b27699ec2b5fe07..81a29a5ef2e8387a0c323542ce64dd341ace18aa 100644 (file)
@@ -276,7 +276,10 @@ vc4_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
         case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
                 return 0;
         case PIPE_SHADER_CAP_MAX_INPUTS:
-                return 16;
+                if (shader == PIPE_SHADER_FRAGMENT)
+                        return 8;
+                else
+                        return 16;
         case PIPE_SHADER_CAP_MAX_TEMPS:
                 return 256; /* GL_MAX_PROGRAM_TEMPORARIES_ARB */
         case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: