Repository navigation
Add indirect draw / dispatch - #317
Conversation
kainino0x
left a comment
There was a problem hiding this comment.
LGTM!
FYI to other reviewers: we'll send more details soon on the validation technique and the thing we mentioned at the end of the last meeting (no-opping invalid draw calls).
Kangz
left a comment
There was a problem hiding this comment.
This is missing the addition of an INDIRECT buffer usage I think.
|
Do we have an option of clamping the number of vertices/indices instead of discarding the whole draw call? |
|
@kvark Possibly, but we're not sure how that would work. Let's discuss further once Idan opens an issue about the topic. |
kvark
left a comment
There was a problem hiding this comment.
need to document the alignment of the offset somewhere
|
Discussed at 25 Jun 2019 teleconference |
|
Discussed today. Resolution: Restrict base instance to always be zero (necessary on some Vulkan) for now; then merge. MTLGPUFamilyMac1 does not support indirect draw at all; @litherum will check what devices that includes and we can decide whether it's necessary to move these into an extension. |
|
Merging per the discussion in the meeting. |
|
I checked and we have no objections based on device compatibility. |
|
Looking back at the feature set tables, I may have misread during the meeting (or maybe the PDF changed?): Indirect draw/dispatch is supported on MTLGPUFamilyMac1. I looked back at an old copy of the feature set tables I still have downloaded from pre-3.0, and it provides more details (unless it's wrong): Only macOS_GPUFamily1_v1 does not support indirect draw/dispatch. If I'm reading the table correctly, that means all hardware supports it, but that macOS 10.11 does not. So it looks like requiring this means we can't support macOS 10.11. (@Kangz, WDYT of that restriction?) |
|
That's probably ok, but we should check our telemetry data to make sure (I tried but failed to use the site) |
|
We still have a surprising number of users on 10.11, but it is end-of-lifed, and I strongly suspect that most of those users have hardware that doesn't support Metal at all. Seems OK. |
Following the investigation at issue #31, we were able to implement indirect draws in dawn. D3D12 / Vulkan / Metal / OpenGL all use the same format for the indirect commands in memory. The only issue we ran into is in OpenGL index buffers can't be bound with an offset (leading to the offset being ignored in indirect indexed draws). However, this was fixable with a compute pass. We are considering implementing validation using compute shaders for indirect calls, and converting normal calls to indirect ones in order to reuse logic and avoid CPU round trips.
Preview | Diff