gallium: Permit surface_copy and surface_fill to be NULL.
[mesa.git] / src / gallium / include / pipe / p_inlines.h
index 30a4aaf4093921c2f694712118d9fba492012dde..5fbd62a03d2bba16e3f9bda3d8cbb6ede5edb222 100644 (file)
@@ -176,6 +176,22 @@ pipe_transfer_destroy( struct pipe_transfer *transf )
    screen->tex_transfer_destroy(transf);
 }
 
+static INLINE unsigned
+pipe_transfer_buffer_flags( struct pipe_transfer *transf )
+{
+   switch (transf->usage & PIPE_TRANSFER_READ_WRITE) {
+   case PIPE_TRANSFER_READ_WRITE:
+      return PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE;
+   case PIPE_TRANSFER_READ:
+      return PIPE_BUFFER_USAGE_CPU_READ;
+   case PIPE_TRANSFER_WRITE:
+      return PIPE_BUFFER_USAGE_CPU_WRITE;
+   default:
+      debug_assert(0);
+      return 0;
+   }
+}
+
 #ifdef __cplusplus
 }
 #endif