summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-08-09 20:59:44 -0600
committerBrian Paul <brianp@vmware.com>2012-08-16 09:01:31 -0600
commitcab2fed135bc1edf7b65ddca3236020638427061 (patch)
tree17a56b4023ad6345eb1a7baf9813da7dcf0469ff /src/gallium/auxiliary
parenta2c1df4c9a7375bc5306e8cfd07a9f7087759a96 (diff)
downloadmesa-cab2fed135bc1edf7b65ddca3236020638427061.tar.gz
gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #define
PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS were all defined to the same value (16). In various places we're creating arrays such as sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming the same number of max samplers for all shader stages anyway. Of course, drivers are still free to advertise different numbers of max samplers for different shaders.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c4
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.h4
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm_sample.c6
4 files changed, 7 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 7fb8caf1337..db4fa019a35 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -256,8 +256,6 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
if (ctx == NULL)
goto out;
- assert(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
-
ctx->cache = cso_cache_create();
if (ctx->cache == NULL)
goto out;
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 133aa5f6983..ebfe437261c 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -164,7 +164,7 @@ create_jit_context_type(struct gallivm_state *gallivm,
DRAW_TOTAL_CLIP_PLANES), 0);
elem_types[3] = LLVMPointerType(float_type, 0); /* viewport */
elem_types[4] = LLVMArrayType(texture_type,
- PIPE_MAX_VERTEX_SAMPLERS); /* textures */
+ PIPE_MAX_SAMPLERS); /* textures */
context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
Elements(elem_types), 0);
#if HAVE_LLVM < 0x0300
@@ -1371,7 +1371,7 @@ draw_llvm_set_mapped_texture(struct draw_context *draw,
unsigned j;
struct draw_jit_texture *jit_tex;
- assert(sampler_idx < PIPE_MAX_VERTEX_SAMPLERS);
+ assert(sampler_idx < Elements(draw->llvm->jit_context.textures));
jit_tex = &draw->llvm->jit_context.textures[sampler_idx];
diff --git a/src/gallium/auxiliary/draw/draw_llvm.h b/src/gallium/auxiliary/draw/draw_llvm.h
index 39d83cfe99f..9a291a47627 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.h
+++ b/src/gallium/auxiliary/draw/draw_llvm.h
@@ -97,7 +97,7 @@ struct draw_jit_context
float (*planes) [DRAW_TOTAL_CLIP_PLANES][4];
float *viewport;
- struct draw_jit_texture textures[PIPE_MAX_VERTEX_SAMPLERS];
+ struct draw_jit_texture textures[PIPE_MAX_SAMPLERS];
};
@@ -184,7 +184,7 @@ struct draw_llvm_variant_key
#define DRAW_LLVM_MAX_VARIANT_KEY_SIZE \
(sizeof(struct draw_llvm_variant_key) + \
- PIPE_MAX_VERTEX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
+ PIPE_MAX_SAMPLERS * sizeof(struct lp_sampler_static_state) + \
(PIPE_MAX_ATTRIBS-1) * sizeof(struct pipe_vertex_element))
diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c
index 1dbe5f5bd19..53317165557 100644
--- a/src/gallium/auxiliary/draw/draw_llvm_sample.c
+++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c
@@ -98,7 +98,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
LLVMValueRef ptr;
LLVMValueRef res;
- debug_assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
+ debug_assert(unit < PIPE_MAX_SAMPLERS);
/* context[0] */
indices[0] = lp_build_const_int32(gallivm, 0);
@@ -180,7 +180,7 @@ draw_llvm_sampler_soa_emit_fetch_texel(const struct lp_build_sampler_soa *base,
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
- assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
+ assert(unit < PIPE_MAX_SAMPLERS);
lp_build_sample_soa(gallivm,
&sampler->dynamic_state.static_state[unit],
@@ -207,7 +207,7 @@ draw_llvm_sampler_soa_emit_size_query(const struct lp_build_sampler_soa *base,
{
struct draw_llvm_sampler_soa *sampler = (struct draw_llvm_sampler_soa *)base;
- assert(unit < PIPE_MAX_VERTEX_SAMPLERS);
+ assert(unit < PIPE_MAX_SAMPLERS);
lp_build_size_query_soa(gallivm,
&sampler->dynamic_state.static_state[unit],