radeonsi: add SI_MAX_ATTRIBS
authorMarek Olšák <marek.olsak@amd.com>
Fri, 28 Aug 2015 20:33:02 +0000 (22:33 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 1 Sep 2015 19:51:13 +0000 (21:51 +0200)
PIPE_MAX_ATTRIBS is 32, but we currently only support 16.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h

index b3a18267af11ab14763df8da50c48f8745434fb0..62eda97dc7e92be9a90100577b52ec37f99368a4 100644 (file)
@@ -2784,7 +2784,7 @@ static void *si_create_vertex_elements(struct pipe_context *ctx,
        struct si_vertex_element *v = CALLOC_STRUCT(si_vertex_element);
        int i;
 
-       assert(count < PIPE_MAX_ATTRIBS);
+       assert(count < SI_MAX_ATTRIBS);
        if (!v)
                return NULL;
 
index 242db8afd45364de0c4adba4e8940647d27f99eb..bf713c42e867cc7d86eac6cce8007da52f7e77f1 100644 (file)
@@ -31,6 +31,7 @@
 #include "radeon/r600_pipe_common.h"
 
 #define SI_NUM_SHADERS (PIPE_SHADER_TESS_EVAL+1)
+#define SI_MAX_ATTRIBS 16
 
 struct si_screen;
 struct si_shader;
@@ -84,9 +85,9 @@ struct si_state_dsa {
 struct si_vertex_element
 {
        unsigned                        count;
-       uint32_t                        rsrc_word3[PIPE_MAX_ATTRIBS];
-       uint32_t                        format_size[PIPE_MAX_ATTRIBS];
-       struct pipe_vertex_element      elements[PIPE_MAX_ATTRIBS];
+       uint32_t                        rsrc_word3[SI_MAX_ATTRIBS];
+       uint32_t                        format_size[SI_MAX_ATTRIBS];
+       struct pipe_vertex_element      elements[SI_MAX_ATTRIBS];
 };
 
 union si_state {
@@ -156,7 +157,7 @@ struct si_shader_data {
 #define SI_SO_BUF_OFFSET       SI_NUM_RING_BUFFERS
 #define SI_NUM_RW_BUFFERS      (SI_SO_BUF_OFFSET + 4)
 
-#define SI_NUM_VERTEX_BUFFERS  16
+#define SI_NUM_VERTEX_BUFFERS  SI_MAX_ATTRIBS
 
 
 /* This represents descriptors in memory, such as buffer resources,