summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/svga/svga_resource_buffer_upload.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c
index 104cb6dbd2c..9daae9c0f44 100644
--- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c
+++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c
@@ -1003,9 +1003,14 @@ svga_buffer_handle(struct svga_context *svga, struct pipe_resource *buf,
return NULL;
}
} else {
- if (!sbuf->bind_flags) {
+ /* If there is no resource handle yet, then combine the buffer bind
+ * flags and the tobind_flags if they are compatible.
+ * If not, just use the tobind_flags for creating the resource handle.
+ */
+ if (compatible_bind_flags(sbuf->bind_flags, tobind_flags))
+ sbuf->bind_flags = sbuf->bind_flags | tobind_flags;
+ else
sbuf->bind_flags = tobind_flags;
- }
assert((sbuf->bind_flags & tobind_flags) == tobind_flags);