summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe/sp_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_context.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/gallium/drivers/softpipe/sp_context.c b/src/gallium/drivers/softpipe/sp_context.c
index 3d8a69a60ad..e2e32b9bd8c 100644
--- a/src/gallium/drivers/softpipe/sp_context.c
+++ b/src/gallium/drivers/softpipe/sp_context.c
@@ -122,21 +122,6 @@ softpipe_destroy( struct pipe_context *pipe )
sp_destroy_tile_cache(softpipe->zsbuf_cache);
pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
- for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
- sp_destroy_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_FRAGMENT][i]);
- pipe_sampler_view_reference(&softpipe->fragment_sampler_views[i], NULL);
- }
-
- for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
- sp_destroy_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_VERTEX][i]);
- pipe_sampler_view_reference(&softpipe->vertex_sampler_views[i], NULL);
- }
-
- for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
- sp_destroy_tex_tile_cache(softpipe->tex_cache[PIPE_SHADER_GEOMETRY][i]);
- pipe_sampler_view_reference(&softpipe->geometry_sampler_views[i], NULL);
- }
-
for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
for (i = 0; i < Elements(softpipe->tex_cache[0]); i++) {
sp_destroy_tex_tile_cache(softpipe->tex_cache[sh][i]);
@@ -231,6 +216,10 @@ 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 );
@@ -303,13 +292,13 @@ softpipe_create_context( struct pipe_screen *screen,
PIPE_SHADER_VERTEX,
PIPE_MAX_VERTEX_SAMPLERS,
(struct tgsi_sampler **)
- softpipe->tgsi.vert_samplers_list);
+ softpipe->tgsi.samplers_list[PIPE_SHADER_VERTEX]);
draw_texture_samplers(softpipe->draw,
PIPE_SHADER_GEOMETRY,
PIPE_MAX_GEOMETRY_SAMPLERS,
(struct tgsi_sampler **)
- softpipe->tgsi.geom_samplers_list);
+ softpipe->tgsi.samplers_list[PIPE_SHADER_GEOMETRY]);
if (debug_get_bool_option( "SOFTPIPE_NO_RAST", FALSE ))
softpipe->no_rast = TRUE;