llvmpipe: Quick hack for 1D textures.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 9 Sep 2009 20:46:18 +0000 (21:46 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 9 Sep 2009 20:48:50 +0000 (21:48 +0100)
src/gallium/drivers/llvmpipe/lp_bld_sample.h
src/gallium/drivers/llvmpipe/lp_bld_sample_soa.c

index 5798f191fea9158f3808f0a80df49dfaa1e275da..6f565af76d15580e1c1ba4cf64c5c0655256a041 100644 (file)
@@ -53,6 +53,7 @@ struct lp_sampler_static_state
 {
    /* pipe_texture's state */
    enum pipe_format format;
+   unsigned target:2;
    unsigned pot_width:1;
    unsigned pot_height:1;
    unsigned pot_depth:1;
index 25c8d8450107a3f7dc45e49914ae0e4d9ca046dd..bcc9e41c50fed3e5d95d461e02ef0030904fd97c 100644 (file)
@@ -322,6 +322,9 @@ lp_build_sample_soa(LLVMBuilderRef builder,
    height = lp_build_broadcast_scalar(&bld.int_coord_bld, height);
    stride = lp_build_broadcast_scalar(&bld.int_coord_bld, stride);
 
+   if(static_state->target == PIPE_TEXTURE_1D)
+      t = bld.coord_bld.zero;
+
    if(static_state->normalized_coords) {
       LLVMTypeRef coord_vec_type = lp_build_vec_type(bld.coord_type);
       LLVMValueRef fp_width = LLVMBuildSIToFP(builder, width, coord_vec_type, "");