gallivm: enable 3D texture sampling
authorBrian Paul <brianp@vmware.com>
Thu, 11 Mar 2010 21:42:26 +0000 (14:42 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 11 Mar 2010 21:49:01 +0000 (14:49 -0700)
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index 2fc22fb1fd547b1c84e335cc40fc9b0acd256c2c..50b61dc2246a66c062627076f722ff64e296e678 100644 (file)
@@ -1280,6 +1280,8 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
                                                       ilevel0);
       if (dims == 3) {
          depth0_vec = lp_build_minify(bld, depth_vec, ilevel0_vec);
+         img_stride0_vec = lp_build_mul(&bld->int_coord_bld,
+                                        row_stride0_vec, height0_vec);
       }
    }
    if (mip_filter == PIPE_TEX_MIPFILTER_LINEAR) {
@@ -1291,6 +1293,8 @@ lp_build_sample_general(struct lp_build_sample_context *bld,
                                                          ilevel1);
          if (dims == 3) {
             depth1_vec = lp_build_minify(bld, depth_vec, ilevel1_vec);
+            img_stride1_vec = lp_build_mul(&bld->int_coord_bld,
+                                           row_stride1_vec, height1_vec);
          }
       }
    }
@@ -1710,6 +1714,7 @@ lp_build_sample_soa(LLVMBuilderRef builder,
    depth_vec = lp_build_broadcast_scalar(&bld.uint_coord_bld, depth);
 
    if (lp_format_is_rgba8(bld.format_desc) &&
+       static_state->target == PIPE_TEXTURE_2D &&
        static_state->min_img_filter == PIPE_TEX_FILTER_LINEAR &&
        static_state->mag_img_filter == PIPE_TEX_FILTER_LINEAR &&
        static_state->min_mip_filter == PIPE_TEX_MIPFILTER_NONE &&