Replicate TXP changes in the SPU version of TGSI exec
Replicate changes from commit ba75e82b6e
in spu_exec.c
This commit is contained in:
parent
fa9e7e9a8d
commit
6472138045
|
@ -672,7 +672,7 @@ fetch_texel( struct spu_sampler *sampler,
|
||||||
static void
|
static void
|
||||||
exec_tex(struct spu_exec_machine *mach,
|
exec_tex(struct spu_exec_machine *mach,
|
||||||
const struct tgsi_full_instruction *inst,
|
const struct tgsi_full_instruction *inst,
|
||||||
boolean biasLod)
|
boolean biasLod, boolean projected)
|
||||||
{
|
{
|
||||||
const uint unit = inst->FullSrcRegisters[1].SrcRegister.Index;
|
const uint unit = inst->FullSrcRegisters[1].SrcRegister.Index;
|
||||||
union spu_exec_channel r[8];
|
union spu_exec_channel r[8];
|
||||||
|
@ -686,17 +686,9 @@ exec_tex(struct spu_exec_machine *mach,
|
||||||
|
|
||||||
FETCH(&r[0], 0, CHAN_X);
|
FETCH(&r[0], 0, CHAN_X);
|
||||||
|
|
||||||
switch (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide) {
|
if (projected) {
|
||||||
case TGSI_EXTSWIZZLE_W:
|
|
||||||
FETCH(&r[1], 0, CHAN_W);
|
FETCH(&r[1], 0, CHAN_W);
|
||||||
r[0].q = micro_div(r[0].q, r[1].q);
|
r[0].q = micro_div(r[0].q, r[1].q);
|
||||||
break;
|
|
||||||
|
|
||||||
case TGSI_EXTSWIZZLE_ONE:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
assert (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biasLod) {
|
if (biasLod) {
|
||||||
|
@ -718,19 +710,11 @@ exec_tex(struct spu_exec_machine *mach,
|
||||||
FETCH(&r[1], 0, CHAN_Y);
|
FETCH(&r[1], 0, CHAN_Y);
|
||||||
FETCH(&r[2], 0, CHAN_Z);
|
FETCH(&r[2], 0, CHAN_Z);
|
||||||
|
|
||||||
switch (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide) {
|
if (projected) {
|
||||||
case TGSI_EXTSWIZZLE_W:
|
|
||||||
FETCH(&r[3], 0, CHAN_W);
|
FETCH(&r[3], 0, CHAN_W);
|
||||||
r[0].q = micro_div(r[0].q, r[3].q);
|
r[0].q = micro_div(r[0].q, r[3].q);
|
||||||
r[1].q = micro_div(r[1].q, r[3].q);
|
r[1].q = micro_div(r[1].q, r[3].q);
|
||||||
r[2].q = micro_div(r[2].q, r[3].q);
|
r[2].q = micro_div(r[2].q, r[3].q);
|
||||||
break;
|
|
||||||
|
|
||||||
case TGSI_EXTSWIZZLE_ONE:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
assert (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biasLod) {
|
if (biasLod) {
|
||||||
|
@ -752,19 +736,11 @@ exec_tex(struct spu_exec_machine *mach,
|
||||||
FETCH(&r[1], 0, CHAN_Y);
|
FETCH(&r[1], 0, CHAN_Y);
|
||||||
FETCH(&r[2], 0, CHAN_Z);
|
FETCH(&r[2], 0, CHAN_Z);
|
||||||
|
|
||||||
switch (inst->FullSrcRegisters[0].SrcRegisterExtSwz.ExtDivide) {
|
if (projected) {
|
||||||
case TGSI_EXTSWIZZLE_W:
|
|
||||||
FETCH(&r[3], 0, CHAN_W);
|
FETCH(&r[3], 0, CHAN_W);
|
||||||
r[0].q = micro_div(r[0].q, r[3].q);
|
r[0].q = micro_div(r[0].q, r[3].q);
|
||||||
r[1].q = micro_div(r[1].q, r[3].q);
|
r[1].q = micro_div(r[1].q, r[3].q);
|
||||||
r[2].q = micro_div(r[2].q, r[3].q);
|
r[2].q = micro_div(r[2].q, r[3].q);
|
||||||
break;
|
|
||||||
|
|
||||||
case TGSI_EXTSWIZZLE_ONE:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
assert (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biasLod) {
|
if (biasLod) {
|
||||||
|
@ -1450,14 +1426,14 @@ exec_instruction(
|
||||||
/* simple texture lookup */
|
/* simple texture lookup */
|
||||||
/* src[0] = texcoord */
|
/* src[0] = texcoord */
|
||||||
/* src[1] = sampler unit */
|
/* src[1] = sampler unit */
|
||||||
exec_tex(mach, inst, FALSE);
|
exec_tex(mach, inst, FALSE, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TGSI_OPCODE_TXB:
|
case TGSI_OPCODE_TXB:
|
||||||
/* Texture lookup with lod bias */
|
/* Texture lookup with lod bias */
|
||||||
/* src[0] = texcoord (src[0].w = load bias) */
|
/* src[0] = texcoord (src[0].w = load bias) */
|
||||||
/* src[1] = sampler unit */
|
/* src[1] = sampler unit */
|
||||||
exec_tex(mach, inst, TRUE);
|
exec_tex(mach, inst, TRUE, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TGSI_OPCODE_TXD:
|
case TGSI_OPCODE_TXD:
|
||||||
|
@ -1473,7 +1449,14 @@ exec_instruction(
|
||||||
/* Texture lookup with explit LOD */
|
/* Texture lookup with explit LOD */
|
||||||
/* src[0] = texcoord (src[0].w = load bias) */
|
/* src[0] = texcoord (src[0].w = load bias) */
|
||||||
/* src[1] = sampler unit */
|
/* 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, TRUE, TRUE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TGSI_OPCODE_UP2H:
|
case TGSI_OPCODE_UP2H:
|
||||||
|
|
Loading…
Reference in New Issue