summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga/svga_pipe_blit.c
diff options
context:
space:
mode:
authorCharmaine Lee <charmainel@vmware.com>2017-12-18 09:41:54 -0800
committerBrian Paul <brianp@vmware.com>2018-09-10 13:07:30 -0600
commitcb70474b2006dd30d755a7177fd60fb582da849b (patch)
tree507c557c93eae9885fa491ff19659884c84fc603 /src/gallium/drivers/svga/svga_pipe_blit.c
parentc6103328ab9a985b637b940d6d6a49de961b7c9f (diff)
svga: fix resource checking in is_blending_enabled()
This patch makes sure a valid color buffer is bound before checking its resource. This fixes Unigine Valley running in SM41 device. Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_blit.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_blit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c
index 57df5f4c489..ab612416c28 100644
--- a/src/gallium/drivers/svga/svga_pipe_blit.c
+++ b/src/gallium/drivers/svga/svga_pipe_blit.c
@@ -234,7 +234,8 @@ is_blending_enabled(struct svga_context *svga,
if (svga->curr.blend) {
if (svga->curr.blend->independent_blend_enable) {
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
- if (svga->curr.framebuffer.cbufs[i]->texture == blit->dst.resource) {
+ struct pipe_surface *cbuf = svga->curr.framebuffer.cbufs[i];
+ if (cbuf && (cbuf->texture == blit->dst.resource)) {
if (svga->curr.blend->rt[i].blend_enable) {
blend_enable = true;
}