Skip to content

Commit fce030b

Browse files
dj2Dawn LUCI CQ
authored andcommitted
[vulkan] Add histogram for spirv-val time.
Add a histogram to track the time taken running the SPIR-V validator. Bug: 357132378 Change-Id: Iae465b1cfdb76bb678cd6e65b3d4f9b3831570a0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/280576 Commit-Queue: James Price <jrprice@google.com> Commit-Queue: dan sinclair <dsinclair@chromium.org> Auto-Submit: dan sinclair <dsinclair@chromium.org> Reviewed-by: James Price <jrprice@google.com>
1 parent b889650 commit fce030b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/dawn/native/vulkan/ShaderModuleVk.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,15 @@ ResultOrError<ShaderModule::ModuleAndSpirv> ShaderModule::GetHandleAndSpirv(
360360
"Vulkan.CompileShaderToSPIRV");
361361

362362
#ifdef DAWN_ENABLE_SPIRV_VALIDATION
363-
// Validate and if required dump the compiled SPIR-V code.
364-
const bool spv14 = GetDevice()->IsToggleEnabled(Toggle::UseSpirv14);
365-
DAWN_TRY(
366-
ValidateSpirv(GetDevice(), compilation->spirv.data(), compilation->spirv.size(), spv14));
363+
{
364+
SCOPED_DAWN_HISTOGRAM_TIMER_MICROS(GetDevice()->GetPlatform(), "Vulkan.ValidateSpirv");
365+
366+
// Validate and if required dump the compiled SPIR-V code.
367+
const bool spv14 = GetDevice()->IsToggleEnabled(Toggle::UseSpirv14);
368+
DAWN_TRY(ValidateSpirv(GetDevice(), compilation->spirv.data(), compilation->spirv.size(),
369+
spv14));
370+
}
371+
367372
if (GetDevice()->IsToggleEnabled(Toggle::DumpShaders)) {
368373
DumpSpirv(GetDevice(), compilation->spirv.data(), compilation->spirv.size());
369374
}

0 commit comments

Comments
 (0)