Skip to content
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

GPU Markers #1288

Closed
kvark opened this issue Jun 1, 2017 · 2 comments
Closed

GPU Markers #1288

kvark opened this issue Jun 1, 2017 · 2 comments

Comments

@kvark
Copy link
Member

kvark commented Jun 1, 2017

When debugging a complex graphical application, having named marker groups/events is essential. On GL, these are glPushGroupMarker and friends. Other APIs supposedly provide similar functionality, and if not - we can always just have a blanket implementation.

Rough design:

let marker = encoder.push_marker("Alpha entities");
... 
encoder.pop_marker(marker);

Here, marker is set to #[must_use] and potentially asserting/erroring in the destructor to make it pseudo-linear.

We also need to ensure the things are pushed/popped in the right order. Perhaps, something like a one-use phantom type would be sufficient? E.g.

enum MarkerAll {};
enum MarkerAlpha {};
let marker_all = encoder.push_marker::<MarkerAll>(()); // type `Marker1<MarkerAll>`;
let marker_alpha = encoder.push_marker::<MarkerAlpha>(marker_all); // type `Marker2<MarkerAlpha, MarkerAll>`;
// draw stuff here
let marker_all = encoder.pop_marker(marker_alpha);
encoder.pop_marker(marker_all);
@msiglreith
Copy link
Contributor

Other interesting concepts added by the vulkan debug extension and also supported by some OpenGL implementation, which could be taken into consideration:

  • Non-region markers / Event markers (mark a single place in the trace)
  • Object/Resource Naming and Tagging

For more details checkout this great blogpost (https://www.saschawillems.de/?page_id=2017), also showing the renderdoc support.
Related OpenGL specifications (https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt) and (https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_debug_marker.txt) (older)

@kvark
Copy link
Member Author

kvark commented Mar 22, 2020

Let's consider this fixed by #3169

@kvark kvark closed this as completed Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants