优化着色器类型判断逻辑,优化dxc编译器检查代码
This commit is contained in:
@@ -90,7 +90,8 @@ class CodeGenerator:
|
||||
writer.write()
|
||||
self._write_shader_bindings_class(writer, binding_infos)
|
||||
writer.write()
|
||||
if len(binding_infos) == 2:
|
||||
# 查找是否有像素着色器或计算着色器的处理
|
||||
if any(info['stage'] == ShaderStage.FRAGMENT.value for info in binding_infos):
|
||||
self._write_handle_class(writer, 'pixel_shader_handle_t', binding_infos)
|
||||
else:
|
||||
self._write_handle_class(writer, 'compute_shader_handle_t', binding_infos)
|
||||
|
||||
@@ -105,3 +105,10 @@ if os.name == 'nt':
|
||||
else:
|
||||
# 如果没有找到dxcapsviewer.exe,尝试直接查找dxc.exe
|
||||
dxc_path = shutil.which('dxc.exe')
|
||||
|
||||
# 检查是否有dxil.dll
|
||||
if dxc_path:
|
||||
dxil_dll_path = os.path.join(os.path.dirname(dxc_path), 'dxil.dll')
|
||||
if not os.path.isfile(dxil_dll_path):
|
||||
print("Warning: dxil.dll not found in the same directory as dxc.exe.")
|
||||
dxc_path = None
|
||||
Reference in New Issue
Block a user