projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mesa: ensure UsesFogFragCoord value is set for non-glsl shaders
[mesa.git]
/
src
/
mesa
/
shader
/
nvfragparse.c
diff --git
a/src/mesa/shader/nvfragparse.c
b/src/mesa/shader/nvfragparse.c
index 56b7c29bea3f0d4a46669a92786e55c76f4733f8..0fd55524abf19e03807a5342f12491ed4ddd55ae 100644
(file)
--- a/
src/mesa/shader/nvfragparse.c
+++ b/
src/mesa/shader/nvfragparse.c
@@
-957,6
+957,7
@@
Parse_VectorSrc(struct parse_state *parseState,
GLfloat sign = 1.0F;
GLubyte token[100];
GLint idx;
GLfloat sign = 1.0F;
GLubyte token[100];
GLint idx;
+ GLuint negateBase, negateAbs;
/*
* First, take care of +/- and absolute value stuff.
/*
* First, take care of +/- and absolute value stuff.
@@
-968,21
+969,23
@@
Parse_VectorSrc(struct parse_state *parseState,
if (Parse_String(parseState, "|")) {
srcReg->Abs = GL_TRUE;
if (Parse_String(parseState, "|")) {
srcReg->Abs = GL_TRUE;
-
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALS
E;
+
negateAbs = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NON
E;
if (Parse_String(parseState, "-"))
if (Parse_String(parseState, "-"))
-
srcReg->N
egateBase = NEGATE_XYZW;
+
n
egateBase = NEGATE_XYZW;
else if (Parse_String(parseState, "+"))
else if (Parse_String(parseState, "+"))
-
srcReg->N
egateBase = NEGATE_NONE;
+
n
egateBase = NEGATE_NONE;
else
else
-
srcReg->N
egateBase = NEGATE_NONE;
+
n
egateBase = NEGATE_NONE;
}
else {
srcReg->Abs = GL_FALSE;
}
else {
srcReg->Abs = GL_FALSE;
-
srcReg->NegateAbs = GL_FALS
E;
-
srcReg->N
egateBase = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NONE;
+
negateAbs = NEGATE_NON
E;
+
n
egateBase = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NONE;
}
}
+ srcReg->Negate = srcReg->Abs ? negateAbs : negateBase;
+
/* This should be the real src vector/register name */
if (!Peek_Token(parseState, token))
RETURN_ERROR;
/* This should be the real src vector/register name */
if (!Peek_Token(parseState, token))
RETURN_ERROR;
@@
-1083,6
+1086,7
@@
Parse_ScalarSrcReg(struct parse_state *parseState,
GLfloat sign = 1.0F;
GLboolean needSuffix = GL_TRUE;
GLint idx;
GLfloat sign = 1.0F;
GLboolean needSuffix = GL_TRUE;
GLint idx;
+ GLuint negateBase, negateAbs;
/*
* First, take care of +/- and absolute value stuff.
/*
* First, take care of +/- and absolute value stuff.
@@
-1094,21
+1098,23
@@
Parse_ScalarSrcReg(struct parse_state *parseState,
if (Parse_String(parseState, "|")) {
srcReg->Abs = GL_TRUE;
if (Parse_String(parseState, "|")) {
srcReg->Abs = GL_TRUE;
-
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALS
E;
+
negateAbs = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NON
E;
if (Parse_String(parseState, "-"))
if (Parse_String(parseState, "-"))
-
srcReg->N
egateBase = NEGATE_XYZW;
+
n
egateBase = NEGATE_XYZW;
else if (Parse_String(parseState, "+"))
else if (Parse_String(parseState, "+"))
-
srcReg->N
egateBase = NEGATE_NONE;
+
n
egateBase = NEGATE_NONE;
else
else
-
srcReg->N
egateBase = NEGATE_NONE;
+
n
egateBase = NEGATE_NONE;
}
else {
srcReg->Abs = GL_FALSE;
}
else {
srcReg->Abs = GL_FALSE;
-
srcReg->NegateAbs = GL_FALS
E;
-
srcReg->N
egateBase = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NONE;
+
negateAbs = NEGATE_NON
E;
+
n
egateBase = (sign < 0.0F) ? NEGATE_XYZW : NEGATE_NONE;
}
}
+ srcReg->Negate = srcReg->Abs ? negateAbs : negateBase;
+
if (!Peek_Token(parseState, token))
RETURN_ERROR;
if (!Peek_Token(parseState, token))
RETURN_ERROR;
@@
-1247,9
+1253,8
@@
Parse_PrintInstruction(struct parse_state *parseState,
}
inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
}
inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
- inst->SrcReg[0].NegateBase = NEGATE_NONE;
inst->SrcReg[0].Abs = GL_FALSE;
inst->SrcReg[0].Abs = GL_FALSE;
- inst->SrcReg[0].Negate
Abs = GL_FALS
E;
+ inst->SrcReg[0].Negate
= NEGATE_NON
E;
return GL_TRUE;
}
return GL_TRUE;
}