Skip to content
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d59eb7a
Add VK_KHR_pipeline_binary sample and related resources
gpx1000 Oct 16, 2025
11f4384
update the clang format and copyright.
gpx1000 Oct 16, 2025
35286a4
update nav.adoc
gpx1000 Oct 16, 2025
1f92e28
- Enhance README with Antora site-gen support and improved references.
gpx1000 Oct 19, 2025
ff0952d
Adjust code formatting in pipeline_binary.cpp for improved readability
gpx1000 Oct 19, 2025
fe2db8b
Merge branch 'main' into VK_KHR_pipeline_binaries
gpx1000 Jan 1, 2026
8d0497b
Update pipeline binary sample with interactive demo and performance m…
gpx1000 Jan 1, 2026
b60c1a7
Refactor logging to use std::format and eliminate snprintf
gpx1000 Jan 7, 2026
e9d53b7
Add missing std::format include to pipeline_binary sample
gpx1000 Jan 7, 2026
9612175
Remove duplicate logging statement in pipeline_binary sample
gpx1000 Jan 7, 2026
19fa02c
Revert updating volk.
gpx1000 Jan 7, 2026
ed10cd5
Add `-extra-arg=-std=c++20` to clang-tidy and fix include order
gpx1000 Jan 7, 2026
d7a4654
Fix clang-tidy by installing GCC 13 toolchain and configuring gcc-too…
gpx1000 Jan 7, 2026
8aae311
Remove clang-tidy container and use system-installed run-clang-tidy
gpx1000 Jan 7, 2026
96c4369
Disable X11 in GLFW build for clang-tidy check
gpx1000 Jan 7, 2026
145428d
Install XCB headers for CMake configure and re-enable X11 in GLFW build
gpx1000 Jan 7, 2026
92767a5
Disable X11 in GLFW build for clang-tidy check
gpx1000 Jan 7, 2026
0cb3404
Replace std::format with fmt::format in pipeline_binary sample
gpx1000 Jan 8, 2026
992ba12
clang format fix.
gpx1000 Jan 8, 2026
e85706f
Replace std::format with fmt::format in pipeline_binary sample
gpx1000 Jan 9, 2026
376f98d
Merge branch 'main' into VK_KHR_pipeline_binaries
gpx1000 Jan 13, 2026
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
68 changes: 32 additions & 36 deletions samples/extensions/pipeline_binary/pipeline_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,20 +192,19 @@ void PipelineBinary::log_pipeline_binary_support()
vkGetPhysicalDeviceFeatures2(get_device().get_gpu().get_handle(), &features2);
vkGetPhysicalDeviceProperties2(get_device().get_gpu().get_handle(), &props2);

const char *pb = features.pipelineBinaries ? "true" : "false";
LOGI("VK_KHR_pipeline_binary supported feature: pipelineBinaries = {}", pb);
char buf[256];
snprintf(buf, sizeof(buf), "VK_KHR_pipeline_binary supported feature: pipelineBinaries = %s\n", pb);
log_text_ += buf;

const char *ic = props.pipelineBinaryInternalCache ? "true" : "false";
const char *icc = props.pipelineBinaryInternalCacheControl ? "true" : "false";
const char *pic = props.pipelineBinaryPrefersInternalCache ? "true" : "false";
const char *pic2 = props.pipelineBinaryPrecompiledInternalCache ? "true" : "false";
const char *cd = props.pipelineBinaryCompressedData ? "true" : "false";
LOGI("VK_KHR_pipeline_binary properties: internalCache={}, internalCacheControl={}, prefersInternalCache={}, precompiledInternalCache={}, compressedData={}", ic, icc, pic, pic2, cd);
snprintf(buf, sizeof(buf), "VK_KHR_pipeline_binary properties: internalCache=%s, internalCacheControl=%s, prefersInternalCache=%s, precompiledInternalCache=%s, compressedData=%s\n", ic, icc, pic, pic2, cd);
log_text_ += buf;
std::string message = std::format("VK_KHR_pipeline_binary support: pipelineBinaries = {}", !!features.pipelineBinaries);
LOGI(message);
log_text_ += message + "\n";

message = std::format(
"VK_KHR_pipeline_binary properties: internalCache={}, internalCacheControl={}, prefersInternalCache={}, precompiledInternalCache={}, compressedData={}",
!!props.pipelineBinaryInternalCache,
!!props.pipelineBinaryInternalCacheControl,
!!props.pipelineBinaryPrefersInternalCache,
!!props.pipelineBinaryPrecompiledInternalCache,
!!props.pipelineBinaryCompressedData);
LOGI(message);
log_text_ += message + "\n";
}

void PipelineBinary::demo_pipeline_key_and_binary()
Expand All @@ -222,18 +221,17 @@ void PipelineBinary::demo_pipeline_key_and_binary()
VkResult res = vkGetPipelineKeyKHR(get_device().get_handle(), &pipeline_create_info_khr, &key);
if (res != VK_SUCCESS)
{
LOGW("vkGetPipelineKeyKHR failed ({}); skipping binary capture", static_cast<int>(res));
char buf[128];
snprintf(buf, sizeof(buf), "vkGetPipelineKeyKHR failed (%d); skipping binary capture\n", static_cast<int>(res));
log_text_ += buf;
std::string message = std::format("vkGetPipelineKeyKHR failed ({}); skipping binary capture", vk::to_string(static_cast<vk::Result>(res)));
LOGW(message);
log_text_ += message + "\n";
return;
}

LOGI("Got pipeline key ({} bytes)", key.keySize);
{
char buf[128];
snprintf(buf, sizeof(buf), "Got pipeline key (%u bytes)\n", static_cast<unsigned>(key.keySize));
log_text_ += buf;
std::string message = std::format("Got pipeline key ({} bytes)", key.keySize);
LOGI(message);
log_text_ += message + "\n";
}

// Create a pipeline binary handle from the pipeline creation parameters only
Expand All @@ -250,10 +248,10 @@ void PipelineBinary::demo_pipeline_key_and_binary()
res = vkCreatePipelineBinariesKHR(get_device().get_handle(), &create_info, nullptr, &handles);
if (res != VK_SUCCESS || pipeline_binary == VK_NULL_HANDLE)
{
LOGW("vkCreatePipelineBinariesKHR failed ({}); driver may not support capturing binaries in this context", static_cast<int>(res));
char buf[180];
snprintf(buf, sizeof(buf), "vkCreatePipelineBinariesKHR failed (%d); driver may not support capturing binaries in this context\n", static_cast<int>(res));
log_text_ += buf;
std::string message = std::format("vkCreatePipelineBinariesKHR failed ({}); driver may not support capturing binaries in this context",
vk::to_string(static_cast<vk::Result>(res)));
LOGW(message);
log_text_ += message + "\n";
return;
}

Expand All @@ -266,10 +264,9 @@ void PipelineBinary::demo_pipeline_key_and_binary()
res = vkGetPipelineBinaryDataKHR(get_device().get_handle(), &binary_info, &size_query_key, &binary_size, nullptr);
if (res != VK_SUCCESS || binary_size == 0)
{
LOGW("vkGetPipelineBinaryDataKHR size query failed ({}); skipping data fetch", static_cast<int>(res));
char buf[160];
snprintf(buf, sizeof(buf), "vkGetPipelineBinaryDataKHR size query failed (%d); skipping data fetch\n", static_cast<int>(res));
log_text_ += buf;
std::string message = std::format("vkGetPipelineBinaryDataKHR size query failed ({}); skipping data fetch", vk::to_string(static_cast<vk::Result>(res)));
LOGW(message);
log_text_ += message + "\n";
return;
}

Expand All @@ -287,19 +284,18 @@ void PipelineBinary::demo_pipeline_key_and_binary()
// Print a short signature so we can see it changes between runs/devices
if (binary_size >= 4)
{
char sig[96];
snprintf(sig, sizeof(sig), "Binary signature: %u %u %u %u ...\n", binary_data_[0], binary_data_[1], binary_data_[2], binary_data_[3]);
log_text_ += sig;
LOGD("Binary signature: {} {} {} {} ...", binary_data_[0], binary_data_[1], binary_data_[2], binary_data_[3]);
std::string message = std::format("Binary signature: {} {} {} {} ...", binary_data_[0], binary_data_[1], binary_data_[2], binary_data_[3]);
LOGD(message);
log_text_ += message + "\n";
}
}
else
{
binary_available_ = false;
LOGW("vkGetPipelineBinaryDataKHR failed ({}); data not available", static_cast<int>(res));
char buf[128];
snprintf(buf, sizeof(buf), "vkGetPipelineBinaryDataKHR failed (%d); data not available\n", static_cast<int>(res));
log_text_ += buf;
std::string message = std::format("vkGetPipelineBinaryDataKHR failed ({}); data not available", vk::to_string(static_cast<vk::Result>(res)));
LOGW(message);
log_text_ += message + "\n";
}
}

Expand Down
Loading