-
Notifications
You must be signed in to change notification settings - Fork 344
Description
In #955 (scenario 5), it was recorded that we decided not to generate validation errors when draw calls go out of bounds on indirect buffers.
However, in #980 we (accidentally, I think) ended up speccing that it does. Editors should revisit to resolve this.
As an analogy to index-buffer-OOB behavior, it makes sense that no validation error would be raised here:
drawIndexedcould produce a validation error on index-buffer-OOB, but would be inconsistent withdrawIndexedIndirect. Consistency also allows implementations to upgradedrawIndexedtodrawIndexedIndirectif they want to.drawIndirect/drawIndexedIndirectcould produce a validation error on indirect-buffer-OOB, but would (probably) be inconsistent withdrawIndirectCount/drawIndexedIndirectCount(which we don't have, but exist in Vulkan). Consistency also allows implementations to upgrade to thedrawIndirectCountversions.
Note, looking into vkCmdDrawIndirectCount/vkCmdDrawIndexedIndirectCount, I noticed that Vulkan's maxDrawCount behavior is (somewhat peculiarly) actually safe, which would make it possible to check for indirect-buffer-OOB at validation time even for these calls. However, I don't know if this extends to Metal indirect command buffers, for example.
maxDrawCountspecifies the maximum number of draws that will be executed. The actual number of executed draw calls is the minimum of the count specified incountBufferandmaxDrawCount.
Note there is no equivalent dispatchIndirectCount. (I guess you would need indirect command buffers (VK_NV_device_generated_commands?) to achieve that.)