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

fix get_map_entries_from_cmd_buffer #17

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions extractor/extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ bool get_descriptor_set(TraceProcessor *tp, uint64_t commandBuffer, uint64_t max
}

bool get_map_entries_from_cmd_buffer(TraceProcessor *tp, uint64_t commandBuffer, uint64_t max_timestamp,
std::vector<vksp_specialization_map_entry> &map_entry_vector, vksp_configuration &config)
uint64_t min_timestamp, std::vector<vksp_specialization_map_entry> &map_entry_vector, vksp_configuration &config)
{
std::string query = "SELECT arg_set_id FROM slice WHERE slice.name = 'vkCmdBindPipeline' AND "
+ std::to_string(commandBuffer)
Expand All @@ -507,7 +507,9 @@ bool get_map_entries_from_cmd_buffer(TraceProcessor *tp, uint64_t commandBuffer,

std::string query2 = "SELECT arg_set_id FROM slice WHERE slice.name = 'vkCreateComputePipelines-MapEntry' AND "
+ std::to_string(pipeline)
+ " = (SELECT int_value FROM args WHERE args.arg_set_id = slice.arg_set_id AND args.key = 'debug.pipeline')";
+ " = (SELECT int_value FROM args WHERE args.arg_set_id = slice.arg_set_id AND args.key = 'debug.pipeline') "
"AND slice.ts < "
+ std::to_string(max_timestamp) + " AND slice.ts > " + std::to_string(min_timestamp);
EXECUTE_QUERY_NO_CHECK(it2, tp, query2);
while (it2.Next()) {
uint64_t arg_set_id = it2.Get(0).AsLong();
Expand All @@ -521,7 +523,9 @@ bool get_map_entries_from_cmd_buffer(TraceProcessor *tp, uint64_t commandBuffer,
std::string query3
= "SELECT arg_set_id FROM slice WHERE slice.name = 'vkCreateComputePipelines-specialization' AND "
+ std::to_string(pipeline)
+ " = (SELECT int_value FROM args WHERE args.arg_set_id = slice.arg_set_id AND args.key = 'debug.pipeline')";
+ " = (SELECT int_value FROM args WHERE args.arg_set_id = slice.arg_set_id AND args.key = 'debug.pipeline') "
"AND slice.ts < "
+ std::to_string(max_timestamp) + " AND slice.ts > " + std::to_string(min_timestamp);
EXECUTE_QUERY_NO_CHECK(it3, tp, query3);
if (it3.Next()) {
uint64_t arg_set_id = it3.Get(0).AsLong();
Expand Down Expand Up @@ -630,7 +634,8 @@ int main(int argc, char **argv)
PRINT("Min timestamp: %lu", min_timestamp);

std::vector<vksp_specialization_map_entry> map_entry_vector;
CHECK(get_map_entries_from_cmd_buffer(tp.get(), commandBuffer, max_timestamp, map_entry_vector, config),
CHECK(get_map_entries_from_cmd_buffer(
tp.get(), commandBuffer, max_timestamp, min_timestamp, map_entry_vector, config),
"Could not get map entries from command buffer");
PRINT("specialization info data (size %u): '%s'", config.specializationInfoDataSize, config.specializationInfoData);
for (auto &me : map_entry_vector) {
Expand Down