be consistent in populating NegateBase field
This commit is contained in:
@@ -124,8 +124,7 @@ _mesa_debug_fp_inst(GLint num, struct fp_instruction *fp)
|
|||||||
_mesa_printf("_SAT");
|
_mesa_printf("_SAT");
|
||||||
|
|
||||||
if (fp[a].DstReg.File != 0xf) {
|
if (fp[a].DstReg.File != 0xf) {
|
||||||
if (fp[a].DstReg.WriteMask != 0xf ||
|
if (fp[a].DstReg.WriteMask != 0xf)
|
||||||
fp[a].SrcReg[0].NegateBase)
|
|
||||||
_mesa_printf(" %s[%d].%s%s%s%s ", file_string[fp[a].DstReg.File], fp[a].DstReg.Index,
|
_mesa_printf(" %s[%d].%s%s%s%s ", file_string[fp[a].DstReg.File], fp[a].DstReg.Index,
|
||||||
GET_BIT(fp[a].DstReg.WriteMask, 0) ? "x" : "",
|
GET_BIT(fp[a].DstReg.WriteMask, 0) ? "x" : "",
|
||||||
GET_BIT(fp[a].DstReg.WriteMask, 1) ? "y" : "",
|
GET_BIT(fp[a].DstReg.WriteMask, 1) ? "y" : "",
|
||||||
@@ -135,14 +134,19 @@ _mesa_debug_fp_inst(GLint num, struct fp_instruction *fp)
|
|||||||
_mesa_printf(" %s[%d] ", file_string[fp[a].DstReg.File], fp[a].DstReg.Index);
|
_mesa_printf(" %s[%d] ", file_string[fp[a].DstReg.File], fp[a].DstReg.Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Examine each bit of negatebase here as this may be a SWZ instruction
|
||||||
|
*/
|
||||||
if (fp[a].SrcReg[0].File != 0xf) {
|
if (fp[a].SrcReg[0].File != 0xf) {
|
||||||
if (fp[a].SrcReg[0].Swizzle != SWIZZLE_NOOP ||
|
if (fp[a].SrcReg[0].Swizzle != SWIZZLE_NOOP ||
|
||||||
fp[a].SrcReg[0].NegateBase)
|
fp[a].SrcReg[0].NegateBase)
|
||||||
_mesa_printf("%s[%d].%s%c%c%c%c ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index,
|
_mesa_printf("%s[%d].%s%c%s%c%s%c%s%c ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index,
|
||||||
fp[a].SrcReg[0].NegateBase ? "-" : "",
|
GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
|
||||||
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 0)],
|
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 0)],
|
||||||
|
GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
|
||||||
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 1)],
|
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 1)],
|
||||||
|
GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
|
||||||
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 2)],
|
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 2)],
|
||||||
|
GET_BIT(fp[a].SrcReg[0].NegateBase, 0) ? "-" : "",
|
||||||
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 3)]);
|
swz[GET_SWZ(fp[a].SrcReg[0].Swizzle, 3)]);
|
||||||
else
|
else
|
||||||
_mesa_printf("%s[%d] ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index);
|
_mesa_printf("%s[%d] ", file_string[fp[a].SrcReg[0].File], fp[a].SrcReg[0].Index);
|
||||||
|
@@ -2444,15 +2444,15 @@ parse_swizzle_mask (GLubyte ** inst, GLubyte * mask, GLint len)
|
|||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
static GLuint
|
static GLuint
|
||||||
parse_extended_swizzle_mask (GLubyte ** inst, GLubyte * mask, GLboolean * Negate)
|
parse_extended_swizzle_mask (GLubyte ** inst, GLubyte * mask, GLubyte * Negate)
|
||||||
{
|
{
|
||||||
GLint a;
|
GLint a;
|
||||||
GLubyte swz;
|
GLubyte swz;
|
||||||
|
|
||||||
*Negate = GL_FALSE;
|
*Negate = 0x0;
|
||||||
for (a = 0; a < 4; a++) {
|
for (a = 0; a < 4; a++) {
|
||||||
if (parse_sign (inst) == -1)
|
if (parse_sign (inst) == -1)
|
||||||
*Negate = GL_TRUE;
|
*Negate |= 1<<a;
|
||||||
|
|
||||||
swz = *(*inst)++;
|
swz = *(*inst)++;
|
||||||
|
|
||||||
@@ -3036,19 +3036,16 @@ parse_fp_instruction (GLcontext * ctx, GLubyte ** inst,
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
{
|
{
|
||||||
GLubyte Swizzle[4]; /* FP's swizzle mask is a GLubyte, while VP's is GLuint */
|
GLubyte Swizzle[4];
|
||||||
GLubyte Negate[4];
|
GLubyte NegateMask;
|
||||||
GLint File, Index;
|
GLint File, Index;
|
||||||
|
|
||||||
if (parse_src_reg(ctx, inst, vc_head, Program, &File, &Index, &rel))
|
if (parse_src_reg(ctx, inst, vc_head, Program, &File, &Index, &rel))
|
||||||
return 1;
|
return 1;
|
||||||
parse_extended_swizzle_mask (inst, Swizzle, Negate);
|
parse_extended_swizzle_mask (inst, Swizzle, &NegateMask);
|
||||||
fp->SrcReg[0].File = File;
|
fp->SrcReg[0].File = File;
|
||||||
fp->SrcReg[0].Index = Index;
|
fp->SrcReg[0].Index = Index;
|
||||||
fp->SrcReg[0].NegateBase = (Negate[0] << 0 |
|
fp->SrcReg[0].NegateBase = NegateMask;
|
||||||
Negate[1] << 1 |
|
|
||||||
Negate[2] << 2 |
|
|
||||||
Negate[3] << 3);
|
|
||||||
fp->SrcReg[0].Swizzle = (Swizzle[0] << 0 |
|
fp->SrcReg[0].Swizzle = (Swizzle[0] << 0 |
|
||||||
Swizzle[1] << 3 |
|
Swizzle[1] << 3 |
|
||||||
Swizzle[2] << 6 |
|
Swizzle[2] << 6 |
|
||||||
@@ -3423,8 +3420,8 @@ parse_vp_instruction (GLcontext * ctx, GLubyte ** inst,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
GLubyte Swizzle[4]; /* FP's swizzle mask is a GLubyte, while VP's is GLuint */
|
GLubyte Swizzle[4];
|
||||||
GLubyte Negate[4];
|
GLubyte NegateMask;
|
||||||
GLboolean RelAddr;
|
GLboolean RelAddr;
|
||||||
GLint File, Index;
|
GLint File, Index;
|
||||||
|
|
||||||
@@ -3433,13 +3430,10 @@ parse_vp_instruction (GLcontext * ctx, GLubyte ** inst,
|
|||||||
|
|
||||||
if (parse_src_reg(ctx, inst, vc_head, Program, &File, &Index, &RelAddr))
|
if (parse_src_reg(ctx, inst, vc_head, Program, &File, &Index, &RelAddr))
|
||||||
return 1;
|
return 1;
|
||||||
parse_extended_swizzle_mask (inst, Swizzle, Negate);
|
parse_extended_swizzle_mask (inst, Swizzle, &NegateMask);
|
||||||
vp->SrcReg[0].File = File;
|
vp->SrcReg[0].File = File;
|
||||||
vp->SrcReg[0].Index = Index;
|
vp->SrcReg[0].Index = Index;
|
||||||
vp->SrcReg[0].Negate = (Negate[0] << 0 |
|
vp->SrcReg[0].Negate = NegateMask;
|
||||||
Negate[1] << 1 |
|
|
||||||
Negate[2] << 2 |
|
|
||||||
Negate[3] << 3);
|
|
||||||
vp->SrcReg[0].Swizzle = (Swizzle[0] << 0 |
|
vp->SrcReg[0].Swizzle = (Swizzle[0] << 0 |
|
||||||
Swizzle[1] << 3 |
|
Swizzle[1] << 3 |
|
||||||
Swizzle[2] << 6 |
|
Swizzle[2] << 6 |
|
||||||
|
@@ -983,16 +983,16 @@ Parse_VectorSrc(struct parse_state *parseState,
|
|||||||
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
|
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
|
||||||
|
|
||||||
if (Parse_String(parseState, "-"))
|
if (Parse_String(parseState, "-"))
|
||||||
srcReg->NegateBase = GL_TRUE;
|
srcReg->NegateBase = 0xf;
|
||||||
else if (Parse_String(parseState, "+"))
|
else if (Parse_String(parseState, "+"))
|
||||||
srcReg->NegateBase = GL_FALSE;
|
srcReg->NegateBase = 0;
|
||||||
else
|
else
|
||||||
srcReg->NegateBase = GL_FALSE;
|
srcReg->NegateBase = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
srcReg->Abs = GL_FALSE;
|
srcReg->Abs = GL_FALSE;
|
||||||
srcReg->NegateAbs = GL_FALSE;
|
srcReg->NegateAbs = GL_FALSE;
|
||||||
srcReg->NegateBase = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
|
srcReg->NegateBase = (sign < 0.0F) ? 0xf : 0x0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This should be the real src vector/register name */
|
/* This should be the real src vector/register name */
|
||||||
@@ -1107,16 +1107,16 @@ Parse_ScalarSrcReg(struct parse_state *parseState,
|
|||||||
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
|
srcReg->NegateAbs = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
|
||||||
|
|
||||||
if (Parse_String(parseState, "-"))
|
if (Parse_String(parseState, "-"))
|
||||||
srcReg->NegateBase = GL_TRUE;
|
srcReg->NegateBase = 0xf;
|
||||||
else if (Parse_String(parseState, "+"))
|
else if (Parse_String(parseState, "+"))
|
||||||
srcReg->NegateBase = GL_FALSE;
|
srcReg->NegateBase = 0x0;
|
||||||
else
|
else
|
||||||
srcReg->NegateBase = GL_FALSE;
|
srcReg->NegateBase = 0x0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
srcReg->Abs = GL_FALSE;
|
srcReg->Abs = GL_FALSE;
|
||||||
srcReg->NegateAbs = GL_FALSE;
|
srcReg->NegateAbs = GL_FALSE;
|
||||||
srcReg->NegateBase = (sign < 0.0F) ? GL_TRUE : GL_FALSE;
|
srcReg->NegateBase = (sign < 0.0F) ? 0xf : 0x0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Peek_Token(parseState, token))
|
if (!Peek_Token(parseState, token))
|
||||||
@@ -1241,7 +1241,7 @@ Parse_PrintInstruction(struct parse_state *parseState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
|
inst->SrcReg[0].Swizzle = SWIZZLE_NOOP;
|
||||||
inst->SrcReg[0].NegateBase = GL_FALSE;
|
inst->SrcReg[0].NegateBase = 0x0;
|
||||||
inst->SrcReg[0].Abs = GL_FALSE;
|
inst->SrcReg[0].Abs = GL_FALSE;
|
||||||
inst->SrcReg[0].NegateAbs = GL_FALSE;
|
inst->SrcReg[0].NegateAbs = GL_FALSE;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user