Comments about texture instructions and the src regs
This commit is contained in:
@@ -1996,15 +1996,15 @@ exec_instruction(
|
||||
|
||||
case TGSI_OPCODE_TEX:
|
||||
/* simple texture lookup */
|
||||
/* src[0] is the texcoord */
|
||||
/* src[1] is the sampler unit */
|
||||
/* src[0] = texcoord */
|
||||
/* src[1] = sampler unit */
|
||||
exec_tex(mach, inst, FALSE);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_TXB:
|
||||
/* Texture lookup with lod bias */
|
||||
/* src[0] is the texcoord (src[0].w = load bias) */
|
||||
/* src[1] is the sampler unit */
|
||||
/* src[0] = texcoord (src[0].w = load bias) */
|
||||
/* src[1] = sampler unit */
|
||||
exec_tex(mach, inst, TRUE);
|
||||
break;
|
||||
|
||||
@@ -2013,9 +2013,17 @@ exec_instruction(
|
||||
/* src[0] = texcoord */
|
||||
/* src[1] = d[strq]/dx */
|
||||
/* src[2] = d[strq]/dy */
|
||||
/* src[3] = sampler unit */
|
||||
assert (0);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_TXL:
|
||||
/* Texture lookup with explit LOD */
|
||||
/* src[0] = texcoord (src[0].w = load bias) */
|
||||
/* src[1] = sampler unit */
|
||||
exec_tex(mach, inst, TRUE);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_UP2H:
|
||||
assert (0);
|
||||
break;
|
||||
@@ -2157,10 +2165,6 @@ exec_instruction(
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_TXL:
|
||||
assert (0);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_IF:
|
||||
/* push CondMask */
|
||||
assert(mach->CondStackTop < TGSI_EXEC_MAX_COND_NESTING);
|
||||
|
||||
@@ -459,6 +459,7 @@ compile_instruction(
|
||||
fullinst->Instruction.Opcode = TGSI_OPCODE_SWZ;
|
||||
break;
|
||||
case OPCODE_TEX:
|
||||
/* ordinary texture lookup */
|
||||
fullinst->Instruction.Opcode = TGSI_OPCODE_TEX;
|
||||
fullinst->Instruction.NumSrcRegs = 2;
|
||||
fullinst->InstructionExtTexture.Texture = map_texture_target( inst->TexSrcTarget );
|
||||
@@ -466,6 +467,7 @@ compile_instruction(
|
||||
fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit;
|
||||
break;
|
||||
case OPCODE_TXB:
|
||||
/* texture lookup with LOD bias */
|
||||
fullinst->Instruction.Opcode = TGSI_OPCODE_TXB;
|
||||
fullinst->Instruction.NumSrcRegs = 2;
|
||||
fullinst->InstructionExtTexture.Texture = map_texture_target( inst->TexSrcTarget );
|
||||
@@ -473,13 +475,16 @@ compile_instruction(
|
||||
fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit;
|
||||
break;
|
||||
case OPCODE_TXD:
|
||||
/* texture lookup with explicit partial derivatives */
|
||||
fullinst->Instruction.Opcode = TGSI_OPCODE_TXD;
|
||||
fullinst->Instruction.NumSrcRegs = 2;
|
||||
fullinst->Instruction.NumSrcRegs = 4;
|
||||
fullinst->InstructionExtTexture.Texture = map_texture_target( inst->TexSrcTarget );
|
||||
fullinst->FullSrcRegisters[1].SrcRegister.File = TGSI_FILE_SAMPLER;
|
||||
fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit;
|
||||
/* src[0] = coord, src[1] = d[strq]/dx, src[2] = d[strq]/dy */
|
||||
fullinst->FullSrcRegisters[3].SrcRegister.File = TGSI_FILE_SAMPLER;
|
||||
fullinst->FullSrcRegisters[3].SrcRegister.Index = inst->TexSrcUnit;
|
||||
break;
|
||||
case OPCODE_TXL:
|
||||
/* texture lookup with explicit LOD */
|
||||
fullinst->Instruction.Opcode = TGSI_OPCODE_TXL;
|
||||
fullinst->Instruction.NumSrcRegs = 2;
|
||||
fullinst->InstructionExtTexture.Texture = map_texture_target( inst->TexSrcTarget );
|
||||
@@ -487,6 +492,8 @@ compile_instruction(
|
||||
fullinst->FullSrcRegisters[1].SrcRegister.Index = inst->TexSrcUnit;
|
||||
break;
|
||||
case OPCODE_TXP:
|
||||
/* texture lookup with divide by Q component */
|
||||
/* convert to TEX w/ special flag for division */
|
||||
fullinst->Instruction.Opcode = TGSI_OPCODE_TEX;
|
||||
fullinst->Instruction.NumSrcRegs = 2;
|
||||
fullinst->InstructionExtTexture.Texture = map_texture_target( inst->TexSrcTarget );
|
||||
|
||||
Reference in New Issue
Block a user