[Mesa-dev] [PATCH 2/2] gallium/noop: fix sampler views

Marek Olšák maraeo at gmail.com
Fri Jun 9 13:49:06 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/drivers/noop/noop_state.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/noop/noop_state.c b/src/gallium/drivers/noop/noop_state.c
index 46d99ab..80cfae8 100644
--- a/src/gallium/drivers/noop/noop_state.c
+++ b/src/gallium/drivers/noop/noop_state.c
@@ -69,21 +69,24 @@ static void *noop_create_sampler_state(struct pipe_context *ctx,
 }
 
 static struct pipe_sampler_view *noop_create_sampler_view(struct pipe_context *ctx,
                                                           struct pipe_resource *texture,
                                                           const struct pipe_sampler_view *state)
 {
    struct pipe_sampler_view *sampler_view = CALLOC_STRUCT(pipe_sampler_view);
 
    if (!sampler_view)
       return NULL;
+
    /* initialize base object */
+   *sampler_view = *state;
+   sampler_view->texture = NULL;
    pipe_resource_reference(&sampler_view->texture, texture);
    pipe_reference_init(&sampler_view->reference, 1);
    sampler_view->context = ctx;
    return sampler_view;
 }
 
 static struct pipe_surface *noop_create_surface(struct pipe_context *ctx,
                                                 struct pipe_resource *texture,
                                                 const struct pipe_surface *surf_tmpl)
 {
-- 
2.7.4



More information about the mesa-dev mailing list