<div dir="auto"><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 23, 2020, 15:55 Dave Airlie <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What is your work submission model then, Vulkan is designed around<br>
having work submitted to a secondary processor from a control<br>
processor. Do you intend for the device to be used only as a<br>
coprocessor, or as a CPU for normal tasks that can then use the<br>
features in their threads, because none of the API are designed around<br>
that model. They have a running thread of execution that queues stuff<br>
up to a separate execution domain.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It's intended to be a combination, where CPU threads schedule work and render threads dequeue and run the work, probably using something like Rayon:</div><div dir="auto"><a href="https://github.com/rayon-rs/rayon">https://github.com/rayon-rs/rayon</a></div><div dir="auto"><br></div><div dir="auto">When a CPU thread waits in the Vulkan driver, it can possibly be used as a render thread instead of blocking on a futex, avoiding needing excessive numbers of Linux kernel-level threads.</div><div dir="auto"><br></div><div dir="auto">The CPU and render threads run on the same cores, as scheduled by Linux.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What represents a vulkan queue,</blockquote></div></div><div dir="auto"><br></div><div dir="auto">The rayon task queues.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> what will be recorded into vulkan<br>
command buffers,</blockquote></div></div><div dir="auto"><br></div><div dir="auto">a command sequence encoded as bytecode, a list of Rust enums, or something similar.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> what will execute those command buffers.</blockquote></div></div><div dir="auto"><br></div><div dir="auto"></div><div dir="auto">the render threads will dequeue the command buffers, run through all the commands in them, and schedule the appropriate rendering tasks to rayon's task execution mechanism.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> These are<br>
the questions you need to ask yourself and answer before writing any<br>
code.</blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yup, did that 2 years ago, though I don't remember if I explicitly wrote them down before.</div><div dir="auto"><br></div><div dir="auto">Jacob</div><div dir="auto"></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"></div></div>