From: Ilia Mirkin Date: Tue, 11 Mar 2014 12:30:49 +0000 (-0400) Subject: nv50/ir/gk110: implement partial txq support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76554d2d1f3e017370a7ef1b3ea511f83cd83573;p=mesa.git nv50/ir/gk110: implement partial txq support Signed-off-by: Ilia Mirkin --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp index 6a24b0a2299..033104bff9b 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -1059,7 +1059,33 @@ CodeEmitterGK110::emitTEX(const TexInstruction *i) void CodeEmitterGK110::emitTXQ(const TexInstruction *i) { - emitNOP(i); // TODO + code[0] = 0x00000002; + code[1] = 0x75400001; + + switch (i->tex.query) { + case TXQ_DIMS: code[0] |= 0x01 << 25; break; + case TXQ_TYPE: code[0] |= 0x02 << 25; break; + case TXQ_SAMPLE_POSITION: code[0] |= 0x05 << 25; break; + case TXQ_FILTER: code[0] |= 0x10 << 25; break; + case TXQ_LOD: code[0] |= 0x12 << 25; break; + case TXQ_BORDER_COLOUR: code[0] |= 0x16 << 25; break; + default: + assert(!"invalid texture query"); + break; + } + + // TODO: + // code[1] |= i->tex.mask << 14; + // + // code[1] |= i->tex.r << 9; + // code[1] |= i->tex.s << 2; + // if (i->tex.sIndirectSrc >= 0 || i->tex.rIndirectSrc >= 0) + // ? + + defId(i->def(0), 2); + srcId(i->src(0), 10); + + emitPredicate(i); } void