添加调试信息编译选项

This commit is contained in:
daiqingshuang
2025-06-11 18:27:47 +08:00
parent 3648bd4c1b
commit faae9a6195
2 changed files with 4 additions and 2 deletions

View File

@@ -46,6 +46,8 @@ class SDL3GPUSlangCompiler:
with tempfile.NamedTemporaryFile(mode='w', suffix='.slang', delete=False, encoding='utf8') as tmp: with tempfile.NamedTemporaryFile(mode='w', suffix='.slang', delete=False, encoding='utf8') as tmp:
tmp.write(modified_source) tmp.write(modified_source)
tmp_path = tmp.name tmp_path = tmp.name
with tempfile.NamedTemporaryFile(mode='w', suffix='.cso', delete=False, encoding='utf8') as tmp:
signed_shader = tmp.name
try: try:
# 编译着色器 # 编译着色器
@@ -62,8 +64,6 @@ class SDL3GPUSlangCompiler:
# 如果目标是DXIL则需要签名 # 如果目标是DXIL则需要签名
if global_vars.target == TargetFormat.DXIL: if global_vars.target == TargetFormat.DXIL:
with tempfile.NamedTemporaryFile(mode='w', suffix='.cso', delete=False, encoding='utf8') as tmp:
signed_shader = tmp.name
self._compile_dxil(shader_info, shader_file, signed_shader) self._compile_dxil(shader_info, shader_file, signed_shader)
shader_file = signed_shader shader_file = signed_shader

View File

@@ -31,6 +31,8 @@ def make_cmd(source_file: str, target: TargetFormat, stage: ShaderStage, entry_p
'-o', output_path, '-o', output_path,
'-target', target_flag, '-target', target_flag,
'-stage', stage_flag, '-stage', stage_flag,
'-g3', # 生成调试信息
'-O0', # 禁用优化,便于调试和验证
] ]
# 添加包含路径 # 添加包含路径
for include_path in global_vars.include_dirs: for include_path in global_vars.include_dirs: