summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915
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
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')
-rw-r--r--src/gallium/drivers/i915/i915_context.h6
-rw-r--r--src/gallium/drivers/i915/i915_screen.c2
-rw-r--r--src/gallium/drivers/i915/i915_state.c12
3 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/i915/i915_context.h b/src/gallium/drivers/i915/i915_context.h
index 16b0c57166d..c9198e270db 100644
--- a/src/gallium/drivers/i915/i915_context.h
+++ b/src/gallium/drivers/i915/i915_context.h
@@ -230,7 +230,7 @@ struct i915_context {
*/
const struct i915_blend_state *blend;
const struct i915_sampler_state *sampler[PIPE_MAX_SAMPLERS];
- struct pipe_sampler_state *vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS];
+ struct pipe_sampler_state *vertex_samplers[PIPE_MAX_SAMPLERS];
const struct i915_depth_stencil_state *depth_stencil;
const struct i915_rasterizer_state *rasterizer;
@@ -250,8 +250,8 @@ struct i915_context {
unsigned dirty;
- struct pipe_resource *mapped_vs_tex[PIPE_MAX_VERTEX_SAMPLERS];
- struct i915_winsys_buffer* mapped_vs_tex_buffer[PIPE_MAX_VERTEX_SAMPLERS];
+ struct pipe_resource *mapped_vs_tex[PIPE_MAX_SAMPLERS];
+ struct i915_winsys_buffer* mapped_vs_tex_buffer[PIPE_MAX_SAMPLERS];
unsigned num_samplers;
unsigned num_fragment_sampler_views;
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 35b343e0de8..579337b0f23 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -107,7 +107,7 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha
switch (cap) {
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
if (debug_get_bool_option("DRAW_USE_LLVM", TRUE))
- return PIPE_MAX_VERTEX_SAMPLERS;
+ return PIPE_MAX_SAMPLERS;
else
return 0;
default:
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);