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

Conversation

SaschaWillems
Copy link
Collaborator

@SaschaWillems SaschaWillems commented Oct 20, 2024

Description

The high level framework based samples have a kinda hidden debug overlay activated with right click (on desktop). It shows some general debug information. This was broken (not sure when that did happen) and would crash every time you tried to toggle that debug overlay. This was caused by the scene graph not finding some components and also not checking if those are present. While fixing this, I noticed that those components weren't available in any of those samples so I simply removed the block. Also removed a wrong assert in the has_component check.

We may want to start thinking on how to simplify the high level framework. Debugging and fixing anything in that framework is tedious.

Fixes #1176

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

If this PR contains framework changes:

  • I did a full batch run using the batch command line argument to make sure all samples still work properly

Wasn't important anyway and kinda hidden
Remove assert from has_component
@SaschaWillems SaschaWillems added the framework This is relevant to the framework label Oct 20, 2024
@@ -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.

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.

@SaschaWillems SaschaWillems changed the title Remove unavailable debug information for ARM based samples Remove unavailable debug information for high level framework based samples Oct 21, 2024
@SaschaWillems
Copy link
Collaborator Author

@asuessenbach: As discussed during the call, this only happens with sample using the high level framework (based on the scenegraph). Those are most of the samples in the performance folder, eg. afbc, command_buffer_usage, msaa, subpasses. A simply right click in those causes an exception.

@SaschaWillems
Copy link
Collaborator Author

No longer necessary with #1203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
framework This is relevant to the framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed assert and crash when clicking two mouse button same time when using free camera
3 participants