-
Notifications
You must be signed in to change notification settings - Fork 637
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
Remove unavailable debug information for high level framework based samples #1200
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1337,21 +1337,6 @@ inline void VulkanSample<bindingType>::update_debug_window() | |
to_string(render_context->get_swapchain().get_format()) + " (" + | ||
to_string(vkb::common::get_bits_per_pixel(render_context->get_swapchain().get_format())) + | ||
"bpp)"); | ||
|
||
if (scene != nullptr) | ||
{ | ||
get_debug_info().template insert<field::Static, uint32_t>("mesh_count", to_u32(scene->get_components<sg::SubMesh>().size())); | ||
get_debug_info().template insert<field::Static, uint32_t>("texture_count", to_u32(scene->get_components<sg::Texture>().size())); | ||
|
||
if (auto camera = scene->get_components<vkb::sg::Camera>()[0]) | ||
{ | ||
if (auto camera_node = camera->get_node()) | ||
{ | ||
const glm::vec3 &pos = camera_node->get_transform().get_translation(); | ||
get_debug_info().template insert<field::Vector, float>("camera_pos", pos.x, pos.y, pos.z); | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's wrong with this code sequence? Instead of just removing this block, it might be worth to improve checking here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my description of the issue as to why I removed it. tl;dr: that information was never working, in none of the samples. Adding checks before the code would simply not run the code at all, because none of the requested components could be found. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
And you don't expect that to ever happen? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I have tested with all samples and not a single one had those working. Aside, the debug information removed with this PR is pretty useless anyway. |
||
} | ||
|
||
template <vkb::BindingType bindingType> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with this
assert
? Did you encounter it?If at all, you should replace the complete function body with just
return vkb::sg::Scene::has_component(typeid(T));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assert doesn't make sense. The function is used to check if a component is present, which should return true or false and not assert.
And yes, I did encounter it ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, in that case, some code should be added to handle those cases.
Maybe I didn't phrase that detailed enough in the comment. The assertion is just there to not miss yet unhandled cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is a function that checks if the component is there. IMO it should never assert, or I might just misunderstand the statement above.