shader-storage-buffer

How do I query the alignment/stride for an SSBO struct?

 ̄綄美尐妖づ 提交于 2019-12-23 18:48:04
问题 I'm not sure which structure layout is most suited for my application: shared , packed , std140 , std430 . I'm not asking for an explanation of each, that information is easy to find, it's just hard to figure out the impact each will have on vendor compatibility/performance. If shared is the default, I'm suspecting that's a good starting point. From what I can gather, I have to query the alignment/offsets when using shared or packed , because it's implementation specific. What's the API for

Vulkan Buffer WorkGroupID not returning actual value when large number of elements

老子叫甜甜 提交于 2019-12-12 00:59:39
问题 Creating a buffer with pow(2, 24) and a local_size_x = 64 for the layout input qualifier will return WorkGroupID = 262143 which is all fine due to pow(2,24) / 64 - 1 , it is zero indexed. However if we increase the global dimension / no elements / size of the problem to pow(2, 25) lets say WorkGroupID will return values without a reason, they do not match the math. Here are some limits that the device got that I think matter: maxStorageBufferRange: uint32_t = 4294967295