summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_llvm_sample.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2013-01-25 16:33:43 -0800
committerRoland Scheidegger <sroland@vmware.com>2013-01-28 06:58:06 -0800
commitcbf0f666311a5cb2720a4d6f4c540da1dd33e418 (patch)
tree3c2009de6b8dc97d983bb38dfb55f8b3fc8b0574 /src/gallium/auxiliary/draw/draw_llvm_sample.c
parentc789b981b244333cfc903bcd1e2fefc010500013 (diff)
downloadexternal_mesa3d-cbf0f666311a5cb2720a4d6f4c540da1dd33e418.zip
external_mesa3d-cbf0f666311a5cb2720a4d6f4c540da1dd33e418.tar.gz
external_mesa3d-cbf0f666311a5cb2720a4d6f4c540da1dd33e418.tar.bz2
gallivm,draw,llvmpipe: mass rename of unit->texture_unit/sampler_unit
Make it obvious what "unit" this is (no change in functionality). draw still uses "unit" in places where it changes the shader by adding texture sampling itself - it seems like this can't work with shaders using dx10-style sample opcodes (can't mix gl-style and dx10-style sample instructions in a shader). Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_llvm_sample.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm_sample.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c
index 9932b91..03a2592 100644
--- a/src/gallium/auxiliary/draw/draw_llvm_sample.c
+++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c
@@ -86,7 +86,7 @@ struct draw_llvm_sampler_soa
static LLVMValueRef
draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
struct gallivm_state *gallivm,
- unsigned unit,
+ unsigned texture_unit,
unsigned member_index,
const char *member_name,
boolean emit_load)
@@ -98,14 +98,14 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
LLVMValueRef ptr;
LLVMValueRef res;
- debug_assert(unit < PIPE_MAX_SHADER_SAMPLER_VIEWS);
+ debug_assert(texture_unit < PIPE_MAX_SHADER_SAMPLER_VIEWS);
/* context[0] */
indices[0] = lp_build_const_int32(gallivm, 0);
/* context[0].textures */
indices[1] = lp_build_const_int32(gallivm, DRAW_JIT_CTX_TEXTURES);
/* context[0].textures[unit] */
- indices[2] = lp_build_const_int32(gallivm, unit);
+ indices[2] = lp_build_const_int32(gallivm, texture_unit);
/* context[0].textures[unit].member */
indices[3] = lp_build_const_int32(gallivm, member_index);
@@ -116,7 +116,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
else
res = ptr;
- lp_build_name(res, "context.texture%u.%s", unit, member_name);
+ lp_build_name(res, "context.texture%u.%s", texture_unit, member_name);
return res;
}
@@ -133,7 +133,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
static LLVMValueRef
draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
struct gallivm_state *gallivm,
- unsigned unit,
+ unsigned sampler_unit,
unsigned member_index,
const char *member_name,
boolean emit_load)
@@ -145,14 +145,14 @@ draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
LLVMValueRef ptr;
LLVMValueRef res;
- debug_assert(unit < PIPE_MAX_SAMPLERS);
+ debug_assert(sampler_unit < PIPE_MAX_SAMPLERS);
/* context[0] */
indices[0] = lp_build_const_int32(gallivm, 0);
/* context[0].samplers */
indices[1] = lp_build_const_int32(gallivm, DRAW_JIT_CTX_SAMPLERS);
/* context[0].samplers[unit] */
- indices[2] = lp_build_const_int32(gallivm, unit);
+ indices[2] = lp_build_const_int32(gallivm, sampler_unit);
/* context[0].samplers[unit].member */
indices[3] = lp_build_const_int32(gallivm, member_index);
@@ -163,7 +163,7 @@ draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
else
res = ptr;
- lp_build_name(res, "context.sampler%u.%s", unit, member_name);
+ lp_build_name(res, "context.sampler%u.%s", sampler_unit, member_name);
return res;
}
@@ -182,9 +182,9 @@ draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base,
static LLVMValueRef \
draw_llvm_texture_##_name( const struct lp_sampler_dynamic_state *base, \
struct gallivm_state *gallivm, \
- unsigned unit) \
+ unsigned texture_unit) \
{ \
- return draw_llvm_texture_member(base, gallivm, unit, _index, #_name, _emit_load ); \
+ return draw_llvm_texture_member(base, gallivm, texture_unit, _index, #_name, _emit_load ); \
}
@@ -203,9 +203,9 @@ DRAW_LLVM_TEXTURE_MEMBER(mip_offsets, DRAW_JIT_TEXTURE_MIP_OFFSETS, FALSE)
static LLVMValueRef \
draw_llvm_sampler_##_name( const struct lp_sampler_dynamic_state *base, \
struct gallivm_state *gallivm, \
- unsigned unit) \
+ unsigned sampler_unit) \
{ \
- return draw_llvm_sampler_member(base, gallivm, unit, _index, #_name, _emit_load ); \
+ return draw_llvm_sampler_member(base, gallivm, sampler_unit, _index, #_name, _emit_load ); \
}
@@ -268,19 +268,19 @@ static void
draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
struct gallivm_state *gallivm,
struct lp_type type,
- unsigned unit,
+ unsigned texture_unit,
LLVMValueRef explicit_lod, /* optional */
LLVMValueRef *sizes_out)
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
- assert(unit < PIPE_MAX_SAMPLERS);
+ assert(texture_unit < PIPE_MAX_SHADER_SAMPLER_VIEWS);
lp_build_size_query_soa(gallivm,
- &sampler->dynamic_state.static_state[unit].texture_state,
+ &sampler->dynamic_state.static_state[texture_unit].texture_state,
&sampler->dynamic_state.base,
type,
- unit,
+ texture_unit,
explicit_lod,
sizes_out);
}