Add optional debug dumping of postvs SPIR-V

This commit is contained in:
baldurk
2020-06-05 15:15:42 +01:00
parent 7dda3770e4
commit 35c7c640de
+10
View File
@@ -25,6 +25,7 @@
#include <float.h>
#include <math.h>
#include <algorithm>
#include "core/settings.h"
#include "driver/shaders/spirv/spirv_editor.h"
#include "driver/shaders/spirv/spirv_op_helpers.h"
#include "vk_core.h"
@@ -32,6 +33,9 @@
#include "vk_replay.h"
#include "vk_shader_cache.h"
RDOC_DEBUG_CONFIG(rdcstr, Vulkan_Debug_PostVSDumpDirPath, "",
"Path to dump gnerated SPIR-V compute shaders for fetching post-vs.");
#undef None
struct VkXfbQueryResult
@@ -1984,10 +1988,16 @@ void VulkanReplay::FetchVSOut(uint32_t eventId, VulkanRenderState &state)
m_pDriver->vkUpdateDescriptorSets(dev, numWrites, descWrites, 0, NULL);
}
if(!Vulkan_Debug_PostVSDumpDirPath().empty())
FileIO::WriteAll(Vulkan_Debug_PostVSDumpDirPath() + "/debug_postvs_vert.spv", modSpirv);
ConvertToMeshOutputCompute(*refl, *pipeInfo.shaders[0].patchData,
pipeInfo.shaders[0].entryPoint.c_str(), attrInstDivisor, drawcall,
numVerts, numViews, modSpirv, bufStride);
if(!Vulkan_Debug_PostVSDumpDirPath().empty())
FileIO::WriteAll(Vulkan_Debug_PostVSDumpDirPath() + "/debug_postvs_comp.spv", modSpirv);
VkComputePipelineCreateInfo compPipeInfo = {VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO};
// repoint pipeline layout