Mesa (master): i965/vs: Fix NULL pointer dereference in pre-Gen6 push constant loading.
Eric Anholt
anholt at kemper.freedesktop.org
Fri Sep 2 19:18:31 UTC 2011
Module: Mesa
Branch: master
Commit: ee41383ab31f6ef5f1d18961de78371d4f52065b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee41383ab31f6ef5f1d18961de78371d4f52065b
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Aug 30 12:34:13 2011 -0700
i965/vs: Fix NULL pointer dereference in pre-Gen6 push constant loading.
According to the comment, we need to load /some/ push constants on
pre-Gen6 hardware or the GPU will hang. The existing code set these
bogus parameters to NULL pointers; unfortunately, the code in
brw_curbe.c that loads them dereferences those pointers. So, change
them to be pointers to an actual floating point value of 0.0.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index 067f1c9..2d1c878 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -117,8 +117,8 @@ vec4_visitor::setup_uniforms(int reg)
for (unsigned int i = 0; i < 4; i++) {
unsigned int slot = this->uniforms * 4 + i;
-
- c->prog_data.param[slot] = NULL;
+ static float zero = 0.0;
+ c->prog_data.param[slot] = &zero;
}
this->uniforms++;
More information about the mesa-commit
mailing list