From: Francisco Jerez Date: Wed, 19 Feb 2014 14:36:48 +0000 (+0100) Subject: i965/fs: Allocate the param_size array dynamically. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8928d7860a6b14ec57c3a600bc429e4563990ead;p=mesa.git i965/fs: Allocate the param_size array dynamically. Useful because the total number of uniform components might exceed MAX_UNIFORMS * 4 in some cases because of the image metadata we'll be passing as push constants. Reviewed-by: Paul Berry --- diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 0362c5d3cd7..eb9e1bf06a3 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -491,7 +491,7 @@ public: struct brw_wm_compile *c; unsigned int sanity_param_count; - int param_size[MAX_UNIFORMS * 4]; + int *param_size; int *virtual_grf_sizes; int virtual_grf_count; diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index b0fed9eecda..aea3360a33f 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -2992,7 +2992,7 @@ fs_visitor::fs_visitor(struct brw_context *brw, this->spilled_any_registers = false; - memset(&this->param_size, 0, sizeof(this->param_size)); + this->param_size = rzalloc_array(mem_ctx, int, stage_prog_data->nr_params); } fs_visitor::~fs_visitor()