Vulkan-Samples icon indicating copy to clipboard operation
Vulkan-Samples copied to clipboard

pipeline_cache sample fails with "SPIRV File Too Small" exception

Open dkorkmazturk opened this issue 2 months ago • 1 comments

The pipeline_cache sample fails with the following error messages.

[error] Error Message: SPIRV file too small.
[error] Failed when running application Pipeline Management

I believe there's a type confusion issue in the shader module creation flow:

  1. ResourceReplay::create_shader_module() creates a ShaderSource object from GLSL source code read from a string stream. Since the source originates from a string stream, filename in the ShaderSource object is not set.
  2. The ShaderModule constructor incorrectly assumes this ShaderSource object contains SPIR-V binary and it attempts to read it from the filename it gets from the given ShaderSource object, which is empty.
  3. This results in an empty std::vector being passed to SPIRVReflection::reflect_shader_resources() in the ShaderModule constructor.
  4. The reflection function fails with "SPIRV file too small" exception deeper down in the call stack when given an empty vector.

Reproduction steps:

./vulkan_samples sample pipeline_cache

OS: Arch Linux Drivers: NVIDIA 580.105.08 Built Vulkan-Samples from 8e966ebfad343112286ed705eca6be4472dd85df

dkorkmazturk avatar Nov 13 '25 14:11 dkorkmazturk

Thanks. We'll look into it.

The reason this didn't show up during our regular reviews: The cache doesn't seem to work on windows at all due to using a wrong file path format. So running on Windows no cache is ever loaded, and as such you never run into the issue you're observing.

SaschaWillems avatar Nov 18 '25 17:11 SaschaWillems