KhronosGroup / Vulkan-Docs

The Vulkan API Specification and related tools
Other
2.81k stars 469 forks source link

maxStorageBufferRange limited to 4 GB #1016

Open Snektron opened 5 years ago

Snektron commented 5 years ago

Hello,

Plenty of current GPUs have memories exceeding 4 GB, however, in the vulkan specification the maximum size of a shader storage buffer that can be bound to a descriptor is limited to 4 GB because its stored in a uint32_t. Is there a reason for this limitation or is this simply an oversight? Or am i doing something wrong by trying to update a descriptor set with a range bigger than 4 GB?

jeffbolznv commented 5 years ago

IMO this is a mistake and it should have been a VkDeviceSize, but even if it were it's likely that many implementations would still advertise 4GB-1 because it either matches HW limitations or simplifies/cheapens the implementation. In discussion, the group didn't consider this high priority.

As a workaround, you could use buffer_device_address which doesn't use bindings or have this bounds-checking. I think this is what many people consider the more future looking direction.

krOoze commented 5 years ago

@jeffbolznv Wouldn't it also be a problem in GLSL, where .length() returns an int?

jeffbolznv commented 5 years ago

Yeah, that seems like it would be an issue, too.