llvmpipe: added code to set texture depth, max mipmap levels info
authorBrian Paul <brianp@vmware.com>
Fri, 5 Mar 2010 23:51:35 +0000 (16:51 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 5 Mar 2010 23:51:35 +0000 (16:51 -0700)
src/gallium/drivers/llvmpipe/lp_jit.c
src/gallium/drivers/llvmpipe/lp_jit.h
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_tex_sample_llvm.c

index b666ffc80433668f919225bd55eebacb5d58b51d..bacff500d63ca48c7f6cfb067a523bfc616c08db 100644 (file)
@@ -51,10 +51,12 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
 
    /* struct lp_jit_texture */
    {
-      LLVMTypeRef elem_types[4];
+      LLVMTypeRef elem_types[6];
 
       elem_types[LP_JIT_TEXTURE_WIDTH]  = LLVMInt32Type();
       elem_types[LP_JIT_TEXTURE_HEIGHT] = LLVMInt32Type();
+      elem_types[LP_JIT_TEXTURE_DEPTH] = LLVMInt32Type();
+      elem_types[LP_JIT_TEXTURE_LAST_LEVEL] = LLVMInt32Type();
       elem_types[LP_JIT_TEXTURE_STRIDE] = LLVMInt32Type();
       elem_types[LP_JIT_TEXTURE_DATA]   = LLVMPointerType(LLVMInt8Type(), 0);
 
@@ -66,6 +68,12 @@ lp_jit_init_globals(struct llvmpipe_screen *screen)
       LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, height,
                              screen->target, texture_type,
                              LP_JIT_TEXTURE_HEIGHT);
+      LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, depth,
+                             screen->target, texture_type,
+                             LP_JIT_TEXTURE_DEPTH);
+      LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, last_level,
+                             screen->target, texture_type,
+                             LP_JIT_TEXTURE_LAST_LEVEL);
       LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, stride,
                              screen->target, texture_type,
                              LP_JIT_TEXTURE_STRIDE);
index 8df3015d4b4649120593939e29b3bcb0b13db278..0ebb2826fa2684f116cfad714521d47253b3704f 100644 (file)
@@ -48,6 +48,8 @@ struct lp_jit_texture
 {
    uint32_t width;
    uint32_t height;
+   uint32_t depth;
+   uint32_t last_level;
    uint32_t stride;
    const void *data;
 };
@@ -56,6 +58,8 @@ struct lp_jit_texture
 enum {
    LP_JIT_TEXTURE_WIDTH = 0,
    LP_JIT_TEXTURE_HEIGHT,
+   LP_JIT_TEXTURE_DEPTH,
+   LP_JIT_TEXTURE_LAST_LEVEL,
    LP_JIT_TEXTURE_STRIDE,
    LP_JIT_TEXTURE_DATA
 };
index aebed85fbbd6726fd7a83c94c5f9406fd665c515..b0713c3b71d6d6239089831360cd595465e29421 100644 (file)
@@ -469,6 +469,8 @@ lp_setup_set_sampler_textures( struct setup_context *setup,
          jit_tex = &setup->fs.current.jit_context.textures[i];
          jit_tex->width = tex->width0;
          jit_tex->height = tex->height0;
+         jit_tex->depth = tex->depth0;
+         jit_tex->last_level = tex->last_level;
          jit_tex->stride = lp_tex->stride[0];
          if(!lp_tex->dt) {
             jit_tex->data = lp_tex->data;
index 515c9089dd5f48480542dc62ecedc068c1878c12..632462460a36378d24ba63e6a911712cbc48473f 100644 (file)
@@ -132,10 +132,12 @@ lp_llvm_texture_member(struct lp_sampler_dynamic_state *base,
    }
 
 
-LP_LLVM_TEXTURE_MEMBER(width,    LP_JIT_TEXTURE_WIDTH)
-LP_LLVM_TEXTURE_MEMBER(height,   LP_JIT_TEXTURE_HEIGHT)
-LP_LLVM_TEXTURE_MEMBER(stride,   LP_JIT_TEXTURE_STRIDE)
-LP_LLVM_TEXTURE_MEMBER(data_ptr, LP_JIT_TEXTURE_DATA)
+LP_LLVM_TEXTURE_MEMBER(width,      LP_JIT_TEXTURE_WIDTH)
+LP_LLVM_TEXTURE_MEMBER(height,     LP_JIT_TEXTURE_HEIGHT)
+LP_LLVM_TEXTURE_MEMBER(depth,      LP_JIT_TEXTURE_DEPTH)
+LP_LLVM_TEXTURE_MEMBER(last_level, LP_JIT_TEXTURE_LAST_LEVEL)
+LP_LLVM_TEXTURE_MEMBER(stride,     LP_JIT_TEXTURE_STRIDE)
+LP_LLVM_TEXTURE_MEMBER(data_ptr,   LP_JIT_TEXTURE_DATA)
 
 
 static void
@@ -189,6 +191,8 @@ lp_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state,
    sampler->base.emit_fetch_texel = lp_llvm_sampler_soa_emit_fetch_texel;
    sampler->dynamic_state.base.width = lp_llvm_texture_width;
    sampler->dynamic_state.base.height = lp_llvm_texture_height;
+   sampler->dynamic_state.base.depth = lp_llvm_texture_depth;
+   sampler->dynamic_state.base.last_level = lp_llvm_texture_last_level;
    sampler->dynamic_state.base.stride = lp_llvm_texture_stride;
    sampler->dynamic_state.base.data_ptr = lp_llvm_texture_data_ptr;
    sampler->dynamic_state.static_state = static_state;