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

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.

时间: 2024-10-25 16:48:32

[ZZ] A Proposal For Compiling Direct3D HLSL With LLVM (Written by Michael Larabel )的相关文章

【转载】Direct3D HLSL介绍(上)

原文路径:http://www.csharpwin.com/csharpspace/3087.shtml 写过Direct3D程序的朋友们可能还记得,在以往,大家常为如何表现更多真实的材质(如玻璃.金属等)而发愁.这种情况在DirectX8.0问世后有所改善了,我们可以编写Shader来完成.最新的Direct3D中,HLSL把程序员从复杂的Shader指令集中解放出来,着力于更重要的算法. HLSL(High-Level Shader Language)本文将从如下几个部分介绍 准备工作 HL

Angle

1 What is Angle. The goal of ANGLE is to allow Windows users to seamlessly run WebGL and other OpenGL ES content by translating OpenGL ES API calls to DirectX 9 or DirectX 11 API calls. ANGLE is a conformant implementation of the OpenGL ES 2.0 specif

实现在同一台服务器上登录的ssh用户的群聊(聊天室)功能

直接上代码了,注释还算清晰,有问题欢迎提问指证. 为方便下载编译,代码都放到一个文件里了. 服务器是CentOS,客户端用的secureCRT. /* 功能: 在同一台服务器上ssh登录的用户可以群聊(聊天室) 原理:<span style="white-space:pre"> </span>1.通过roomNo.来区分不同的房间或群组: 2.以roomNo.作为key来创建一块共享内存,来保存进入到该room的用户列表: 3.用户以ssh(或其它方式)登录到服

DirectX 11游戏编程学习笔记之7: 第6章Drawing in Direct3D(在Direct3D中绘制)(重点回顾+勘误)

        本文由哈利_蜘蛛侠原创,转载请注明出处!有问题欢迎联系[email protected]         注:我给的电子版是700多页,而实体书是800多页,所以我在提到相关概念的时候,会使用章节号而非页码.同样的情况适合于"龙书"第二版. 上一期的地址: DX 11游戏编程学习笔记之6 这一章应该是本书最长的一章了,可能也是最难的一章,所以大家一定要好好消化,仔细学习!这一章大致相当于"龙书"第二版的第7章和第8章,还添加了一些别的东西. 由于这一

[ZZ] cbuffer和tbuffer

http://blog.chinaunix.net/uid-20235103-id-2578297.html Shader Model 4支持的新东西,通过打包数据可以获得更好的性能.原文转发:Shader Constants (DirectX HLSL) In shader model 4, shader constants are stored in one or more buffer resources in memory. They can be organized into two

HLSL的基础语法

HLSL的基本语法 1 数据类型 1.1   标量类型 1. bool: True or false .Note that the HLSL provides the true and false keywordslike in C++. 2. int: 32-bit signedinteger. 3. half: 16-bit-floatingpoint number. 4. float: 32-bit-floatingpoint number. 5. double: 64-bit-float

【转】HLSL基础

原文地址http://blog.csdn.net/chpdirect1984/article/details/1911622 目录 前言 1.HLSL入门 1.1什么是着色器 1.2什么是HLSL 1.3怎么写HLSL着色器 1.4怎么用HLSL着色器 2.顶点着色器 2.1可编程数据流模型 2.2顶点声明 2.3用顶点着色器实现渐变动画 3.像素着色器 3.1多纹理化 3.2多纹理效果的像素着色器 3.3应用程序 4.HLSL Effect(效果框架) 4.1Effect代码结构 4.2用Ef

Shader编程学习笔记(三)——三大主流编程语言 HLSL/GLSL/Cg

三大主流编程语言 HLSL/GLSL/Cg Shader Language Shader Language的发展方向是设计出在便携性方面可以和C++.Java等相比的高级语言,“赋予程序员灵活而方便的编程方式”,并“尽可能的控制渲染过程”同时“利用图形硬件的并行性,提高算法效率”. Shader Language目前主要有3种语言:基于OpenGL的OpenGL Shading Language,简称GLSL;基于DirectX的High Level Shading Language,简称HLS

Directx 中HLSL高级着色器语言 脑补一下吧

HLSL初级教程 作者:trcj 目录 前言 1.HLSL入门 1.1什么是着色器 1.2什么是HLSL 1.3怎么写HLSL着色器 1.4怎么用HLSL着色器 2.顶点着色器 2.1可编程数据流模型 2.2顶点声明 2.3用顶点着色器实现渐变动画 3.像素着色器 3.1多纹理化 3.2多纹理效果的像素着色器 3.3应用程序 4.HLSL Effect(效果框架) 4.1Effect代码结构 4.2用Effect实现多纹理化效果 结语 参考资料 前言 本教程针对HLSL(High Level S