layers: Github #94-Use VkShaderModule
The shader_module validation didn't have a mechanism to correlate
messages back to the original VkShaderModule. This was necessary
to pin-point which shader had issues once it was created (typically
when a pipeline was bound).
Change-Id: Iee5a6993abc67479f3ac2343388499ec6b6ba3c1
diff --git a/layers/shader_validation.h b/layers/shader_validation.h
index 10d9765..8fe5aba 100644
--- a/layers/shader_validation.h
+++ b/layers/shader_validation.h
@@ -74,15 +74,17 @@
// trees, constant expressions, etc requires jumping all over the instruction stream.
std::unordered_map<unsigned, unsigned> def_index;
bool has_valid_spirv;
+ VkShaderModule vk_shader_module;
- shader_module(VkShaderModuleCreateInfo const *pCreateInfo)
+ shader_module(VkShaderModuleCreateInfo const *pCreateInfo, VkShaderModule shaderModule)
: words((uint32_t *)pCreateInfo->pCode, (uint32_t *)pCreateInfo->pCode + pCreateInfo->codeSize / sizeof(uint32_t)),
def_index(),
- has_valid_spirv(true) {
+ has_valid_spirv(true),
+ vk_shader_module(shaderModule) {
build_def_index();
}
- shader_module() : has_valid_spirv(false) {}
+ shader_module() : has_valid_spirv(false), vk_shader_module(VK_NULL_HANDLE) {}
// Expose begin() / end() to enable range-based for
spirv_inst_iter begin() const { return spirv_inst_iter(words.begin(), words.begin() + 5); } // First insn