Skip to content

Commit a02da27

Browse files
committed
Don't cache buffer data if BufferUsage.COPY_SRC is set (implies it's overwritten on the gpu)
1 parent 07f259b commit a02da27

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

webgpu/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def buffer_from_array(
529529
n = len(data)
530530

531531
if n < 1024:
532-
if reuse and hasattr(reuse, '_data') and data == reuse._data:
532+
if reuse and hasattr(reuse, '_data') and data == reuse._data and not (reuse.usage & BufferUsage.COPY_SRC):
533533
return reuse
534534
ori_data = data
535535

0 commit comments

Comments
 (0)