Comments (7)
Just took a look at your additions, and they're great. 👌
I think that the dedicated queue stuff could use some changes, however. Currently it assumes anything but the first queue family is special, but the Vulkan spec makes no guarantees about the order.
What I have in mind is something like this:
// finds a queue family that has compute, but no graphics bit
// return false if there is no such queue family
param.add_dedicated_queue(VK_QUEUE_COMPUTE_BIT, 0.5f); // and [...]_queues() to create multiple queues
// finds a queue family that has transfer but no graphics or compute
param.add_dedicated_queue(VK_QUEUE_TRANSFER_BIT, 0.5f);
and probably remove the old add_dedicated_queues
. Might also be worth supporting VK_QUEUE_GRAPHICS_BIT
without compute, but that should be it. Combinations of flags for dedicated queues don't really make sense.
I don't know if sorting is still required, depending on how queues are added to params
. device::create
pushes queues to the front of the graphics/compute/transfer_queue_list
but if in the example above the two calls were switched (transfer added before compute), this would happen:
- graphics: [default]
- compute: [dedicated_compute, default]
- transfer: [dedicated_compute, dedicated_transfer, default]
Or maybe it's ok to expect the user to know that the last queue added with a specific bit will be at the front of that list 🤷
from liblava.
Re: 2. I think a sensible implementation would still expose the default queue, but maybe put any found dedicated queues at the front of the list.
E.g. requesting:
GRAPHICS | COMPUTE | TRANSFER
COMPUTE
TRANSFER
becomes:
- graphics_queues: [1]
- compute_queues: [2, 1]
- transfer_queues: [3, 1]
from liblava.
🔨 created branch queue-creation
from liblava.
Several hardware platforms have more than one VkQueue per queue family. This can be useful by being able to submit work to the same queue family from separate queues. While there can be advantages, it isn't necessarily better to create or use the extra queues. For specific performance recommendations, refer to hardware vendors' best practices guides.
Does anyone have experience or information about the hardware vendors' best practices guides (links?)
I like the suggestion in 1. (first post) - should be easy doable.
And for 2. I would like to change the default behavior so that it runs like the proposal.
from liblava.
Here are some examples how to use add_queues
app.manager.on_create_param = [](device::create_param& param) {
param.set_default_queues(); // (1)
param.set_all_queues(); // (2)
param.add_dedicated_queues(0.5f); // (3)
param.add_queues(VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT, 2); // (4)
param.add_queue(VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT); // (5)
param.add_queue(VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT); // (6)
param.add_queues(VK_QUEUE_COMPUTE_BIT, 2); // (7)
param.add_queue(VK_QUEUE_COMPUTE_BIT); // (8)
param.add_queue(VK_QUEUE_TRANSFER_BIT); // (9)
};
- This is the default handling, even if you do not specify
param
- Shows how to set all queues,
param
can still be adjusted afterwards - And this will add all dedicated queues (priority: 0.5), if any are available, else will return
false
- Shows how to add a specific combination of 2 queues (same queue family)
- But if 4. fails because you don't get it from one queue family, you can still call...
- ... it twice and hopefully get it from different queue families
- Just a simple example how to request 2 dedicated queues using one flag
- Well, now back to your last post: If you just set this line and...
- ... that of course, it will add the 2 dedicated queues to the front of the list 🤠
Added some tests in lava-unit, check tests/unit.cpp
from liblava.
Awesome, thanks for putting in the time to work on this 🙏
I'm busy with something else currently, but I'll check this out and report back over the weekend.
from liblava.
You're welcome! No hurry, if something stands out when testing, just let me know.
from liblava.
Related Issues (20)
- Please support MSYS2 MINGW64 HOT 10
- Independent Project Build Fails - freetype not found HOT 2
- Install Instructions are Incorrect HOT 1
- Optional Dependencies HOT 2
- FBX Loading HOT 4
- HLSL Examples HOT 1
- RAII Abstractions HOT 1
- Latest release can not be built from Release downloads HOT 1
- Single validation error, not critical Linux Nvidia HOT 1
- Outputting fps to a text file? HOT 10
- PresentMon-like frametime logging HOT 2
- Request for compute example HOT 1
- Request for imgui docking HOT 2
- Does cmake ver need to be that high? Raspberry OS on 3.18 HOT 5
- How do I set up a cmake project? HOT 3
- Why can't I see Shader edits reflected in the program? HOT 2
- Add support to supply semaphores to renderer HOT 1
- Unable to take screenshots (how to best extend create methods) HOT 2
- Resize causes crash on Linux (tested with AMD gpu)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liblava.