diff options
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_surface.c | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index b3b2728305d..78fb558f408 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -229,6 +229,8 @@ struct pipe_context *svga_context_create(struct pipe_screen *screen, memset(svga->state.hw_draw.sampler_views, 0, sizeof(svga->state.hw_draw.sampler_views)); svga->state.hw_draw.num_views = 0; + svga->state.hw_draw.num_rendertargets = 0; + svga->state.hw_draw.dsv = NULL; /* Initialize the shader pointers */ svga->state.hw_draw.vs = NULL; diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 75e76fb297e..f6a791332c9 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -664,17 +664,21 @@ svga_propagate_surface(struct svga_context *svga, struct pipe_surface *surf) void svga_propagate_rendertargets(struct svga_context *svga) { - const unsigned num_cbufs = svga_screen(svga->pipe.screen)->max_color_buffers; unsigned i; - for (i = 0; i < num_cbufs; i++) { - if (svga->curr.framebuffer.cbufs[i]) { - svga_propagate_surface(svga, svga->curr.framebuffer.cbufs[i]); + /* Note that we examine the svga->state.hw_draw.framebuffer surfaces, + * not the svga->curr.framebuffer surfaces, because it's the former + * surfaces which may be backing surface views (the actual render targets). + */ + for (i = 0; i < svga->state.hw_draw.num_rendertargets; i++) { + struct pipe_surface *s = svga->state.hw_draw.rtv[i]; + if (s) { + svga_propagate_surface(svga, s); } } - if (svga->curr.framebuffer.zsbuf) { - svga_propagate_surface(svga, svga->curr.framebuffer.zsbuf); + if (svga->state.hw_draw.dsv) { + svga_propagate_surface(svga, svga->state.hw_draw.dsv); } } |