nv50/ir: fix texture size for msaa textures

These are scaled up in the descriptor, which doesn't really know about
their MSAA-ness. So we have to shift them back down.

Cc: mesa-stable
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10162>
This commit is contained in:
Ilia Mirkin 2021-04-03 01:09:21 -04:00 committed by Marge Bot
parent 723b000d27
commit 1baefe4119

View file

@ -1038,8 +1038,22 @@ bool
NV50LoweringPreSSA::handleTXQ(TexInstruction *i)
{
Value *ms, *ms_x, *ms_y;
if (i->tex.query == TXQ_DIMS)
if (i->tex.query == TXQ_DIMS) {
if (i->tex.target.isMS()) {
bld.setPosition(i, true);
loadTexMsInfo(i->tex.r * 4 * 2, &ms, &ms_x, &ms_y);
int d = 0;
if (i->tex.mask & 1) {
bld.mkOp2(OP_SHR, TYPE_U32, i->getDef(d), i->getDef(d), ms_x);
d++;
}
if (i->tex.mask & 2) {
bld.mkOp2(OP_SHR, TYPE_U32, i->getDef(d), i->getDef(d), ms_y);
d++;
}
}
return true;
}
assert(i->tex.query == TXQ_TYPE);
assert(i->tex.mask == 4);