diff options
author | Samuel Pitoiset <[email protected]> | 2016-04-02 12:58:46 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2016-04-26 19:47:49 +0200 |
commit | e478156ed7b57724fd189efd5c4ac42e769f6d04 (patch) | |
tree | b02755770c3015a16ba2b9bf25e3f3d252b4d6d8 /src/gallium/drivers | |
parent | 3ce80f924d07648040ab08a9cd30588621fb47a1 (diff) |
nvc0/ir: fix cube images for Kepler
Like 2d array images, the z-dimension needs to be clamped.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp index 82f5f211d0b..e23141b2dd2 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp @@ -1607,7 +1607,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su) su->op == OP_SULDB || su->op == OP_SUSTB || su->op == OP_SUREDB; const int idx = su->tex.r; const int dim = su->tex.target.getDim(); - const int arg = dim + (su->tex.target.isArray() ? 1 : 0); + const int arg = dim + (su->tex.target.isArray() || su->tex.target.isCube()); const uint16_t base = idx * NVE4_SU_INFO__STRIDE; int c; Value *zero = bld.mkImm(0); @@ -1643,7 +1643,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su) if (su->tex.target == TEX_TARGET_BUFFER) { src[0]->getInsn()->setFlagsDef(1, pred); } else - if (su->tex.target.isArray()) { + if (su->tex.target.isArray() || su->tex.target.isCube()) { p1 = bld.getSSA(1, FILE_PREDICATE); src[dim]->getInsn()->setFlagsDef(1, p1); } @@ -1665,7 +1665,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su) assert(dim == 2); v = loadSuInfo32(NULL, base + NVE4_SU_INFO_PITCH); bld.mkOp3(OP_MADSP, TYPE_U32, off, src[1], v, src[0]) - ->subOp = su->tex.target.isArray() ? + ->subOp = (su->tex.target.isArray() || su->tex.target.isCube()) ? NV50_IR_SUBOP_MADSP_SD : NV50_IR_SUBOP_MADSP(4,2,8); // u16l u16l u16l } @@ -1690,7 +1690,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su) break; case 2: z = off; - if (!su->tex.target.isArray()) { + if (!su->tex.target.isArray() && !su->tex.target.isCube()) { z = loadSuInfo32(NULL, base + NVE4_SU_INFO_UNK1C); subOp = NV50_IR_SUBOP_SUBFM_3D; } @@ -1714,7 +1714,7 @@ NVC0LoweringPass::processSurfaceCoordsNVE4(TexInstruction *su) eau = bld.mkOp3v(OP_SUEAU, TYPE_U32, bld.getScratch(4), off, bf, v); } // add array layer offset - if (su->tex.target.isArray()) { + if (su->tex.target.isArray() || su->tex.target.isCube()) { v = loadSuInfo32(NULL, base + NVE4_SU_INFO_ARRAY); if (dim == 1) bld.mkOp3(OP_MADSP, TYPE_U32, eau, src[1], v, eau) |