diff options
author | Ilia Mirkin <[email protected]> | 2013-11-29 01:18:57 -0500 |
---|---|---|
committer | Maarten Lankhorst <[email protected]> | 2013-12-09 15:10:37 +0100 |
commit | 1386cb94882917e6eabc5b482ab8b443a2f1df51 (patch) | |
tree | 3657c8c5daaa1365de8b51e7d22e1f887ca9d0ae /src/gallium/drivers | |
parent | 0319ea9ff6a9cc2eba4879fbe09c6fac137d6ce1 (diff) |
nv50: TXF already has integer arguments, don't try to convert from f32
Fixes the texelFetch piglit tests
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp index caaf09f6787..07f3a217e59 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp @@ -575,14 +575,16 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i) if (i->op == OP_TXB || i->op == OP_TXL) i->swapSources(dref, lod); - // array index must be converted to u32 if (i->tex.target.isArray()) { - Value *layer = i->getSrc(arg - 1); - LValue *src = new_LValue(func, FILE_GPR); - bld.mkCvt(OP_CVT, TYPE_U32, src, TYPE_F32, layer); - bld.mkOp2(OP_MIN, TYPE_U32, src, src, bld.loadImm(NULL, 511)); - i->setSrc(arg - 1, src); - + if (i->op != OP_TXF) { + // array index must be converted to u32, but it's already an integer + // for TXF + Value *layer = i->getSrc(arg - 1); + LValue *src = new_LValue(func, FILE_GPR); + bld.mkCvt(OP_CVT, TYPE_U32, src, TYPE_F32, layer); + bld.mkOp2(OP_MIN, TYPE_U32, src, src, bld.loadImm(NULL, 511)); + i->setSrc(arg - 1, src); + } if (i->tex.target.isCube()) { std::vector<Value *> acube, a2d; int c; |