HLSL编译速度 [英] HLSL compilation speed

查看:66
本文介绍了HLSL编译速度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Hello,


< p style ="margin:0in; font-family:'Courier New'; font-size:9pt">我有一个相对复杂的着色器,我想编译它。


Shader有~700行, 其中&NBSP;是&NBSP;编译&NBSP;进入~3000指令。


编译时间是fxc(Windows 8 SDK)约
90秒


我有另一个相似尺寸的着色器,编译时间是
20秒


以下是我的问题:



  • 是否可以加速从应用程序角度进行编译(更快版本的fxc或fxc替代方案)?
  • 可以从代码视点加速编译(是鳕鱼)那些大大减慢编译的构造 - 哪些,如何避免它们??
  • 是否可以从fxc设置的角度加速编译(某些分支选项如--fast-compile或其他)?

解决方案

嗨DominikDušek,


谢谢在这里发布。


>>是否可以加速从应用程序角度进行编译(更快版本的fxc或fxc备选方案)?


在我看来,只有测试才能找到答案。


>> 可以加快编译速度从代码视图点


关于这一点,我建议你参考这个关于时间复杂度的文档。  算法的时间复杂度量化了算法作为表示输入的字符串长度的函数运行所花费的时间。您可以通过降低代码的时间复杂度来
加速编译。


欲了解更多信息,请求请参阅此文档。


https://en.wikipedia.org/wiki/Time_complexity


>> 可以加快fxc设置视点的编译速度


对于这一点,您可以使用O0来禁用指令重新排序。这有助于降低寄存器负载并实现更快的环路仿真。还记得删除未使用的输出文件。


有关详细信息,请参阅此文档。


https://msdn.microsoft.com/en-us/library/windows/desktop/bb509709(v=vs.85 ).aspx


希望这可以帮助你。


最好的问候,


Sera Yu




Hello,

I have one relatively complicated shader, which I want to compile.

Shader has ~700 lines,  which  are  compiled  into ~3000 instructions.

Compilation time is with fxc (Windows 8 SDK) about 90 seconds.

I have another shader of similar size and compilation time is 20 seconds.

So here are my questions:

  • Is possible to speed up the compilation from application viewpoint (faster version of fxc or fxc alternative)?
  • Is possible to speed up the compilation from code view point (is code constructs which massively slows down the compilation - which ones, how avoid them)?
  • Is possible to speed up the compilation from fxc settings viewpoint (some secre options as --fast-compile or whatever)?

解决方案

Hi Dominik Dušek,

thanks for posting here.

>>Is possible to speed up the compilation from application viewpoint (faster version of fxc or fxc alternative)?

In my opinion, only testing could find the answer.

>>Is possible to speed up the compilation from code view point

For this point, I suggest you refer to this document about Time complexity.  The time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the string representing the input. You could speed up your compilation by lower your code's Time complexity.

For more information, please refer to this document.

https://en.wikipedia.org/wiki/Time_complexity

>>Is possible to speed up the compilation from fxc settings viewpoint

For this point, you could use O0 which disables instruction reordering. This helps reduce register load and enables faster loop simulation. Also remember to remove unused output files.

For more information, please refer to this document.

https://msdn.microsoft.com/en-us/library/windows/desktop/bb509709(v=vs.85).aspx

Hope this could be help of you.

Best Regards,

Sera Yu


这篇关于HLSL编译速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆