summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/tgsi
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-13 13:39:05 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-13 13:39:05 +1100
commit03ec66375889f049b09f39ba98515aa35ac48164 (patch)
treee149d8defb52b1252af982b459902ee0800b17cd /src/gallium/auxiliary/tgsi
parentbd4fe0e87c1b979973d9a76aa48de5fbbb8d52b7 (diff)
parent2366bb1baf2e9ae5b6ecf19f66ae9e0a4b0d2f36 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/auxiliary/tgsi')
-rw-r--r--src/gallium/auxiliary/tgsi/exec/tgsi_exec.c46
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_build.c5
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_build.h1
-rw-r--r--src/gallium/auxiliary/tgsi/util/tgsi_dump.c10
4 files changed, 19 insertions, 43 deletions
diff --git a/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c b/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
index ac52441400..f2ed9e0353 100644
--- a/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
+++ b/src/gallium/auxiliary/tgsi/exec/tgsi_exec.c
@@ -1220,7 +1220,8 @@ fetch_texel( struct tgsi_sampler *sampler,
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];
@@ -1234,17 +1235,9 @@ exec_tex(struct tgsi_exec_machine *mach,
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) {
@@ -1266,19 +1259,11 @@ exec_tex(struct tgsi_exec_machine *mach,
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) {
@@ -1300,19 +1285,11 @@ exec_tex(struct tgsi_exec_machine *mach,
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) {
@@ -2007,14 +1984,14 @@ exec_instruction(
/* 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:
@@ -2030,7 +2007,14 @@ exec_instruction(
/* 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:
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_build.c b/src/gallium/auxiliary/tgsi/util/tgsi_build.c
index a00ff1c2a5..9c883ab704 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_build.c
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_build.c
@@ -719,7 +719,6 @@ tgsi_build_full_instruction(
reg->SrcRegisterExtSwz.NegateY,
reg->SrcRegisterExtSwz.NegateZ,
reg->SrcRegisterExtSwz.NegateW,
- reg->SrcRegisterExtSwz.ExtDivide,
prev_token,
instruction,
header );
@@ -1057,7 +1056,6 @@ tgsi_default_src_register_ext_swz( void )
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;
@@ -1084,7 +1082,6 @@ tgsi_build_src_register_ext_swz(
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 )
@@ -1099,7 +1096,6 @@ tgsi_build_src_register_ext_swz(
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;
@@ -1110,7 +1106,6 @@ tgsi_build_src_register_ext_swz(
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 );
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_build.h b/src/gallium/auxiliary/tgsi/util/tgsi_build.h
index 607860e7fc..80bffc4ae7 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_build.h
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_build.h
@@ -229,7 +229,6 @@ tgsi_build_src_register_ext_swz(
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 );
diff --git a/src/gallium/auxiliary/tgsi/util/tgsi_dump.c b/src/gallium/auxiliary/tgsi/util/tgsi_dump.c
index 59be14a748..ceb407b884 100644
--- a/src/gallium/auxiliary/tgsi/util/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/util/tgsi_dump.c
@@ -459,7 +459,8 @@ static const char *TGSI_OPCODES[] =
"OPCODE_IFC",
"OPCODE_BREAKC",
"OPCODE_KIL",
- "OPCODE_END"
+ "OPCODE_END",
+ "OPCODE_TXP"
};
static const char *TGSI_OPCODES_SHORT[] =
@@ -597,7 +598,8 @@ static const char *TGSI_OPCODES_SHORT[] =
"IFC",
"BREAKC",
"KIL",
- "END"
+ "END",
+ "TXP"
};
static const char *TGSI_SATS[] =
@@ -1361,10 +1363,6 @@ dump_instruction_verbose(
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 );