glsl - Is the size of each element of this array 16 bytes or 4 bytes? - Stack Overflow

I know that in GLSL by default struct use std140 layout, and that means, let's say you have an arr

I know that in GLSL by default struct use std140 layout, and that means, let's say you have an array of int bound to a buffer, the std140 will pad out that int to 16 bytes, so each element is 16 bytes. And you can use std430 to relax that and get each int in an int array take 4 bytes. But in the following I'm having trouble accessing the element:

layout (std430, set = 0, binding = 4) readonly buffer GlobalBufferArray
{
    uint skybox_tile_array[];
}global_buffer_arrays[];

Is each uint element in skybox_tile_array 4 bytes? If not how can I make it so?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744849888a4597064.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信