gallium/radeon: require both WRITE and FLUSH_EXPLICIT in buffer_flush_region
authorMarek Olšák <marek.olsak@amd.com>
Tue, 2 May 2017 23:23:54 +0000 (01:23 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 15 May 2017 11:01:33 +0000 (13:01 +0200)
spotted randomly.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/radeon/r600_buffer_common.c

index b2289e26f72b11080de0c2f90ee1630bd0fec1b8..6a4846add7886879f37a8d5be1403b1798d1c33e 100644 (file)
@@ -482,8 +482,10 @@ static void r600_buffer_flush_region(struct pipe_context *ctx,
                                     struct pipe_transfer *transfer,
                                     const struct pipe_box *rel_box)
 {
-       if (transfer->usage & (PIPE_TRANSFER_WRITE |
-                              PIPE_TRANSFER_FLUSH_EXPLICIT)) {
+       unsigned required_usage = PIPE_TRANSFER_WRITE |
+                                 PIPE_TRANSFER_FLUSH_EXPLICIT;
+
+       if ((transfer->usage & required_usage) == required_usage) {
                struct pipe_box box;
 
                u_box_1d(transfer->box.x + rel_box->x, rel_box->width, &box);