OSDN Git Service

v3d: Fix overly-large vattr_sizes structs.
authorEric Anholt <eric@anholt.net>
Fri, 18 Jan 2019 23:54:48 +0000 (15:54 -0800)
committerEric Anholt <eric@anholt.net>
Sun, 27 Jan 2019 16:30:03 +0000 (08:30 -0800)
We want one vector size per vector, not per component.

src/broadcom/compiler/v3d_compiler.h

index de56d7e..a613146 100644 (file)
@@ -557,7 +557,7 @@ struct v3d_compile {
         struct qreg cs_shared_offset;
         int local_invocation_index_bits;
 
-        uint8_t vattr_sizes[V3D_MAX_VS_INPUTS];
+        uint8_t vattr_sizes[V3D_MAX_VS_INPUTS / 4];
         uint32_t num_vpm_writes;
 
         /* Size in bytes of registers that have been spilled. This is how much
@@ -686,7 +686,7 @@ struct v3d_vs_prog_data {
         bool uses_iid, uses_vid;
 
         /* Number of components read from each vertex attribute. */
-        uint8_t vattr_sizes[32];
+        uint8_t vattr_sizes[V3D_MAX_VS_INPUTS / 4];
 
         /* Total number of components read, for the shader state record. */
         uint32_t vpm_input_size;