Skip to content

Commit 97a274d

Browse files
Safeness bug in StorageImage2d::write
It's pretty easy to see why this is unsafe, if multiple threads write to the same coordinate race-conditions happen. Ultimately this should be addressed through something like #216 and some higher level abstractions on top of our buffer types, but since we don't have those for now, marking this as unsafe seems to be the only thing we can do for now.
1 parent 98fb0e0 commit 97a274d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/spirv-std/src/textures.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl StorageImage2d {
8989

9090
/// Write a texel to an image without a sampler.
9191
#[spirv_std_macros::gpu_only]
92-
pub fn write<I, V, V2, const N: usize>(&self, coordinate: V, texels: V2)
92+
pub unsafe fn write<I, V, V2, const N: usize>(&self, coordinate: V, texels: V2)
9393
where
9494
I: Integer,
9595
V: Vector<I, N>,

0 commit comments

Comments
 (0)