Mesa (master): nvc0/ir: TXF array index already is an integer
Christoph Bumiller
chrisbmr at kemper.freedesktop.org
Mon Jan 9 23:44:38 UTC 2012
Module: Mesa
Branch: master
Commit: e4210a42bcfdb19336faa2ad4b807818c71a2982
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e4210a42bcfdb19336faa2ad4b807818c71a2982
Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date: Sun Jan 8 16:26:23 2012 +0100
nvc0/ir: TXF array index already is an integer
---
.../drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp
index e4d32d0..5f906e4 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_lowering_nvc0.cpp
@@ -322,10 +322,13 @@ NVC0LoweringPass::handleTEX(TexInstruction *i)
Value *ticRel = i->getIndirectR();
Value *tscRel = i->getIndirectS();
- if (arrayIndex)
- bld.mkCvt(OP_CVT, TYPE_U16, src, TYPE_F32, arrayIndex);
- else
+ if (arrayIndex) {
+ int sat = (i->op == OP_TXF) ? 1 : 0;
+ DataType sTy = (i->op == OP_TXF) ? TYPE_U32 : TYPE_F32;
+ bld.mkCvt(OP_CVT, TYPE_U16, src, sTy, arrayIndex)->saturate = sat;
+ } else {
bld.loadImm(src, 0);
+ }
if (ticRel) {
i->setSrc(i->tex.rIndirectSrc, NULL);
More information about the mesa-commit
mailing list