Writing to an Image
with format = r32f
: f32
does not implement Vector<f32, 1>
#412
Unanswered
Algorhythm-sxv
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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::read
happily returns a singlef32
, butImage::write
won't accept a singlef32
since it's expecting a type that implements the spirvVector
trait, and there is no implementation ofVector<f32, 1>
forf32
. Passing in aVec2
gets 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
?f32
s 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