diff options
author | Brian Paul <[email protected]> | 2010-09-23 19:16:33 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-09-24 09:48:32 -0600 |
commit | d1a4dd4217a4b8b018d4d9a161afece640d75694 (patch) | |
tree | a4ce8e0e63a5a16a14d0147a00123a7f67824041 /src/gallium/drivers/llvmpipe | |
parent | 61b7da074e2faebf03d3dfc30e910ee1367bcd5a (diff) |
llvmpipe: make texture border_color dynamic state
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_jit.c | 7 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_jit.h | 2 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 1 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_tex_sample.c | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index 4c7089892ef..04b12dedccf 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -64,11 +64,11 @@ lp_jit_init_globals(struct llvmpipe_screen *screen) elem_types[LP_JIT_TEXTURE_DATA] = LLVMArrayType(LLVMPointerType(LLVMInt8Type(), 0), LP_MAX_TEXTURE_LEVELS); - elem_types[LP_JIT_TEXTURE_MIN_LOD] = LLVMFloatType(); elem_types[LP_JIT_TEXTURE_MAX_LOD] = LLVMFloatType(); elem_types[LP_JIT_TEXTURE_LOD_BIAS] = LLVMFloatType(); - + elem_types[LP_JIT_TEXTURE_BORDER_COLOR] = + LLVMArrayType(LLVMFloatType(), 4); texture_type = LLVMStructType(elem_types, Elements(elem_types), 0); @@ -102,6 +102,9 @@ lp_jit_init_globals(struct llvmpipe_screen *screen) LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, lod_bias, screen->target, texture_type, LP_JIT_TEXTURE_LOD_BIAS); + LP_CHECK_MEMBER_OFFSET(struct lp_jit_texture, border_color, + screen->target, texture_type, + LP_JIT_TEXTURE_BORDER_COLOR); LP_CHECK_STRUCT_SIZE(struct lp_jit_texture, screen->target, texture_type); diff --git a/src/gallium/drivers/llvmpipe/lp_jit.h b/src/gallium/drivers/llvmpipe/lp_jit.h index e94d758e200..16e04fce0cd 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.h +++ b/src/gallium/drivers/llvmpipe/lp_jit.h @@ -58,6 +58,7 @@ struct lp_jit_texture float min_lod; float max_lod; float lod_bias; + float border_color[4]; }; @@ -72,6 +73,7 @@ enum { LP_JIT_TEXTURE_MIN_LOD, LP_JIT_TEXTURE_MAX_LOD, LP_JIT_TEXTURE_LOD_BIAS, + LP_JIT_TEXTURE_BORDER_COLOR, LP_JIT_TEXTURE_NUM_FIELDS /* number of fields above */ }; diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 28d202bd655..eade4000873 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -643,6 +643,7 @@ lp_setup_set_fragment_sampler_views(struct lp_setup_context *setup, jit_tex->min_lod = samplers[i]->min_lod; jit_tex->max_lod = samplers[i]->max_lod; jit_tex->lod_bias = samplers[i]->lod_bias; + COPY_4V(jit_tex->border_color, samplers[i]->border_color); /* We're referencing the texture's internal data, so save a * reference to it. diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.c b/src/gallium/drivers/llvmpipe/lp_tex_sample.c index 151fe93cfbb..f417fc8a9ea 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.c @@ -154,6 +154,7 @@ LP_LLVM_TEXTURE_MEMBER(data_ptr, LP_JIT_TEXTURE_DATA, FALSE) LP_LLVM_TEXTURE_MEMBER(min_lod, LP_JIT_TEXTURE_MIN_LOD, TRUE) LP_LLVM_TEXTURE_MEMBER(max_lod, LP_JIT_TEXTURE_MAX_LOD, TRUE) LP_LLVM_TEXTURE_MEMBER(lod_bias, LP_JIT_TEXTURE_LOD_BIAS, TRUE) +LP_LLVM_TEXTURE_MEMBER(border_color, LP_JIT_TEXTURE_BORDER_COLOR, FALSE) static void @@ -223,6 +224,7 @@ lp_llvm_sampler_soa_create(const struct lp_sampler_static_state *static_state, sampler->dynamic_state.base.min_lod = lp_llvm_texture_min_lod; sampler->dynamic_state.base.max_lod = lp_llvm_texture_max_lod; sampler->dynamic_state.base.lod_bias = lp_llvm_texture_lod_bias; + sampler->dynamic_state.base.border_color = lp_llvm_texture_border_color; sampler->dynamic_state.static_state = static_state; sampler->dynamic_state.context_ptr = context_ptr; |