-
Notifications
You must be signed in to change notification settings - Fork 47
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
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 |
---|---|---|
|
@@ -142,13 +142,6 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp | |
/// Default window height. | ||
const uint32_t kDefaultWindowHeight = 300; | ||
|
||
/// 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; | ||
|
||
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. 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. |
||
#ifdef ANDROID | ||
inline void SetWindow(ANativeWindow* native_window) | ||
{ | ||
|
@@ -249,7 +242,7 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp | |
|
||
/// Sample Id that the application (not GPA) assigns to the cube. | ||
/// The cube will have this same sample_id in all passes. | ||
const GpaUInt32 gpa_sample_id = kGpaSampleIdCube; | ||
const GpaUInt32 gpa_sample_id = 0; | ||
} cube_; | ||
|
||
/// @brief Container for objects related to drawing the wireframe. | ||
|
@@ -263,7 +256,7 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp | |
|
||
/// Sample Id that the application (not GPA) assigns to the wireframe. | ||
/// The wireframe will have this same sample_id in all passes. | ||
const GpaUInt32 gpa_sample_id = kGpaSampleIdWireframe; | ||
const GpaUInt32 gpa_sample_id = 1; | ||
} wire_frame_; | ||
|
||
/// @brief Container for objects related to drawing the cube and wireframe. | ||
|
@@ -286,7 +279,7 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp | |
|
||
/// Sample Id that the application (not GPA) assigns to the cube wireframe. | ||
/// The combined cube + wireframe sample will have this same sample_id in all passes. | ||
const GpaUInt32 gpa_sample_id = kGpaSampleIdCubeAndWireframe; | ||
const GpaUInt32 gpa_sample_id = 2; | ||
} cube_and_wire_frame_; | ||
}; | ||
|
||
|
@@ -394,6 +387,12 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp | |
/// @param [in] gpa_pass_index If GPA is enabled for these command buffers, this indicates which profile pass is being built; ignored if enable_gpa is false. | ||
void PreBuildCommandBuffers(PrebuiltPerFrameResources* prebuilt_resources, VkFramebuffer frame_buffer, bool enable_gpa, uint32_t gpa_pass_index); | ||
|
||
/// @brief Log the textual representation of a failure status code | ||
/// | ||
/// @param [in] status the failure code | ||
/// @param [in] msg optional additional context. Should not contain trailing punctuation. | ||
void LogStatus(GpaStatus status, const char* msg=nullptr); | ||
|
||
/// GPA helper. | ||
GpaHelper gpu_perf_api_helper_; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ extern IGpaImplementor* gpa_imp; ///< GPA implementor instance. | |
} \ | ||
if (index >= num_counters) \ | ||
{ \ | ||
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); \ | ||
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. 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. |
||
return kGpaStatusErrorIndexOutOfRange; \ | ||
} | ||
|
||
|
@@ -493,6 +493,15 @@ GPA_LIB_DECL GpaStatus GpaGetDeviceGeneration(GpaContextId gpa_context_id, GpaHw | |
case GDT_HW_GENERATION_GFX11: | ||
*hardware_generation = kGpaHwGenerationGfx11; | ||
break; | ||
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; | ||
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. These are not AMD HW generations. |
||
case GDT_HW_GENERATION_LAST: | ||
*hardware_generation = kGpaHwGenerationLast; | ||
break; | ||
|
@@ -847,6 +856,8 @@ GPA_LIB_DECL GpaStatus GpaDeleteSession(GpaSessionId gpa_session_id) | |
|
||
GPA_LIB_DECL GpaStatus GpaBeginSession(GpaSessionId gpa_session_id) | ||
{ | ||
GPA_LOG_ERROR("jjjjjjjjjjjjj GpaBeginSession"); | ||
|
||
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. Assuming this is debugging code, please remove. |
||
try | ||
{ | ||
PROFILE_FUNCTION(GpaBeginSession); | ||
|
@@ -1657,7 +1668,7 @@ static const char* kErrorString[] = { | |
GPA_ENUM_STRING_VAL(kGpaStatusErrorTimeout, "GPA Error: Attempt to Retrieve Data Failed due to Timeout."), | ||
GPA_ENUM_STRING_VAL(kGpaStatusErrorLibAlreadyLoaded, "GPA Error: Library Is Already Loaded."), | ||
GPA_ENUM_STRING_VAL(kGpaStatusErrorOtherSessionActive, "GPA Error: Other Session Is Active."), | ||
GPA_ENUM_STRING_VAL(kGpaStatusErrorException, "GPA Error: Exception Occurred.")}; | ||
GPA_ENUM_STRING_VAL(kGpaStatusErrorException, "GPA Error: C++ Exception Occurred.")}; | ||
|
||
/// Size of kErrorString array. | ||
static size_t kErrorStringSize = sizeof(kErrorString) / sizeof(const char*); | ||
|
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.
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.