-
Notifications
You must be signed in to change notification settings - Fork 235
Draft: Initial debug utils naming implementation #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Had a quick look through and first reaction is jikes that intrusive. Second reaction is, would vsg::GpuAnnoation not be useful and be something would at least interact with any additional features related to shader debug utils. |
I needed to label the objects I've labelled to fix the problem I was working on. When Vulkan objects are created, it's similarly invasive to the use of As for generating names, in the OSG, the objects a programmer would interact with and be able to assign names to were typically 1:1 with OpenGL objects, at least within the same context, so a name could be set and directly used. Here, though, a lot of Vulkan objects of different types, with several instances of each type, end up being created behind the scenes for one thing the programmer explicitly sets up, so names need transferring to the implicitly-generated objects, and annotating with extra information to identify different variants. It could be made less visibly bulky by adding I'm aware that something being intrusive in the OSG isn't a good justification for it to be intrusive here, hence lots of things being pared back, but give Vulkan objects a name when they're created means they need to have a name and it needs assigning when they're created, so something's got to give them a name and the functions that creates them needs to assign it. In a world where RenderDoc considers supporting applications that emit validation errors out of scope, there's no better way to know what an object is than by giving it a meaningful name. Obviously, it's a lot harder to identify what's broken with a message like
than it is with
Whether or not this, or something derived from it, ends up merged, I'm going to keep using it in situations where it'll tell me things I need to know, but it'll be a lot less hassle if it's just a window traits option or CMake flag than if I have to reapply this patch and resolve any conflicts that appeared since the last time I used it. |
I have just done another code review. I'm currently pondering about adding name fields to ShaderModel/ShaderSet/PipelineLayout, which can be used for general developer housekeeping as well provide an input for debug utils is enabled. I will let this topic sit for a little longer to see how I feel given more time. I have plenty of other pressing work to get on with so tackle these and come back to this one. I think it's worthwhile coming up with some form of solution so don't think a temporary is required. |
I think it's likely that at some point an application will have a bug that warrants labelling something else, especially vertex buffers or textures with the file they were loaded from (or even the node for formats like glTF that let things have names), and maybe render passes. Some of that can already be done with As anything in |
Good point about making the functionality as general purpose as we can, potentially we might be able to simply the changes/usage in the process. Looking at the docs: We'd need the vkObjectType as well objectHandle from the VSG/Vulkan integration and the name to associate the Vulkan object. Perhaps GpuAnnotation could have a feature to traverse a subgraph and find the Vulkan objects, their type and then set up names for them, such as getting a user value. This way the functionality wouldn't need to be intrusive to the wider VSG codebase, and only applied when users need to annotate for the purposes of using API output/RenderDoc. |
Possibly. The concerns I'd have with that kind of approach are:
|
Adds names to some objects (pipelines, shader stages, and pipeline layouts so far) via
VK_EXT_debug_utils
. This means that in tools like RenderDoc, they get names instead of numbers, and in the logs from validation errors or the API dump layer, they get names instead of pointers, making it possible to have some idea of what was being drawn without needing RenderDoc.It's a draft because the performance impact even when it's off isn't zero. I'm not sure anything can be done about that other than gating it off behind a
#define
, and therefore a CMake option. Even having names in the scenegraph without telling Vulkan about them isn't free as it means avsg::Auxiliary
needs to exist for the object, meaning extra memory usage (althoughvsg::Auxiliary
uses the system allocator, so hopefully won't end up wasting space in hot cache lines).For now, it's still potentially useful to temporarily merge this branch while investigating a problem and then discard the changes once it's been solved, but I hope we can come up with something more maintainable.
The built-in shader sets are altered because they've been given names. A counterpart PR to vsgExamples will be opened shortly.