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

The VkColorCube app doesn't log failure status #77

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jcortell68
Copy link
Contributor

The failure status code being returned via the GPA calls aren't being logged by the VkColorCube app. It does log that what it's trying to do failed, but not why it failed (according to the GPA implementation). In my case a C++ exception was being thrown and that fact was just not surfaced at all.

Also changed the textual string for kGpaStatusErrorException to mention it's specifically a C++ exception, as otherwise the word "exception" is generic/vague and could be interepreted as such.

The failure status code being returned via the GPA calls
aren't being logged by the VkColorCube app. It does log that
what it's trying to do failed, but not why it failed (according
to the GPA implementation). In my case a C++ exception was
being thrown and that fact was just not surfaced at all.

Also changed the textual string for kGpaStatusErrorException
to mention it's specifically a C++ exception, as otherwise
the word "exception" is generic/vague and could be interepreted
as such.
Copy link
Contributor

@PLohrmannAMD PLohrmannAMD left a comment

Choose a reason for hiding this comment

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

I do agree that the actual error status code should be propagated up, but there are other changes here that should not be included.

GPA_LOG_ERROR("Parameter %s is %d but must be less than %d.", #index, index, num_counters); \
GPA_LOG_ERROR("Parameter index is %d but must be less than %d.", index, num_counters); \
Copy link
Contributor

Choose a reason for hiding this comment

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

This inside a macro, so the text "index" could change depending on what is passed into the macro; therefore the original version of this code should stay.

Comment on lines 496 to 504
case GDT_HW_GENERATION_GFX104:
*hardware_generation = kGpaHwGenerationGfx104;
break;
case GDT_HW_GENERATION_GFX401:
*hardware_generation = kGpaHwGenerationGfx401;
break;
case GDT_HW_GENERATION_GFX402:
*hardware_generation = kGpaHwGenerationGfx402;
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not AMD HW generations.

Comment on lines 859 to 860
GPA_LOG_ERROR("jjjjjjjjjjjjj GpaBeginSession");

Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming this is debugging code, please remove.

Comment on lines 145 to 151
/// Note that GPA sample IDs are client defined. However, the Vulkan GPA
/// extension assigns an ID to each sample (they are not client defined).
/// The GPA library manages the mapping between them. These are the former.
static constexpr GpaUInt32 kGpaSampleIdCube = 0;
static constexpr GpaUInt32 kGpaSampleIdWireframe = 1;
static constexpr GpaUInt32 kGpaSampleIdCubeAndWireframe = 2;

Copy link
Contributor

Choose a reason for hiding this comment

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

Why are these being removed?

To clarify - these should be defined by the user / application. They do not need to be 0, 1, 2, but could be 4, 5, 12 (or even assigned based on the pointer to the unique object being drawn and profiled). As long as they are unique, the actual value does not matter. We prefer to keep these as user-defined variables for clarity and to show their connection between different GPA calls rather than have them as "magic numbers" that show up throughout the code.

Comment on lines 421 to 425
if (kGpaStatusOk != status)
{
AMDVulkanDemoVkUtils::Log("ERROR: GpaGetFuncTable failed with status %d", status);
delete gpa_function_table;
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this gpa_function_table is supposed to be deleted? It gets allocated earlier in this function, so it should probably be deleted here to avoid the small memory leak.

@jcortell68
Copy link
Contributor Author

I do agree that the actual error status code should be propagated up, but there are other changes here that should not be included.

Sorry Peter. I copied the files from my internal GPA repo to the external/github one and some unrelated, earlier internal changes bled in. I shold have checked the changed before doing the pull request. Cleaning up now...

@jcortell68
Copy link
Contributor Author

Mess fixed up. Again, sorry about that.

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

Successfully merging this pull request may close these issues.

2 participants