Mesa (master): nv50/ir: fix texture size for msaa textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 12 17:32:38 UTC 2021


Module: Mesa
Branch: master
Commit: 1baefe4119ee75c5bbc159824271626b2eea3127
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1baefe4119ee75c5bbc159824271626b2eea3127

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sat Apr  3 01:09:21 2021 -0400

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 at alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10162>

---

 .../drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp    | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

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 6b14f7339f7..406b0f709f6 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
@@ -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);
 



More information about the mesa-commit mailing list