DirectX 9 和 DirectX 10 着色器之间的兼容性
我是游戏开发的初学者,由于我习惯了 C# 编程,所以我决定选择 XNA。我已经玩了一段时间了,现在我正在学习 HLSL 着色器的基础知识,我在 MSDN 文档中注意到 DirectX 9 和 DirectX 10 之间的 HLSL 中存在一些语法更改,例如 < a href="http://msdn.microsoft.com/en-us/library/bb509644%28VS.85%29.aspx" rel="nofollow">采样器类型
因为我的台式电脑,我使用的是笔记本电脑,其显卡仅支持 DirectX 9.0c。然后我必须使用 DirectX 9 语法编写着色器,对吧?所以我想知道,使用 DirectX 9 语法编写的 HLSL 着色器是否可以在运行 DirectX 10(或更高版本)的系统上工作?
I am a beginner to game development and as I am used to programming in C# I decided to go for XNA. I've been playing around with it for a while and now I am learning the basics of HLSL shaders, I have noticed in the MSDN documentation that there have been some syntax changes in HLSL between DirectX 9 and DirectX 10, for example, the Sampler type
Since I am having some troubles with my desktop pc, I am using my laptop which video card only supports DirectX 9.0c. Then I'm gonna have to write my shaders using the DirectX 9 syntax, right? So I am wondering, will my HLSL shaders written using the DirectX 9 syntax work on a system running DirectX 10 (or higher)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您为 DirectX 9 开发着色器,那么它们几乎肯定可以在 DirectX 10 显卡上运行。如果您以相反的方式编写它们,就会出现问题。
If you develop your Shaders for DirectX 9, then they will almost certainly work on a DirectX 10 Graphics card. You would only have a problem if you were to write them the other way around.