summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
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/llvmpipe
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/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.h2
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_sampler.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c
index 7d0ca1f8cd8..dec34738029 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.c
+++ b/src/gallium/drivers/llvmpipe/lp_context.c
@@ -69,11 +69,11 @@ static void llvmpipe_destroy( struct pipe_context *pipe )
pipe_surface_reference(&llvmpipe->framebuffer.zsbuf, NULL);
- for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
+ for (i = 0; i < Elements(llvmpipe->sampler_views[0]); i++) {
pipe_sampler_view_reference(&llvmpipe->sampler_views[PIPE_SHADER_FRAGMENT][i], NULL);
}
- for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
+ for (i = 0; i < Elements(llvmpipe->sampler_views[0]); i++) {
pipe_sampler_view_reference(&llvmpipe->sampler_views[PIPE_SHADER_VERTEX][i], NULL);
}
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index f8610ae8f0c..b7b7ede7eaf 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -86,7 +86,7 @@ struct llvmpipe_context {
int so_count[PIPE_MAX_SO_BUFFERS];
int num_buffers;
} so_target;
- struct pipe_resource *mapped_vs_tex[PIPE_MAX_VERTEX_SAMPLERS];
+ struct pipe_resource *mapped_vs_tex[PIPE_MAX_SAMPLERS];
unsigned num_samplers[PIPE_SHADER_TYPES];
unsigned num_sampler_views[PIPE_SHADER_TYPES];
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 61aa1925eec..5f19a4753ba 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -105,7 +105,7 @@ llvmpipe_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 samplers */
case PIPE_CAP_NPOT_TEXTURES:
return 1;
case PIPE_CAP_TWO_SIDED_STENCIL:
@@ -234,7 +234,7 @@ llvmpipe_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe
* the draw module.
*/
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/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
index 121569ede73..8e30b5c634a 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
@@ -234,11 +234,11 @@ llvmpipe_prepare_vertex_sampling(struct llvmpipe_context *lp,
uint32_t img_stride[PIPE_MAX_TEXTURE_LEVELS];
const void *data[PIPE_MAX_TEXTURE_LEVELS];
- 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) {