Mesa (master): i965/fp: Fix segfault on gen4 TXB instructions.

Eric Anholt anholt at kemper.freedesktop.org
Fri Nov 30 06:34:39 UTC 2012


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

Author: Eric Anholt <eric at anholt.net>
Date:   Mon Nov 26 13:39:11 2012 -0800

i965/fp: Fix segfault on gen4 TXB instructions.

The gen4 simd16 workaround looks at ir->type to determine how much
storage to allocate for the simd16 value.  In fragment programs,
texturing only ever returns float vec4s (unlike GLSL, which can also
have scalar floats or vector integers), so this is the right type.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56962
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_fs_fp.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index bb8cd9a..4be7779 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
@@ -441,6 +441,8 @@ fs_visitor::emit_fragment_program_code()
             break;
          }
 
+         ir->type = glsl_type::vec4_type;
+
          const glsl_type *coordinate_type;
          switch (fpi->TexSrcTarget) {
          case TEXTURE_1D_INDEX:




More information about the mesa-commit mailing list