static void
exec_tex(struct tgsi_exec_machine *mach,
const struct tgsi_full_instruction *inst,
- boolean biasLod)
+ boolean biasLod,
+ boolean projected)
{
const uint unit = inst->FullSrcRegisters[1].SrcRegister.Index;
union tgsi_exec_channel r[8];
FETCH(&r[0], 0, CHAN_X);
- switch (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide) {
- case TGSI_EXTSWIZZLE_W:
+ if (projected) {
FETCH(&r[1], 0, CHAN_W);
micro_div( &r[0], &r[0], &r[1] );
- break;
-
- case TGSI_EXTSWIZZLE_ONE:
- break;
-
- default:
- assert (0);
}
if (biasLod) {
FETCH(&r[1], 0, CHAN_Y);
FETCH(&r[2], 0, CHAN_Z);
- switch (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide) {
- case TGSI_EXTSWIZZLE_W:
+ if (projected) {
FETCH(&r[3], 0, CHAN_W);
micro_div( &r[0], &r[0], &r[3] );
micro_div( &r[1], &r[1], &r[3] );
micro_div( &r[2], &r[2], &r[3] );
- break;
-
- case TGSI_EXTSWIZZLE_ONE:
- break;
-
- default:
- assert (0);
}
if (biasLod) {
FETCH(&r[1], 0, CHAN_Y);
FETCH(&r[2], 0, CHAN_Z);
- switch (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide) {
- case TGSI_EXTSWIZZLE_W:
+ if (projected) {
FETCH(&r[3], 0, CHAN_W);
micro_div( &r[0], &r[0], &r[3] );
micro_div( &r[1], &r[1], &r[3] );
micro_div( &r[2], &r[2], &r[3] );
- break;
-
- case TGSI_EXTSWIZZLE_ONE:
- break;
-
- default:
- assert (0);
}
if (biasLod) {
/* simple texture lookup */
/* src[0] = texcoord */
/* src[1] = sampler unit */
- exec_tex(mach, inst, FALSE);
+ exec_tex(mach, inst, FALSE, FALSE);
break;
case TGSI_OPCODE_TXB:
/* Texture lookup with lod bias */
/* src[0] = texcoord (src[0].w = LOD bias) */
/* src[1] = sampler unit */
- exec_tex(mach, inst, TRUE);
+ exec_tex(mach, inst, TRUE, FALSE);
break;
case TGSI_OPCODE_TXD:
/* Texture lookup with explit LOD */
/* src[0] = texcoord (src[0].w = LOD) */
/* src[1] = sampler unit */
- exec_tex(mach, inst, TRUE);
+ exec_tex(mach, inst, TRUE, FALSE);
+ break;
+
+ case TGSI_OPCODE_TXP:
+ /* Texture lookup with projection */
+ /* src[0] = texcoord (src[0].w = projection) */
+ /* src[1] = sampler unit */
+ exec_tex(mach, inst, FALSE, TRUE);
break;
case TGSI_OPCODE_UP2H:
reg->SrcRegisterExtSwz.NegateY,
reg->SrcRegisterExtSwz.NegateZ,
reg->SrcRegisterExtSwz.NegateW,
- reg->SrcRegisterExtSwz.ExtDivide,
prev_token,
instruction,
header );
src_register_ext_swz.NegateY = 0;
src_register_ext_swz.NegateZ = 0;
src_register_ext_swz.NegateW = 0;
- src_register_ext_swz.ExtDivide = TGSI_EXTSWIZZLE_ONE;
src_register_ext_swz.Padding = 0;
src_register_ext_swz.Extended = 0;
unsigned negate_y,
unsigned negate_z,
unsigned negate_w,
- unsigned ext_divide,
struct tgsi_token *prev_token,
struct tgsi_instruction *instruction,
struct tgsi_header *header )
assert( negate_y <= 1 );
assert( negate_z <= 1 );
assert( negate_w <= 1 );
- assert( ext_divide <= TGSI_EXTSWIZZLE_ONE );
src_register_ext_swz = tgsi_default_src_register_ext_swz();
src_register_ext_swz.ExtSwizzleX = ext_swizzle_x;
src_register_ext_swz.NegateY = negate_y;
src_register_ext_swz.NegateZ = negate_z;
src_register_ext_swz.NegateW = negate_w;
- src_register_ext_swz.ExtDivide = ext_divide;
prev_token->Extended = 1;
instruction_grow( instruction, header );
unsigned negate_y,
unsigned negate_z,
unsigned negate_w,
- unsigned ext_divide,
struct tgsi_token *prev_token,
struct tgsi_instruction *instruction,
struct tgsi_header *header );
CHR( ')' );
}
- if (src->SrcRegisterExtSwz.ExtDivide != TGSI_EXTSWIZZLE_ONE) {
- CHR( '/' );
- ENM( src->SrcRegisterExtSwz.ExtDivide, TGSI_EXTSWIZZLES_SHORT );
- }
-
first_reg = FALSE;
}
TXT( "\nNegateW : " );
UID( src->SrcRegisterExtSwz.NegateW );
}
- if( deflt || fs->SrcRegisterExtSwz.ExtDivide != src->SrcRegisterExtSwz.ExtDivide ) {
- TXT( "\nExtDivide : " );
- ENM( src->SrcRegisterExtSwz.ExtDivide, TGSI_EXTSWIZZLES );
- }
if( ignored ) {
TXT( "\nPadding : " );
UIX( src->SrcRegisterExtSwz.Padding );
break;
case TGSI_OPCODE_TEX:
- if (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide
- == TGSI_EXTSWIZZLE_W) {
- emit_tex(p, inst, T0_TEXLDP);
- }
- else {
- emit_tex(p, inst, T0_TEXLD);
- }
+ emit_tex(p, inst, T0_TEXLD);
break;
case TGSI_OPCODE_TXB:
emit_tex(p, inst, T0_TEXLDB);
break;
+ case TGSI_OPCODE_TXP:
+ emit_tex(p, inst, T0_TEXLDP);
+ break;
+
case TGSI_OPCODE_XPD:
/* Cross product:
* result.x = src0.y * src1.z - src0.z * src1.y;
*
* NegateX, NegateY, NegateZ and NegateW negate individual components of the
* source register.
- *
- * ExtDivide specifies which component is used to divide all components of the
- * source register.
*/
struct tgsi_src_register_ext_swz
unsigned NegateY : 1; /* BOOL */
unsigned NegateZ : 1; /* BOOL */
unsigned NegateW : 1; /* BOOL */
-
- /*
- * XXX: Do not use. This field has been depricated.
- * XXX: If using in conjunction with OPCODE_TEX, please use OPCODE_TXP
- * XXX: and, if needed, perform a swizzle on the texture coordinate.
- */
- unsigned ExtDivide : 4; /* TGSI_EXTSWIZZLE_ */
-
- unsigned Padding : 3;
+ unsigned Padding : 7;
unsigned Extended : 1; /* BOOL */
};