GLuint swiz = 0x0;
GLuint temp = src.Swizzle;
for (int i = 0; i < 4; i++) {
- swiz = (temp & 0x3) << i*2;
+ swiz += (temp & 0x3) << i*2;
temp >>= 3;
}
return swiz;
GLuint reg;
switch (src.File) {
case PROGRAM_TEMPORARY:
- reg = src.Index + 1;
+ reg = (src.Index << 0x1) | 0x1;
break;
case PROGRAM_INPUT:
/* Ugly hack needed to work around Mesa;
GLuint reg;
switch (dest.File) {
case PROGRAM_TEMPORARY:
- reg = dest.Index + 1;
+ reg = (dest.Index << 0x1) | 0x1;
break;
case PROGRAM_OUTPUT:
/* Eventually we may need to handle multiple
| R500_ALU_RGBA_ALPHA_MOD_C_NEG;
break;
case OPCODE_TEX:
+ src[0] = make_src(fp, fpi->SrcReg[0]);
+ fp->inst[counter].inst0 = R500_INST_TYPE_TEX | mask
+ | R500_INST_TEX_SEM_WAIT;
+ fp->inst[counter].inst1 = fpi->TexSrcUnit
+ | R500_TEX_INST_LD | R500_TEX_SEM_ACQUIRE | R500_TEX_IGNORE_UNCOVERED;
+ fp->inst[counter].inst2 = R500_TEX_SRC_ADDR(src[0])
+ /* | MAKE_SWIZ_TEX_STRQ(make_strq_swizzle(fpi->SrcReg[0])) */
+ | R500_TEX_SRC_S_SWIZ_R | R500_TEX_SRC_T_SWIZ_G
+ | R500_TEX_SRC_R_SWIZ_B | R500_TEX_SRC_Q_SWIZ_A
+ | R500_TEX_DST_ADDR(dest)
+ | R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G
+ | R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A;
+ fp->inst[counter].inst3 = 0x0;
+ fp->inst[counter].inst4 = 0x0;
+ fp->inst[counter].inst5 = 0x0;
+ break;
+ case OPCODE_TXP:
src[0] = make_src(fp, fpi->SrcReg[0]);
fp->inst[counter].inst0 = R500_INST_TYPE_TEX | mask;
fp->inst[counter].inst1 = fpi->TexSrcUnit
- | R500_TEX_INST_LD | R500_TEX_SEM_ACQUIRE;
+ | R500_TEX_INST_PROJ | R500_TEX_SEM_ACQUIRE | R500_TEX_IGNORE_UNCOVERED;
fp->inst[counter].inst2 = R500_TEX_SRC_ADDR(src[0])
- | MAKE_SWIZ_TEX_STRQ(make_strq_swizzle(fpi->SrcReg[0]))
+ /* | MAKE_SWIZ_TEX_STRQ(make_strq_swizzle(fpi->SrcReg[0])) */
+ | R500_TEX_SRC_S_SWIZ_R | R500_TEX_SRC_T_SWIZ_G
+ | R500_TEX_SRC_R_SWIZ_B | R500_TEX_SRC_Q_SWIZ_A
| R500_TEX_DST_ADDR(dest)
| R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G
| R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A;