Read/write Rgba16Float texture #7980
-
I just realized I was accidentally writing f32 (glam::Vec4) data into a Rgba16Float texture. When trying to fix it I realize I'm not exactly sure how to do this. Rust doesn't have a f16 on stable, and Is Rgba16Float intended to be mostly an internal format and there's no simple way to do this out of the box, or is there some way to do it I missed? I searched around and couldn't find any evidence of anyone else with the same issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, it is. A closer-to-relevant reference is the WGSL specification; You can use
I would say that neither of those is true (though |
Beta Was this translation helpful? Give feedback.
Yes, it is. A closer-to-relevant reference is the WGSL specification;
wgpu
is founded on the WebGPU specification and so a WebGPU citation would be ideal but they don't seem to have a mention of exactly what type is used in texture formats. In general, if something says floating-point of a particular power-of-2 size and doesn’t specify further details, they mean IEEE 754 formats.You can use
float16
orhalf
and expect to get correct results.