diff options
author | Marek Olšák <marek.olsak@amd.com> | 2014-10-05 12:38:54 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2014-10-21 22:17:48 +0200 |
commit | 55a9b778c8c111a58f801dc20b64d0d0b0477e0d (patch) | |
tree | 070617fa1099393350ad173ac7ef846c0fc720d4 /src/gallium | |
parent | e827bb6fe747bfb5153d1d8c522b83ba8e07e3d6 (diff) |
radeonsi: statically declare resource and sampler arrays
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 6f2fb7b997..cd78f66832 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -68,8 +68,8 @@ struct si_shader_context LLVMValueRef const_resource[SI_NUM_CONST_BUFFERS]; LLVMValueRef ddxy_lds; LLVMValueRef *constants[SI_NUM_CONST_BUFFERS]; - LLVMValueRef *resources; - LLVMValueRef *samplers; + LLVMValueRef resources[SI_NUM_SAMPLER_VIEWS]; + LLVMValueRef samplers[SI_NUM_SAMPLER_STATES]; LLVMValueRef so_buffers[4]; LLVMValueRef gs_next_vertex; }; @@ -2435,10 +2435,6 @@ static void preload_samplers(struct si_shader_context *si_shader_ctx) if (num_samplers == 0) return; - /* Allocate space for the values */ - si_shader_ctx->resources = CALLOC(SI_NUM_SAMPLER_VIEWS, sizeof(LLVMValueRef)); - si_shader_ctx->samplers = CALLOC(num_samplers, sizeof(LLVMValueRef)); - res_ptr = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn, SI_PARAM_RESOURCE); samp_ptr = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn, SI_PARAM_SAMPLER); @@ -2790,8 +2786,6 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) out: for (int i = 0; i < SI_NUM_CONST_BUFFERS; i++) FREE(si_shader_ctx.constants[i]); - FREE(si_shader_ctx.resources); - FREE(si_shader_ctx.samplers); return r; } |