Mesa (master): nv50: enable cube map array texture support

Ilia Mirkin imirkin at kemper.freedesktop.org
Tue Feb 25 19:43:40 UTC 2014


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Feb  7 17:42:58 2014 -0500

nv50: enable cube map array texture support

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp |    5 +++--
 src/gallium/drivers/nouveau/nv50/nv50_screen.c                |    3 ---
 src/gallium/drivers/nouveau/nv50/nv50_tex.c                   |    8 ++++----
 3 files changed, 7 insertions(+), 9 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 984a8ca..0908447 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nv50.cpp
@@ -664,7 +664,7 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i)
          bld.mkOp2(OP_MIN, TYPE_U32, src, src, bld.loadImm(NULL, 511));
          i->setSrc(arg - 1, src);
       }
-      if (i->tex.target.isCube()) {
+      if (i->tex.target.isCube() && i->srcCount() > 4) {
          std::vector<Value *> acube, a2d;
          int c;
 
@@ -681,9 +681,10 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i)
 
          for (c = 0; c < 3; ++c)
             i->setSrc(c, a2d[c]);
-         i->setSrc(c, NULL);
          for (; i->srcExists(c + 1); ++c)
             i->setSrc(c, i->getSrc(c + 1));
+         i->setSrc(c, NULL);
+         assert(c <= 4);
 
          i->tex.target = i->tex.target.isShadow() ?
             TEX_TARGET_2D_ARRAY_SHADOW : TEX_TARGET_2D_ARRAY;
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index d1d4621..2099515 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -112,10 +112,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
       return 0;
    case PIPE_CAP_CUBE_MAP_ARRAY:
-      return 0;
-      /*
       return nv50_screen(pscreen)->tesla->oclass >= NVA3_3D_CLASS;
-      */
    case PIPE_CAP_TWO_SIDED_STENCIL:
    case PIPE_CAP_DEPTH_CLIP_DISABLE:
    case PIPE_CAP_POINT_SPRITE:
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c
index 6784821..5cfce3a 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c
@@ -115,12 +115,12 @@ nv50_create_texture_view(struct pipe_context *pipe,
 
    addr = mt->base.address;
 
-   if (mt->base.base.target == PIPE_TEXTURE_1D_ARRAY ||
-       mt->base.base.target == PIPE_TEXTURE_2D_ARRAY) {
+   depth = MAX2(mt->base.base.array_size, mt->base.base.depth0);
+
+   if (mt->base.base.array_size > 1) {
+      /* there doesn't seem to be a base layer field in TIC */
       addr += view->pipe.u.tex.first_layer * mt->layer_stride;
       depth = view->pipe.u.tex.last_layer - view->pipe.u.tex.first_layer + 1;
-   } else {
-      depth = mt->base.base.depth0;
    }
 
    tic[2] = 0x10001000 | NV50_TIC_2_NO_BORDER;




More information about the mesa-commit mailing list