summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
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/softpipe
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/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c8
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h2
-rw-r--r--src/gallium/drivers/softpipe/sp_screen.c4
3 files changed, 5 insertions, 9 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index e2e32b9bd8c..0360b3ba9fb 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -216,10 +216,6 @@ softpipe_create_context( struct pipe_screen *screen,
struct softpipe_context *softpipe = CALLOC_STRUCT(softpipe_context);
uint i, sh;
- /* Check since we have arrays[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] */
- STATIC_ASSERT(PIPE_MAX_SAMPLERS == PIPE_MAX_VERTEX_SAMPLERS);
- STATIC_ASSERT(PIPE_MAX_SAMPLERS == PIPE_MAX_GEOMETRY_SAMPLERS);
-
util_init_math();
softpipe->dump_fs = debug_get_bool_option( "SOFTPIPE_DUMP_FS", FALSE );
@@ -290,13 +286,13 @@ softpipe_create_context( struct pipe_screen *screen,
draw_texture_samplers(softpipe->draw,
PIPE_SHADER_VERTEX,
- PIPE_MAX_VERTEX_SAMPLERS,
+ PIPE_MAX_SAMPLERS,
(struct tgsi_sampler **)
softpipe->tgsi.samplers_list[PIPE_SHADER_VERTEX]);
draw_texture_samplers(softpipe->draw,
PIPE_SHADER_GEOMETRY,
- PIPE_MAX_GEOMETRY_SAMPLERS,
+ PIPE_MAX_SAMPLERS,
(struct tgsi_sampler **)
softpipe->tgsi.samplers_list[PIPE_SHADER_GEOMETRY]);
diff --git a/src/gallium/drivers/softpipe/sp_context.h b/src/gallium/drivers/softpipe/sp_context.h
index 2185fb85277..44599dd4845 100644
--- a/src/gallium/drivers/softpipe/sp_context.h
+++ b/src/gallium/drivers/softpipe/sp_context.h
@@ -79,7 +79,7 @@ struct softpipe_context {
struct pipe_framebuffer_state framebuffer;
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
- struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_GEOMETRY_SAMPLERS];
+ struct pipe_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
struct pipe_viewport_state viewport;
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 5588611edcf..98a3e093f82 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -67,7 +67,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
{
switch (param) {
case PIPE_CAP_MAX_COMBINED_SAMPLERS:
- return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS;
+ return 2 * PIPE_MAX_SAMPLERS; /* VS + FS */
case PIPE_CAP_NPOT_TEXTURES:
return 1;
case PIPE_CAP_TWO_SIDED_STENCIL:
@@ -190,7 +190,7 @@ softpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe
/* Softpipe doesn't yet know how to tell draw/llvm about textures */
return 0;
else
- return PIPE_MAX_VERTEX_SAMPLERS;
+ return PIPE_MAX_SAMPLERS;
default:
if (sp_screen->use_llvm)
return draw_get_shader_param(shader, param);