From 8928d7860a6b14ec57c3a600bc429e4563990ead Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 19 Feb 2014 15:36:48 +0100 Subject: [PATCH] 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 --- src/mesa/drivers/dri/i965/brw_fs.h | 2 +- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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() -- 2.30.2