码迷,mamicode.com
首页 > 其他好文 > 详细

[ZZ] A Proposal For Compiling Direct3D HLSL With LLVM (Written by Michael Larabel )

时间:2016-12-30 02:10:08      阅读:258      评论:0      收藏:0      [点我收藏+]

标签:news   item   mojo   rate   phi   ever   catch   current   rtu   

http://www.phoronix.com/scan.php?page=news_item&px=OTI2NA

Note:  Something very instersting to wine translating

这个点子是对于GPU virtualization有启发。。。不过有很多技术和专利上的问题。

MSFT HSLS -> LLVM IR -> Windows graphics driver or Linux graphic drivers.

Apple GLSL -> LLVM IR -> ??

 

A Proposal For Compiling Direct3D HLSL With LLVM
Written by Michael Larabel in Compiler on 28 March 2011 at 10:54 PM EDT. 6 Comments
COMPILER --
Lately we have been talking a lot about this year‘s Google Summer of Code whereby Google pays student developers to work on various free software projects over the summer. While GSoC has been taking place for several years, this year there‘s been several interesting proposals expressed. Among the proposals to catch our attention has been experimental work on KDE‘s KWin for Wayland, an OpenGL 4.1 Gallium3D state tracker that‘s now turned into a video acceleration state tracker for WebM/VP8 on VDPAU, better multi-GPU support, and ReactOS improvements, among many other expressed proposals from dozens of free software projects. Another one was just brought up by a student developer and that‘s to provide support for compiling Microsoft Direct3D HLSL in LLVM.

This proposal by Charles Davis, an American university student, is entitled "Microsoft Direct3D shader bytecode backend." Here‘s the abstract from the proposal:

    There is a distinct lack of open-source frameworks for compiling HLSL, the shader language used by Direct3D, into bytecode that D3D can understand. Currently, the only such framework is Ryan Gordon‘s MojoShader, whose HLSL compiler component is still under heavy development. By utilizing LLVM, it may be possible to generate high-performance shader code from HLSL, just as Apple is known to do for GLSL. The first step is a backend to generate D3D bytecode from LLVM IR.


Basically it‘s doing what Apple does with LLVM for GL Shading Language (GLSL) work on Mac OS X and what Linux developers have begun to do in the Linux world with Gallium3D, but to apply this to Direct3D and HLSL, the Microsoft High Level Shader Language.

Not only would the Low-Level Virtual Machine be compiling the HLSL, but it would take advantage of the LLVM optimizers to generate more efficient and higher-performing HLSL. Right now under Windows, most HLSL is generated by Microsoft‘s compiler in DirectX. As part of the HLSL compiler, the LLVM back-end would generate Direct3D shader byte-code from LLVM IR.

What makes this work particularly interesting is that the proposal has the interest of the Wine project. In fact, it was Dan Kegel who brought up this idea of using LLVM for a Direct3D/HLSL compiler. Wine‘s in need of a shader compiler and so they hope this work will come to fruition. Dan Kegel in fact a well known Wine figure and is employed by Google and was the Wine 1.0 release manager. There is also the Direct3D 10/11 state tracker for Mesa‘s Gallium3D architecture, but that hasn‘t garnered the interest of Wine.

If this proposal is accepted and ends up materializing, this could -- in the long run -- end up improving Wine‘s support for modern Direct3D titles and when optimized with LLVM could provide faster performance.

 

[ZZ] A Proposal For Compiling Direct3D HLSL With LLVM (Written by Michael Larabel )

标签:news   item   mojo   rate   phi   ever   catch   current   rtu   

原文地址:http://www.cnblogs.com/kylegui/p/6235062.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!