summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-09-02 12:14:39 +0100
committerJosé Fonseca <[email protected]>2010-09-11 13:25:46 +0100
commit58daea741fa21fe3f89fd7bf106df1545c5b21af (patch)
tree8e4a6746b9f6a9351cde4d75c7b9530defbd06a3
parent34ea50f6720d6aca970613da560a1f25f5b5772c (diff)
gallivm: Move the texture modifiers to the header.
Useful to pass these around.
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi.h9
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c30
2 files changed, 20 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
index 4d415b6d416..e60ad1d9044 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
@@ -45,6 +45,15 @@ struct lp_build_context;
struct lp_build_mask_context;
+enum lp_build_tex_modifier {
+ LP_BLD_TEX_MODIFIER_NONE = 0,
+ LP_BLD_TEX_MODIFIER_PROJECTED,
+ LP_BLD_TEX_MODIFIER_LOD_BIAS,
+ LP_BLD_TEX_MODIFIER_EXPLICIT_LOD,
+ LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV
+};
+
+
/**
* Sampler code generation interface.
*
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
index 871bec2a411..cd5b132b41d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
@@ -816,18 +816,10 @@ emit_store(
* High-level instruction translators.
*/
-enum tex_modifier {
- TEX_MODIFIER_NONE = 0,
- TEX_MODIFIER_PROJECTED,
- TEX_MODIFIER_LOD_BIAS,
- TEX_MODIFIER_EXPLICIT_LOD,
- TEX_MODIFIER_EXPLICIT_DERIV
-};
-
static void
emit_tex( struct lp_build_tgsi_soa_context *bld,
const struct tgsi_full_instruction *inst,
- enum tex_modifier modifier,
+ enum lp_build_tex_modifier modifier,
LLVMValueRef *texel)
{
unsigned unit;
@@ -867,11 +859,11 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
return;
}
- if (modifier == TEX_MODIFIER_LOD_BIAS) {
+ if (modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS) {
lod_bias = emit_fetch( bld, inst, 0, 3 );
explicit_lod = NULL;
}
- else if (modifier == TEX_MODIFIER_EXPLICIT_LOD) {
+ else if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD) {
lod_bias = NULL;
explicit_lod = emit_fetch( bld, inst, 0, 3 );
}
@@ -880,21 +872,21 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
explicit_lod = NULL;
}
- if (modifier == TEX_MODIFIER_PROJECTED) {
+ if (modifier == LP_BLD_TEX_MODIFIER_PROJECTED) {
oow = emit_fetch( bld, inst, 0, 3 );
oow = lp_build_rcp(&bld->base, oow);
}
for (i = 0; i < num_coords; i++) {
coords[i] = emit_fetch( bld, inst, 0, i );
- if (modifier == TEX_MODIFIER_PROJECTED)
+ if (modifier == LP_BLD_TEX_MODIFIER_PROJECTED)
coords[i] = lp_build_mul(&bld->base, coords[i], oow);
}
for (i = num_coords; i < 3; i++) {
coords[i] = bld->base.undef;
}
- if (modifier == TEX_MODIFIER_EXPLICIT_DERIV) {
+ if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV) {
for (i = 0; i < num_coords; i++) {
ddx[i] = emit_fetch( bld, inst, 1, i );
ddy[i] = emit_fetch( bld, inst, 2, i );
@@ -1627,11 +1619,11 @@ emit_instruction(
break;
case TGSI_OPCODE_TEX:
- emit_tex( bld, inst, TEX_MODIFIER_NONE, dst0 );
+ emit_tex( bld, inst, LP_BLD_TEX_MODIFIER_NONE, dst0 );
break;
case TGSI_OPCODE_TXD:
- emit_tex( bld, inst, TEX_MODIFIER_EXPLICIT_DERIV, dst0 );
+ emit_tex( bld, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV, dst0 );
break;
case TGSI_OPCODE_UP2H:
@@ -1735,7 +1727,7 @@ emit_instruction(
break;
case TGSI_OPCODE_TXB:
- emit_tex( bld, inst, TEX_MODIFIER_LOD_BIAS, dst0 );
+ emit_tex( bld, inst, LP_BLD_TEX_MODIFIER_LOD_BIAS, dst0 );
break;
case TGSI_OPCODE_NRM:
@@ -1840,11 +1832,11 @@ emit_instruction(
break;
case TGSI_OPCODE_TXL:
- emit_tex( bld, inst, TEX_MODIFIER_EXPLICIT_LOD, dst0 );
+ emit_tex( bld, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD, dst0 );
break;
case TGSI_OPCODE_TXP:
- emit_tex( bld, inst, TEX_MODIFIER_PROJECTED, dst0 );
+ emit_tex( bld, inst, LP_BLD_TEX_MODIFIER_PROJECTED, dst0 );
break;
case TGSI_OPCODE_BRK: