Mesa (master): st/mesa: don't use cso_context to restore VBs, etc. for PBO glReadPixels
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jan 15 10:07:39 UTC 2021
Module: Mesa
Branch: master
Commit: 7c7a6e05f4c58c7219132a999470fba7c0e3b82b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7c7a6e05f4c58c7219132a999470fba7c0e3b82b
Author: Marek Olšák <marek.olsak at amd.com>
Date: Sun Dec 20 02:52:52 2020 -0500
st/mesa: don't use cso_context to restore VBs, etc. for PBO glReadPixels
These cso_context capabilities will be removed.
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Zoltán Böszörményi <zboszor at gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8180>
---
src/mesa/state_tracker/st_cb_readpixels.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 65cf3b0c7a4..0db77cf497b 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -137,12 +137,9 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
if (!st_pbo_addresses_pixelstore(st, GL_TEXTURE_2D, false, pack, pixels, &addr))
return false;
- cso_save_state(cso, (CSO_BIT_FRAGMENT_SAMPLER_VIEWS |
- CSO_BIT_FRAGMENT_SAMPLERS |
- CSO_BIT_FRAGMENT_IMAGE0 |
+ cso_save_state(cso, (CSO_BIT_FRAGMENT_SAMPLERS |
CSO_BIT_BLEND |
CSO_BIT_VERTEX_ELEMENTS |
- CSO_BIT_AUX_VERTEX_BUFFER_SLOT |
CSO_BIT_FRAMEBUFFER |
CSO_BIT_VIEWPORT |
CSO_BIT_RASTERIZER |
@@ -153,7 +150,6 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
CSO_BIT_MIN_SAMPLES |
CSO_BIT_RENDER_CONDITION |
CSO_BITS_ALL_SHADERS));
- cso_save_constant_buffer_slot0(cso, PIPE_SHADER_FRAGMENT);
cso_set_sample_mask(cso, ~0);
cso_set_min_samples(cso, 1);
@@ -193,7 +189,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
if (sampler_view == NULL)
goto fail;
- cso_set_sampler_views(cso, PIPE_SHADER_FRAGMENT, 1, &sampler_view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_view);
pipe_sampler_view_reference(&sampler_view, NULL);
@@ -213,7 +209,7 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
image.u.buf.size = (addr.last_element - addr.first_element + 1) *
addr.bytes_per_pixel;
- cso_set_shader_images(cso, PIPE_SHADER_FRAGMENT, 0, 1, &image);
+ pipe->set_shader_images(pipe, PIPE_SHADER_FRAGMENT, 0, 1, &image);
}
/* Set up no-attachment framebuffer */
@@ -256,7 +252,11 @@ try_pbo_readpixels(struct st_context *st, struct st_renderbuffer *strb,
fail:
cso_restore_state(cso);
- cso_restore_constant_buffer_slot0(cso, PIPE_SHADER_FRAGMENT);
+
+ st->dirty |= ST_NEW_FS_CONSTANTS |
+ ST_NEW_FS_IMAGES |
+ ST_NEW_FS_SAMPLER_VIEWS |
+ ST_NEW_VERTEX_ARRAYS;
return success;
}
More information about the mesa-commit
mailing list