diff options
author | Roland Scheidegger <[email protected]> | 2018-02-28 03:01:23 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2018-02-28 18:22:28 +0100 |
commit | b923f21eaadb77ee70e1bf4c5e2f9aee2a5fa205 (patch) | |
tree | 612eb15fedd3db3ad9924ed72f496420d2972bb5 /src/gallium | |
parent | 89ae5def8cea9311727ac80d7274f80650279373 (diff) |
cso: don't cycle through PIPE_MAX_SHADER_SAMPLER_VIEWS on context destroy
There's no point, we know the highest non-null one.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 1b5d4b55987..3fa57f16ff4 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -407,8 +407,10 @@ void cso_destroy_context( struct cso_context *ctx ) ctx->pipe->set_stream_output_targets(ctx->pipe, 0, NULL, NULL); } - for (i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) { + for (i = 0; i < ctx->nr_fragment_views; i++) { pipe_sampler_view_reference(&ctx->fragment_views[i], NULL); + } + for (i = 0; i < ctx->nr_fragment_views_saved; i++) { pipe_sampler_view_reference(&ctx->fragment_views_saved[i], NULL); } |