summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_state.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-08-09 20:59:44 -0600
committerBrian Paul <[email protected]>2012-08-16 09:01:31 -0600
commitcab2fed135bc1edf7b65ddca3236020638427061 (patch)
tree17a56b4023ad6345eb1a7baf9813da7dcf0469ff /src/gallium/drivers/i915/i915_state.c
parenta2c1df4c9a7375bc5306e8cfd07a9f7087759a96 (diff)
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/drivers/i915/i915_state.c')
-rw-r--r--src/gallium/drivers/i915/i915_state.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c
index 8af26fa9dc5..fdbff8b4a4e 100644
--- a/src/gallium/drivers/i915/i915_state.c
+++ b/src/gallium/drivers/i915/i915_state.c
@@ -310,7 +310,7 @@ i915_bind_vertex_sampler_states(struct pipe_context *pipe,
struct i915_context *i915 = i915_context(pipe);
unsigned i;
- assert(num_samplers <= PIPE_MAX_VERTEX_SAMPLERS);
+ assert(num_samplers <= Elements(i915->vertex_samplers));
/* Check for no-op */
if (num_samplers == i915->num_vertex_samplers &&
@@ -319,7 +319,7 @@ i915_bind_vertex_sampler_states(struct pipe_context *pipe,
for (i = 0; i < num_samplers; ++i)
i915->vertex_samplers[i] = samplers[i];
- for (i = num_samplers; i < PIPE_MAX_VERTEX_SAMPLERS; ++i)
+ for (i = num_samplers; i < Elements(i915->vertex_samplers); ++i)
i915->vertex_samplers[i] = NULL;
i915->num_vertex_samplers = num_samplers;
@@ -374,11 +374,11 @@ i915_prepare_vertex_sampling(struct i915_context *i915)
unsigned num = i915->num_vertex_sampler_views;
struct pipe_sampler_view **views = i915->vertex_sampler_views;
- assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
+ assert(num <= PIPE_MAX_SAMPLERS);
if (!num)
return;
- for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+ for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
struct pipe_sampler_view *view = i < num ? views[i] : NULL;
if (view) {
@@ -777,7 +777,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
struct i915_context *i915 = i915_context(pipe);
uint i;
- assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
+ assert(num <= Elements(i915->vertex_sampler_views));
/* Check for no-op */
if (num == i915->num_vertex_sampler_views &&
@@ -785,7 +785,7 @@ i915_set_vertex_sampler_views(struct pipe_context *pipe,
return;
}
- for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+ for (i = 0; i < Elements(i915->vertex_sampler_views); i++) {
struct pipe_sampler_view *view = i < num ? views[i] : NULL;
pipe_sampler_view_reference(&i915->vertex_sampler_views[i], view);