diff options
author | greg-lunarg <greg@lunarg.com> | 2020-03-12 07:19:52 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-12 09:19:52 -0400 |
commit | 1fe9bcc10824c1fa35bd9b697188340132d39213 (patch) | |
tree | 6f82277f348a8d623ec718a5e651d19ac49b1fd1 /include/spirv-tools/optimizer.hpp | |
parent | 6428ad05e706567945faf0fa0ae6257bb6006733 (diff) | |
download | SPIRV-Tools-1fe9bcc10824c1fa35bd9b697188340132d39213.tar.gz |
Instrument: Debug Printf support (#3215)
Create a pass to instrument OpDebugPrintf instructions. This pass replaces all OpDebugPrintf instructions with instructions to write a record containing the string id and the all specified values into a special printf output buffer (if space allows). This pass is designed to support the printf validation in the Vulkan validation layers.
Fixes #3210
Diffstat (limited to 'include/spirv-tools/optimizer.hpp')
-rw-r--r-- | include/spirv-tools/optimizer.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp index c31ccef8..b9049232 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -791,6 +791,18 @@ Optimizer::PassToken CreateInstBuffAddrCheckPass(uint32_t desc_set, uint32_t shader_id, uint32_t version = 2); +// Create a pass to instrument OpDebugPrintf instructions. +// This pass replaces all OpDebugPrintf instructions with instructions to write +// a record containing the string id and the all specified values into a special +// printf output buffer (if space allows). This pass is designed to support +// the printf validation in the Vulkan validation layers. +// +// The instrumentation will write buffers in debug descriptor set |desc_set|. +// It will write |shader_id| in each output record to identify the shader +// module which generated the record. +Optimizer::PassToken CreateInstDebugPrintfPass(uint32_t desc_set, + uint32_t shader_id); + // Create a pass to upgrade to the VulkanKHR memory model. // This pass upgrades the Logical GLSL450 memory model to Logical VulkanKHR. // Additionally, it modifies memory, image, atomic and barrier operations to |