i965/fs: Allocate the param_size array dynamically.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 19 Feb 2014 14:36:48 +0000 (15:36 +0100)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 19 Feb 2014 18:03:56 +0000 (19:03 +0100)
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 <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 0362c5d3cd7153961683aab3bba5690dec362964..eb9e1bf06a39a4a73dfabef0e659b5ddfb775cff 100644 (file)
@@ -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;
index b0fed9eecdac43b8630dc89fcda0068ab02d48f5..aea3360a33fbbfd0c7e0612d1033bb359f932d54 100644 (file)
@@ -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()