Skip to content

Commit 3f16de7

Browse files
Abhi-hppfacebook-github-bot
authored andcommitted
Vulkan spirv debug symbols (#7182)
Summary: Add a flag to optionally include the shader source in the generated spv and make it default on windows. Reviewed By: SS-JIA Differential Revision: D66778427
1 parent fd33294 commit 3f16de7

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

backends/vulkan/runtime/gen_vulkan_spv.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,7 @@ def main(argv: List[str]) -> int:
10521052
parser.add_argument("--replace-u16vecn", action="store_true", default=False)
10531053
parser.add_argument("--optimize_size", action="store_true", help="")
10541054
parser.add_argument("--optimize", action="store_true", help="")
1055+
parser.add_argument("--spv_debug", action="store_true", default=False)
10551056
parser.add_argument(
10561057
"--env", metavar="KEY=VALUE", nargs="*", help="Set a number of key-value pairs"
10571058
)
@@ -1075,6 +1076,8 @@ def main(argv: List[str]) -> int:
10751076
glslc_flags += "-Os"
10761077
elif options.optimize:
10771078
glslc_flags += "-O"
1079+
if options.spv_debug:
1080+
glslc_flags += "-g"
10781081

10791082
shader_generator = SPVGenerator(
10801083
options.glsl_paths,

backends/vulkan/targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def vulkan_spv_shader_lib(name, spv_filegroups, is_fbcode = False, no_volk = Fal
4343
"DEFAULT": "",
4444
"ovr_config//os:android": "--optimize",
4545
"ovr_config//os:linux": "--replace-u16vecn",
46+
"ovr_config//os:windows": "--optimize --spv_debug",
4647
})
4748
)
4849

0 commit comments

Comments
 (0)