Passing RGBA32F texture to a shader as R32F for imageAtomic operations and accessing components

StackOverflow https://stackoverflow.com/questions/14614339

  •  06-03-2022
  •  | 
  •  

Question

Is it possible to pass a 3D RGBA32F texture to shader as a type that is compatible with the imageAtomic operations (i.e. R32F), and then modifying somehow the ivec3 index such that the appropriate components of the RGBA32F texture are accessed deterministically?

I know this is possible with buffer's where the indexing is much more straight forward, but the ivec3 would seem to prevent clever index manipulation.

Was it helpful?

Solution

First, R32F is not compatible with atomic image operations. Only integer formats are. Unless you're using an NVIDIA extension.

Second, the image format compatibility rules do not allow you to pretend that an RGBA32F texture is an R32UI texture. They work based on compatible texel sizes, and RGBA32F is 128-bits in size, while R32UI is 32-bits.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top