summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2013-12-10 16:22:56 -0800
committerMatt Turner <[email protected]>2014-01-21 14:09:33 -0800
commit2dfb0671395c383caf360a5690756f77afef6663 (patch)
tree09c2782ee5affb763351c1bd4b546e9a2cf8b0e8
parent81d52419cfaf143d9f157a2eff148a940a05ca69 (diff)
i965/fs: Add and use MAX_SAMPLER_MESSAGE_SIZE definition.
Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp3
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp10
3 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 1a5f7f8585b..6ed16f6bc02 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -51,6 +51,8 @@ extern "C" {
#include "glsl/glsl_types.h"
#include "glsl/ir.h"
+#define MAX_SAMPLER_MESSAGE_SIZE 11
+
class bblock_t;
namespace {
struct acp_entry;
diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index f54a2defd44..2494b117e57 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -103,7 +103,8 @@ brw_alloc_reg_set(struct brw_context *brw, int reg_width)
int class_sizes[BRW_MAX_MRF];
if (brw->gen >= 7) {
- for (class_count = 0; class_count < 11; class_count++)
+ for (class_count = 0; class_count < MAX_SAMPLER_MESSAGE_SIZE;
+ class_count++)
class_sizes[class_count] = class_count + 1;
} else {
for (class_count = 0; class_count < 4; class_count++)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 1727ef9593a..643ba5f00ad 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1231,8 +1231,9 @@ fs_visitor::emit_texture_gen5(ir_texture *ir, fs_reg dst, fs_reg coordinate,
inst->header_present = header_present;
inst->regs_written = 4;
- if (mlen > 11) {
- fail("Message length >11 disallowed by hardware\n");
+ if (mlen > MAX_SAMPLER_MESSAGE_SIZE) {
+ fail("Message length >" STRINGIFY(MAX_SAMPLER_MESSAGE_SIZE)
+ " disallowed by hardware\n");
}
return inst;
@@ -1424,8 +1425,9 @@ fs_visitor::emit_texture_gen7(ir_texture *ir, fs_reg dst, fs_reg coordinate,
inst->regs_written = 4;
virtual_grf_sizes[payload.reg] = next.reg_offset;
- if (inst->mlen > 11) {
- fail("Message length >11 disallowed by hardware\n");
+ if (inst->mlen > MAX_SAMPLER_MESSAGE_SIZE) {
+ fail("Message length >" STRINGIFY(MAX_SAMPLER_MESSAGE_SIZE)
+ " disallowed by hardware\n");
}
return inst;