nv50: enable array textures
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 24 Apr 2012 21:21:41 +0000 (23:21 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 4 May 2012 16:00:03 +0000 (18:00 +0200)
src/gallium/drivers/nv50/codegen/nv50_ir_lowering_nv50.cpp
src/gallium/drivers/nv50/nv50_screen.c

index 27373b4cc47ca56a9b3c27a59e3986b1a55fa05d..011014eb5ba56fe9a95164cc37ca88a3d0c80c75 100644 (file)
@@ -587,7 +587,8 @@ NV50LoweringPreSSA::handleTEX(TexInstruction *i)
    if (i->tex.target.isArray()) {
       Value *layer = i->getSrc(arg - 1);
       LValue *src = new_LValue(func, FILE_GPR);
-      bld.mkCvt(OP_CVT, TYPE_U16, src, TYPE_F32, layer);
+      bld.mkCvt(OP_CVT, TYPE_U32, src, TYPE_F32, layer);
+      bld.mkOp2(OP_MIN, TYPE_U32, src, src, bld.loadImm(NULL, 511));
       i->setSrc(arg - 1, src);
 
       if (i->tex.target.isCube()) {
index b3489198d2b1858aa19da48b66b0ef22fd0ecad1..d72b6e91d2a57d50a6ed10abe0389813fbda833b 100644 (file)
@@ -82,8 +82,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 12;
    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
       return 14;
-   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: /* shader support missing */
-      return 0;
+   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
+      return 512;
    case PIPE_CAP_MIN_TEXEL_OFFSET:
       return -8;
    case PIPE_CAP_MAX_TEXEL_OFFSET: