i965/fs: Add a MAX_GRF_SIZE define and use it various places

Previously, we had a MAX_SAMPLER_MESSAGE_SIZE which we used instead.
However, some FB write messages can validly be longer than this so we need
something different.  Since MAX_SAMPLER_MESSAGE_SIZE is validly useful on
its own, we leave it alone and add a new MAX_GRF_SIZE that's big enough for
FB writes.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84539
Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
Jason Ekstrand 2014-10-01 10:54:59 -07:00
parent b33e5465a7
commit 50d0e2e118
4 changed files with 9 additions and 6 deletions

View file

@ -1924,6 +1924,7 @@ fs_visitor::split_virtual_grfs()
* new virtual GRF for the previous offset many registers
*/
if (split_points[reg]) {
assert(offset <= MAX_VGRF_SIZE);
int grf = virtual_grf_alloc(offset);
for (int k = reg - offset; k < reg; k++)
new_virtual_grf[k] = grf;
@ -1935,6 +1936,7 @@ fs_visitor::split_virtual_grfs()
}
/* The last one gets the original register number */
assert(offset <= MAX_VGRF_SIZE);
virtual_grf_sizes[i] = offset;
for (int k = reg - offset; k < reg; k++)
new_virtual_grf[k] = i;

View file

@ -52,6 +52,7 @@ extern "C" {
#include "glsl/ir.h"
#define MAX_SAMPLER_MESSAGE_SIZE 11
#define MAX_VGRF_SIZE 16
struct bblock_t;
namespace {

View file

@ -105,7 +105,7 @@ brw_alloc_reg_set(struct intel_screen *screen, int reg_width)
int class_sizes[BRW_MAX_MRF];
if (devinfo->gen >= 7) {
for (class_count = 0; class_count < BRW_MAX_MRF; class_count++)
for (class_count = 0; class_count < MAX_VGRF_SIZE; class_count++)
class_sizes[class_count] = class_count + 1;
} else {
for (class_count = 0; class_count < 4; class_count++)

View file

@ -161,10 +161,10 @@ fs_visitor::register_coalesce()
int src_size = 0;
int channels_remaining = 0;
int reg_from = -1, reg_to = -1;
int reg_to_offset[MAX_SAMPLER_MESSAGE_SIZE];
fs_inst *mov[MAX_SAMPLER_MESSAGE_SIZE];
int var_to[MAX_SAMPLER_MESSAGE_SIZE];
int var_from[MAX_SAMPLER_MESSAGE_SIZE];
int reg_to_offset[MAX_VGRF_SIZE];
fs_inst *mov[MAX_VGRF_SIZE];
int var_to[MAX_VGRF_SIZE];
int var_from[MAX_VGRF_SIZE];
foreach_block_and_inst(block, fs_inst, inst, cfg) {
if (!is_coalesce_candidate(this, inst))
@ -180,7 +180,7 @@ fs_visitor::register_coalesce()
reg_from = inst->src[0].reg;
src_size = virtual_grf_sizes[inst->src[0].reg];
assert(src_size <= MAX_SAMPLER_MESSAGE_SIZE);
assert(src_size <= MAX_VGRF_SIZE);
assert(inst->src[0].width % 8 == 0);
channels_remaining = src_size;