radeonsi: use SI_MAX_ATTRIBS where it should be used
authorMarek Olšák <marek.olsak@amd.com>
Thu, 16 Feb 2017 10:39:01 +0000 (11:39 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 18 Feb 2017 00:22:08 +0000 (01:22 +0100)
for consistency; no change in behavior

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h

index 59022ed2af545d782cd461b9e50002bb31b572db..8f636af96aab576697a53fa49a199b8c0186bde0 100644 (file)
@@ -971,7 +971,7 @@ bool si_upload_vertex_buffer_descriptors(struct si_context *sctx)
                              desc->buffer, RADEON_USAGE_READ,
                              RADEON_PRIO_DESCRIPTORS);
 
-       assert(count <= SI_NUM_VERTEX_BUFFERS);
+       assert(count <= SI_MAX_ATTRIBS);
 
        for (i = 0; i < count; i++) {
                struct pipe_vertex_element *ve = &velems->elements[i];
index 61bcd2c3654fa19343140a60c0c0f0067096926c..a947bad5e42353548f4511d4c4ddba7c5ce067d8 100644 (file)
@@ -622,7 +622,7 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
        case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
                return 16384;
        case PIPE_SHADER_CAP_MAX_INPUTS:
-               return shader == PIPE_SHADER_VERTEX ? SI_NUM_VERTEX_BUFFERS : 32;
+               return shader == PIPE_SHADER_VERTEX ? SI_MAX_ATTRIBS : 32;
        case PIPE_SHADER_CAP_MAX_OUTPUTS:
                return shader == PIPE_SHADER_FRAGMENT ? 8 : 32;
        case PIPE_SHADER_CAP_MAX_TEMPS:
index de427789aae8aa5dc3df534d112e5cd75040714a..d3e3984e697ca758e935dae60a763c2078ad92b8 100644 (file)
@@ -5266,7 +5266,7 @@ static void create_function(struct si_shader_context *ctx)
        struct lp_build_tgsi_context *bld_base = &ctx->bld_base;
        struct gallivm_state *gallivm = bld_base->base.gallivm;
        struct si_shader *shader = ctx->shader;
-       LLVMTypeRef params[SI_NUM_PARAMS + SI_NUM_VERTEX_BUFFERS], v3i32;
+       LLVMTypeRef params[SI_NUM_PARAMS + SI_MAX_ATTRIBS], v3i32;
        LLVMTypeRef returns[16+32*4];
        unsigned i, last_sgpr, num_params, num_return_sgprs;
        unsigned num_returns = 0;
@@ -5282,7 +5282,7 @@ static void create_function(struct si_shader_context *ctx)
 
        switch (ctx->type) {
        case PIPE_SHADER_VERTEX:
-               params[SI_PARAM_VERTEX_BUFFERS] = const_array(ctx->v16i8, SI_NUM_VERTEX_BUFFERS);
+               params[SI_PARAM_VERTEX_BUFFERS] = const_array(ctx->v16i8, SI_MAX_ATTRIBS);
                params[SI_PARAM_BASE_VERTEX] = ctx->i32;
                params[SI_PARAM_START_INSTANCE] = ctx->i32;
                params[SI_PARAM_DRAWID] = ctx->i32;
index b7cf7ea7dbdee83fca034054853830e12017da17..0bb0f18f41aaeef838f6f32f03c68ca87d24a597 100644 (file)
@@ -341,7 +341,7 @@ struct si_shader_selector {
 
 /* Common VS bits between the shader key and the prolog key. */
 struct si_vs_prolog_bits {
-       unsigned        instance_divisors[SI_NUM_VERTEX_BUFFERS];
+       unsigned        instance_divisors[SI_MAX_ATTRIBS];
 };
 
 /* Common VS bits between the shader key and the epilog key. */