Writing to an Image with format = r32f: f32 does not implement Vector<f32, 1>
#412
Replies: 1 comment
-
|
(Sorry we all missed your question) You are using it correctly, this is a bug on our side, the function declaration should accept f32 values. I've made a PR #474 to fix this issue. Workaround1: Workaround2: I also have a project that writes to storage images from compute shaders, but I'm using |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to port a 2D FVM simulation into Rust-GPU and using
type Tex = Image!(2D, format = r32f, sampled = false);to store 2D arrays off32.Image::readhappily returns a singlef32, butImage::writewon't accept a singlef32since it's expecting a type that implements the spirvVectortrait, and there is no implementation ofVector<f32, 1>forf32. Passing in aVec2gets rid of the compiler error, as well as creating aVec1(f32)newtype and implementing the traits for it (curse you orphan rule!), but these feel like workarounds that shouldn't be necessary. I haven't gotten the shader to a runnable state yet to test.Image?f32s into a monochrome image? Or is a workaround like this necessary for now given the missing implementation ofVector?Beta Was this translation helpful? Give feedback.
All reactions