[Mesa-dev] [PATCH 07/14] swr: mark both frag and vert textures read, don't forget about cbs
Cherniak, Bruce
bruce.cherniak at intel.com
Tue Nov 15 01:46:09 UTC 2016
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>
> On Nov 12, 2016, at 5:00 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> src/gallium/drivers/swr/swr_state.cpp | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
> index 65327f3..526d7e7 100644
> --- a/src/gallium/drivers/swr/swr_state.cpp
> +++ b/src/gallium/drivers/swr/swr_state.cpp
> @@ -674,11 +674,21 @@ swr_update_resource_status(struct pipe_context *pipe,
> }
>
> /* texture sampler views */
> - for (uint32_t i = 0; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; i++) {
> - struct pipe_sampler_view *view =
> - ctx->sampler_views[PIPE_SHADER_FRAGMENT][i];
> - if (view)
> - swr_resource_read(view->texture);
> + for (uint32_t j : {PIPE_SHADER_VERTEX, PIPE_SHADER_FRAGMENT}) {
> + for (uint32_t i = 0; i < ctx->num_sampler_views[j]; i++) {
> + struct pipe_sampler_view *view = ctx->sampler_views[j][i];
> + if (view)
> + swr_resource_read(view->texture);
> + }
> + }
> +
> + /* constant buffers */
> + for (uint32_t j : {PIPE_SHADER_VERTEX, PIPE_SHADER_FRAGMENT}) {
> + for (uint32_t i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; i++) {
> + struct pipe_constant_buffer *cb = &ctx->constants[j][i];
> + if (cb->buffer)
> + swr_resource_read(cb->buffer);
> + }
> }
> }
>
> --
> 2.7.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list