我知道如果设置格式限定符 rgba32f
,当调用 imageLoad()
时,我得到一个 vec4。如果我设置格式限定符 r16ui
,我会得到什么? Wiki 指定该函数仍然返回一个四分量值,该值的每个分量究竟是什么?
最佳答案
对于其他三个组件,您将获得 0,0,1。
这是规范所说的:
Texture Image Loads and Stores
... Loads always return a value as a
vec4
,ivec4
, oruvec4
, ... Data are converted to/from the specified format according to the process described for a TexImage2D or GetTexImage command ... Unused components are filled in with (0,0,0,1) (where 0 and 1 are either floating-point or integer values, depending on the format).
关于opengl - 如果 GLSL 中的格式限定符是 r32f,imageLoad() 函数将返回什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67249129/