Skip to content

Commit bd9f67d

Browse files
committed
Fixed some accidental changes in previous commit
1 parent 513ef99 commit bd9f67d

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

source/examples/vulkan/vk_color_cube/vk_color_cube.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ bool AMDVulkanDemo::InitializeGpa()
421421
if (kGpaStatusOk != status)
422422
{
423423
AMDVulkanDemoVkUtils::Log("ERROR: GpaGetFuncTable failed with status %d", status);
424+
delete gpa_function_table;
424425
return false;
425426
}
426427

@@ -1814,10 +1815,9 @@ void AMDVulkanDemo::DrawScene()
18141815
// This example only renders one set of profiles (aka, only the number of passes needed to generate one set of results).
18151816
unsigned int profile_set = 0;
18161817

1817-
// NOTE: we can't loop over these because it is not guaranteed that the sample_ids will be 0-based and monotonically increasing.
1818-
gpu_perf_api_helper_.PrintGpaSampleResults(gpa_context_id_, gpa_session_id_, profile_set, 0, print_debug_output_, Verify(), ConfirmSuccess());
1819-
gpu_perf_api_helper_.PrintGpaSampleResults(gpa_context_id_, gpa_session_id_, profile_set, 1, print_debug_output_, Verify(), ConfirmSuccess());
1820-
gpu_perf_api_helper_.PrintGpaSampleResults(gpa_context_id_, gpa_session_id_, profile_set, 2, print_debug_output_, Verify(), ConfirmSuccess());
1818+
gpu_perf_api_helper_.PrintGpaSampleResults(gpa_context_id_, gpa_session_id_, profile_set, AMDVulkanDemo::kGpaSampleIdCube, print_debug_output_, Verify(), ConfirmSuccess());
1819+
gpu_perf_api_helper_.PrintGpaSampleResults(gpa_context_id_, gpa_session_id_, profile_set, AMDVulkanDemo::kGpaSampleIdWireframe, print_debug_output_, Verify(), ConfirmSuccess());
1820+
gpu_perf_api_helper_.PrintGpaSampleResults(gpa_context_id_, gpa_session_id_, profile_set, AMDVulkanDemo::kGpaSampleIdCubeAndWireframe, print_debug_output_, Verify(), ConfirmSuccess());
18211821

18221822
// Close the CSV file so that it actually gets saved out.
18231823
gpu_perf_api_helper_.CloseCSVFile();

source/examples/vulkan/vk_color_cube/vk_color_cube.h

+10-3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp
142142
/// Default window height.
143143
const uint32_t kDefaultWindowHeight = 300;
144144

145+
/// Note that GPA sample IDs are client defined. However, the Vulkan GPA
146+
/// extension assigns an ID to each sample (they are not client defined).
147+
/// The GPA library manages the mapping between them. These are the former.
148+
static constexpr GpaUInt32 kGpaSampleIdCube = 0;
149+
static constexpr GpaUInt32 kGpaSampleIdWireframe = 1;
150+
static constexpr GpaUInt32 kGpaSampleIdCubeAndWireframe = 2;
151+
145152
#ifdef ANDROID
146153
inline void SetWindow(ANativeWindow* native_window)
147154
{
@@ -242,7 +249,7 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp
242249

243250
/// Sample Id that the application (not GPA) assigns to the cube.
244251
/// The cube will have this same sample_id in all passes.
245-
const GpaUInt32 gpa_sample_id = 0;
252+
const GpaUInt32 gpa_sample_id = kGpaSampleIdCube;
246253
} cube_;
247254

248255
/// @brief Container for objects related to drawing the wireframe.
@@ -256,7 +263,7 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp
256263

257264
/// Sample Id that the application (not GPA) assigns to the wireframe.
258265
/// The wireframe will have this same sample_id in all passes.
259-
const GpaUInt32 gpa_sample_id = 1;
266+
const GpaUInt32 gpa_sample_id = kGpaSampleIdWireframe;
260267
} wire_frame_;
261268

262269
/// @brief Container for objects related to drawing the cube and wireframe.
@@ -279,7 +286,7 @@ class AMDVulkanDemo : public gpa_example::GpaSampleApp
279286

280287
/// Sample Id that the application (not GPA) assigns to the cube wireframe.
281288
/// The combined cube + wireframe sample will have this same sample_id in all passes.
282-
const GpaUInt32 gpa_sample_id = 2;
289+
const GpaUInt32 gpa_sample_id = kGpaSampleIdCubeAndWireframe;
283290
} cube_and_wire_frame_;
284291
};
285292

source/gpu_perf_api_common/gpu_perf_api.cc

+1-12
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern IGpaImplementor* gpa_imp; ///< GPA implementor instance.
4747
} \
4848
if (index >= num_counters) \
4949
{ \
50-
GPA_LOG_ERROR("Parameter index is %d but must be less than %d.", index, num_counters); \
50+
GPA_LOG_ERROR("Parameter %s is %d but must be less than %d.", #index, index, num_counters); \
5151
return kGpaStatusErrorIndexOutOfRange; \
5252
}
5353

@@ -493,15 +493,6 @@ GPA_LIB_DECL GpaStatus GpaGetDeviceGeneration(GpaContextId gpa_context_id, GpaHw
493493
case GDT_HW_GENERATION_GFX11:
494494
*hardware_generation = kGpaHwGenerationGfx11;
495495
break;
496-
case GDT_HW_GENERATION_GFX104:
497-
*hardware_generation = kGpaHwGenerationGfx104;
498-
break;
499-
case GDT_HW_GENERATION_GFX401:
500-
*hardware_generation = kGpaHwGenerationGfx401;
501-
break;
502-
case GDT_HW_GENERATION_GFX402:
503-
*hardware_generation = kGpaHwGenerationGfx402;
504-
break;
505496
case GDT_HW_GENERATION_LAST:
506497
*hardware_generation = kGpaHwGenerationLast;
507498
break;
@@ -856,8 +847,6 @@ GPA_LIB_DECL GpaStatus GpaDeleteSession(GpaSessionId gpa_session_id)
856847

857848
GPA_LIB_DECL GpaStatus GpaBeginSession(GpaSessionId gpa_session_id)
858849
{
859-
GPA_LOG_ERROR("jjjjjjjjjjjjj GpaBeginSession");
860-
861850
try
862851
{
863852
PROFILE_FUNCTION(GpaBeginSession);

0 commit comments

Comments
 (0)