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

Remove unavailable debug information for high level framework based samples #1200

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion framework/scene_graph/hpp_scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ class HPPScene : private vkb::sg::Scene
}
else
{
assert(false); // path never passed -> Please add a type-check here!
Copy link
Contributor

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));

Copy link
Collaborator Author

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 ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And yes, I did encounter it ;)

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.

Copy link
Collaborator Author

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.

return false;
}
}
Expand Down
15 changes: 0 additions & 15 deletions framework/vulkan_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Copy link
Contributor

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 code sequence?
Under what circumstances do you get a crash here?

Instead of just removing this block, it might be worth to improve checking here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because none of the requested components could be found.

And you don't expect that to ever happen?
Instead, I would prefer to have the checks extended.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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>
Expand Down
Loading