i965: explicit tell header present for fb write on sandybridge
authorZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 22 Dec 2010 15:52:12 +0000 (10:52 -0500)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 22 Dec 2010 16:08:51 +0000 (11:08 -0500)
Determine header present for fb write by msg length is not right
for SIMD16 dispatch, and if there're more output attributes, header
present is not easy to tell from msg length. This explicitly adds
new param for fb write to say header present or not.

Fixes many cases' hang and failure in GL conformance test.

src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_wm_emit.c

index 4dbdc52210011581acbfbd067861cf54df956045..119ffc72370456e4c6eee2cf8a0126659a4ad02e 100644 (file)
@@ -861,7 +861,8 @@ void brw_fb_WRITE(struct brw_compile *p,
                   GLuint binding_table_index,
                   GLuint msg_length,
                   GLuint response_length,
-                  GLboolean eot);
+                  GLboolean eot,
+                  GLboolean header_present);
 
 void brw_SAMPLE(struct brw_compile *p,
                struct brw_reg dest,
index 2bdcacfb2ede5d32b143d2ff209c107ec57af827..6d48ca0e46d7b6a8fb7103098212a68c928d5f8b 100644 (file)
@@ -1812,12 +1812,12 @@ void brw_fb_WRITE(struct brw_compile *p,
                   GLuint binding_table_index,
                   GLuint msg_length,
                   GLuint response_length,
-                  GLboolean eot)
+                  GLboolean eot,
+                  GLboolean header_present)
 {
    struct intel_context *intel = &p->brw->intel;
    struct brw_instruction *insn;
    GLuint msg_control, msg_type;
-   GLboolean header_present = GL_TRUE;
 
    if (intel->gen >= 6 && binding_table_index == 0) {
       insn = next_insn(p, BRW_OPCODE_SENDC);
@@ -1829,9 +1829,6 @@ void brw_fb_WRITE(struct brw_compile *p,
    insn->header.compression_control = BRW_COMPRESSION_NONE;
 
    if (intel->gen >= 6) {
-      if (msg_length == 4)
-        header_present = GL_FALSE;
-
        /* headerless version, just submit color payload */
        src0 = brw_message_reg(msg_reg_nr);
 
index 4eead32cbbdc6a31b6509ff20511f7aab3608cf5..2de81b283715b7ec4ee8e41f81b63bbe903f9be0 100644 (file)
@@ -2163,7 +2163,8 @@ fs_visitor::generate_fb_write(fs_inst *inst)
                inst->target,
                inst->mlen,
                0,
-               eot);
+               eot,
+               inst->header_present);
 }
 
 void
index 39cf96467af4b124370d336294cc5a0b5399961d..56725c0d471ad23b70907d27f47019f2bc3a35fb 100644 (file)
@@ -1356,7 +1356,8 @@ static void fire_fb_write( struct brw_wm_compile *c,
                target,         
                nr,
                0, 
-               eot);
+               eot,
+               GL_TRUE);
 }