Questions tagged «uniform-buffer-object»

1
制服的排列和申报顺序重要吗?
在部分6.4恒定的缓冲器本书的实用渲染和计算用的Direct3D 11(325页,326)中提到: 默认情况下,HLSL编译器将尝试对齐常量,以使它们不跨越多个float4寄存器。[...] HLSL常量缓冲区的打包也可以通过packoffset关键字手动指定。 我假设类似的规则将适用于OpenGL等效的统一缓冲区对象,因为它们映射到相同的硬件功能。 香草制服呢?宣布制服时适用哪些规则? uniform vec2 xy; // Can we expect the compiler to pack xy uniform vec2 zw; // into a same four component register? uniform vec2 rg; uniform float foo; // Will this prevent from packing rg and ba? uniform vec2 ba; // If so, will …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.