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

Adding the capture options to annotation for display with info tool #1265

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

naomipappe
Copy link
Contributor

Several options are recommended when dealing with visual corruption on traces. It would be good to know, which non-default options were used when capturing a trace.

This change captures this information into the operation annotation, if non-default parameters were used, and can be viewed with gfxrecon-info tool.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 46068.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3219 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3219 failed.

@naomipappe naomipappe marked this pull request as draft September 20, 2023 09:41
@naomipappe
Copy link
Contributor Author

This change relies on #1155 to be merged first.

@bradgrantham-lunarg bradgrantham-lunarg added the P2 A high-priority code maintenance issue or a functional problem that is recoverable or not a crash. label Oct 30, 2023
Several options are recommended when dealing with visual corruption on traces. It would be good to know, which options were used when capturing a trace. This change captures this information, if non-default parameters were used.

Change-Id: I9c09198ed08649a037d6d789aaef93c75beb5848
@naomipappe naomipappe force-pushed the feature-capture-parameters branch from ee402d0 to 7f3ca93 Compare December 4, 2023 14:20
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 94664.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3588 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3588 failed.

@naomipappe naomipappe marked this pull request as ready for review December 4, 2023 16:33
@lunarpapillo
Copy link
Contributor

The LunarG CI failure appears to be due to an unrelated GPU crash. I've restored the machine and will restart the test.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 94959.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3589 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3589 passed.

Copy link
Contributor

@charles-lunarg charles-lunarg left a comment

Choose a reason for hiding this comment

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

Other than a weird usage of try-catch, the functionality of this PR is good.

Comment on lines 227 to 236
try
{
out = json_obj.at(key).get<std::string>();
}
catch (const nlohmann::json::type_error& te)
{
out += "\n\t" + json_obj.at(key).dump(kDefaultIndent);
out.pop_back();
out += "\t}";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The use of try-catch here feels awkward, as it should be possible to know if its a string or not ahead of time.

Should be possible to call is_string() before printing, and using the fallback if it isn't a string.

https://json.nlohmann.me/api/basic_json/is_string/

I say this because other uses of try-catch in the codebase are in main() functions, or are handling potentially invalid input (like stof), whereas here there is a way to "know" what to do without relying on an exception to do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, somehow I missed this method while I was reading the documentation. Your suggestion makes much more sense. Furthermore, thanks to your comment I revisited this piece of code, and made further adjustments.

Change-Id: I1d51d88093f4259e3d4b962e1abf0ef01802a271
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 95438.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3597 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 3597 passed.

Copy link
Contributor

@charles-lunarg charles-lunarg left a comment

Choose a reason for hiding this comment

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

Muuuch nicer to read and understand.

@bradgrantham-lunarg
Copy link
Contributor

I think it's probably best to remove any functionality from this PR that depends on #1155 and submit those dependencies as a separate PR - it sounds like @charles-lunarg has approved this and this can go in quickly.

@naomipappe
Copy link
Contributor Author

The dependency that it had on #1155 was the display of the fence delay option that PR added. I have removed that when I updated the PR recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A high-priority code maintenance issue or a functional problem that is recoverable or not a crash.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants