Mesa (master): i965: Enable the new FS backend on pre-gen6 as well.

Eric Anholt anholt at kemper.freedesktop.org
Thu Oct 14 19:41:38 UTC 2010


Module: Mesa
Branch: master
Commit: a81d423d93f22a948f3aa4bf73dc6b1a3b70192f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a81d423d93f22a948f3aa4bf73dc6b1a3b70192f

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 14 12:23:29 2010 -0700

i965: Enable the new FS backend on pre-gen6 as well.

It is now to the point where we have no regressing piglit tests.  It
also fixes Yo Frankie! and Humus DynamicBranching, probably due to the
piglit bias tests that work that didn't on the Mesa IR backend.

As a downside, performance takes about a 5-10% performance hit at the
moment (e.g. nexuiz 19.8fps -> 18.8fps), which I plan to resolve by
reintroducing 16-wide fragment shaders where possible.  It is a win,
though, for fragment shaders using flow control.

---

 src/mesa/drivers/dri/i965/brw_fs.cpp |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index d46091c..d220c79 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -48,7 +48,6 @@ extern "C" {
 #include "../glsl/ir_optimization.h"
 #include "../glsl/ir_print_visitor.h"
 
-static int using_new_fs = -1;
 static struct brw_reg brw_reg_from_fs_reg(class fs_reg *reg);
 
 struct gl_shader *
@@ -92,17 +91,10 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
 {
    struct intel_context *intel = intel_context(ctx);
 
-   if (using_new_fs == -1) {
-      if (intel->gen >= 6)
-	 using_new_fs = 1;
-      else
-	 using_new_fs = getenv("INTEL_NEW_FS") != NULL;
-   }
-
    for (unsigned i = 0; i < prog->_NumLinkedShaders; i++) {
       struct brw_shader *shader = (struct brw_shader *)prog->_LinkedShaders[i];
 
-      if (using_new_fs && shader->base.Type == GL_FRAGMENT_SHADER) {
+      if (shader->base.Type == GL_FRAGMENT_SHADER) {
 	 void *mem_ctx = talloc_new(NULL);
 	 bool progress;
 
@@ -3190,9 +3182,6 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c)
    if (!prog)
       return GL_FALSE;
 
-   if (!using_new_fs)
-      return GL_FALSE;
-
    for (unsigned int i = 0; i < prog->_NumLinkedShaders; i++) {
       if (prog->_LinkedShaders[i]->Type == GL_FRAGMENT_SHADER) {
 	 shader = (struct brw_shader *)prog->_LinkedShaders[i];




More information about the mesa-commit mailing list