You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gfxrecon-convert --include-binaries does not work correctly for VkShaderCreateInfoEXT or VkShaderModuleCreateInfo in VkPipelineShaderStageCreateInfo
#1748
Open
w-pearson opened this issue
Sep 18, 2024
· 0 comments
Describe the bug:
The --include-binaries option on gfxrecon-convert doesn't work properly for two uncommon ways of creating shaders. For VkShaderCreateInfoEXT/vkCreateShadersEXT (VK_EXT_shader_object), the value of pCode is always put into the generated JSON file (even if --include-binaries is not specified). For VkShaderModuleCreateInfo specified in the pNext chain of VkPipelineShaderStageCreateInfo, the text [Binary data] is always used for pCode (even if --include-binaries is specified).
To Reproduce:
For the VkShaderModuleCreateInfo in VkPipelineShaderStageCreateInfo issue, the graphics_pipeline_library demo from KhronosGroup/Vulkan-Samples@16cd61e can be used. (The graphics pipeline library extension apparently introduced this functionality, though it uses the same spirv for all of its pipelines.)
For the VkShaderCreateInfoEXT issue, the shader_object demo can be used. Note that capturing this is more annoying, as the VK_LAYER_KHRONOS_shader_object layer needs to be after the GFXR layer (which doesn't happen with gfxrecon-capture-vulkan.py). set VK_LAYER_PATH=C:\Users\w.pearson\source\repos\gfxreconstruct\build\windows\x64\output\bin;C:\VulkanSDK\1.3.280.0\Bin and set VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_shader_object;VK_LAYER_LUNARG_gfxreconstruct works for this.
Capture a GFXR file, and then use gfxrecon-convert to get a JSON version. Then search for VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO (ignoring the 2 initial calls to vkCreateShaderModule) or VK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT.
System environment:
NVIDIA GeForce RTX 4070 Laptop GPU, driver version 537.34.0.0. Windows 10.
VulkanExportJsonConsumerBase::Process_vkCreateShaderModule uses RepresentBinaryFile (from json_writer.cpp, not json_util.cpp) for the VkShaderModuleCreateInfo, so vkCreateShaderModule is not affected. But there is no special handling for vkCreateGraphicsPipelines and its pNext chain, so the implementation in custom_vulkan_struct_to_json.cpp gets used. There also isn't any special handling for vkCreateShadersEXTorVkShaderCreateInfoEXT, so an auto-generated implementation is used (which just treats pCode as raw data).
Describe the bug:
The
--include-binaries
option ongfxrecon-convert
doesn't work properly for two uncommon ways of creating shaders. ForVkShaderCreateInfoEXT
/vkCreateShadersEXT
(VK_EXT_shader_object), the value ofpCode
is always put into the generated JSON file (even if--include-binaries
is not specified). ForVkShaderModuleCreateInfo
specified in thepNext
chain ofVkPipelineShaderStageCreateInfo
, the text[Binary data]
is always used forpCode
(even if--include-binaries
is specified).Build Environment:
Built from 8f763b8.
To Reproduce:
For the
VkShaderModuleCreateInfo
inVkPipelineShaderStageCreateInfo
issue, thegraphics_pipeline_library
demo from KhronosGroup/Vulkan-Samples@16cd61e can be used. (The graphics pipeline library extension apparently introduced this functionality, though it uses the same spirv for all of its pipelines.)For the
VkShaderCreateInfoEXT
issue, theshader_object
demo can be used. Note that capturing this is more annoying, as theVK_LAYER_KHRONOS_shader_object
layer needs to be after the GFXR layer (which doesn't happen with gfxrecon-capture-vulkan.py).set VK_LAYER_PATH=C:\Users\w.pearson\source\repos\gfxreconstruct\build\windows\x64\output\bin;C:\VulkanSDK\1.3.280.0\Bin
andset VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_shader_object;VK_LAYER_LUNARG_gfxreconstruct
works for this.Capture a GFXR file, and then use
gfxrecon-convert
to get a JSON version. Then search forVK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
(ignoring the 2 initial calls tovkCreateShaderModule
) orVK_STRUCTURE_TYPE_SHADER_CREATE_INFO_EXT
.System environment:
Notes:
Related to #1367.
This happens because the custom handling for
VkShaderModuleCreateInfo
always writes[Binary data]
(the comment saying it will be replaced is wrong):gfxreconstruct/framework/decode/custom_vulkan_struct_to_json.cpp
Lines 307 to 323 in 8f763b8
VulkanExportJsonConsumerBase::Process_vkCreateShaderModule
usesRepresentBinaryFile
(from json_writer.cpp, not json_util.cpp) for theVkShaderModuleCreateInfo
, sovkCreateShaderModule
is not affected. But there is no special handling forvkCreateGraphicsPipelines
and itspNext
chain, so the implementation incustom_vulkan_struct_to_json.cpp
gets used. There also isn't any special handling forvkCreateShadersEXT
orVkShaderCreateInfoEXT
, so an auto-generated implementation is used (which just treatspCode
as raw data).Note that there's also a broken special implementation for
VkPipelineCacheCreateInfo
, but this goes unused becauseVulkanExportJsonConsumerBase::Process_vkCreatePipelineCache
handles it correctly. I think this doesn't cause any problems in practice (asVkPipelineCacheCreateInfo
doesn't appear anywhere else, in particular not in apNext
chain).The text was updated successfully, but these errors were encountered: