i965/fs: Add and use MAX_SAMPLER_MESSAGE_SIZE definition.
authorMatt Turner <mattst88@gmail.com>
Wed, 11 Dec 2013 00:22:56 +0000 (16:22 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 21 Jan 2014 22:09:33 +0000 (14:09 -0800)
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp

index 1a5f7f8585bb825a3240f2f3a497b6868b20295f..6ed16f6bc02502a5a083f2cce30fd10a0c8acec7 100644 (file)
@@ -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;
index f54a2defd4414c9c8fedef6cb7b4aff16080a238..2494b117e57506e2c9d4336148600e17a914e97a 100644 (file)
@@ -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++)
index 1727ef9593a9aee52afffb7ad84445655d4cb2e7..643ba5f00adfece29e1e720b0b4ac1754622df5d 100644 (file)
@@ -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;