Would it be feasible to compile LLVM IR into shading language assembler? If so, is this already being done? This would provide the obvious benefits of not having to differentiate between GLSL and HLSL (et al.) and the pleasure of using some other language to write and test the shader's that have support as an LLVM frontend. I've googled and found nothing about this. The only LLVM and OpenGL talk I can find it about Apple using it in Leopard but I don't think that's the same thing as this is it? There may so much fundamentally wrong with my understanding of the LLVM stack that comes through by asking this question so I'm sorry in advance if that's the case! Cheers, Sam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150211/4c6ce29f/attachment.html>
> On Feb 11, 2015, at 11:06 AM, Sam Kellett <samkellett at gmail.com> wrote: > > Would it be feasible to compile LLVM IR into shading language assembler? If so, is this already being done?It would certainly be possible for a restricted subset of LLVM IR, but non-trivial. GLSL and HLSL are fairly restrictive languages compared to, say, C, and many operations in LLVM IR would be very difficult to express in them. In general, GLSL and HLSL are much more similar to each other than they are to LLVM IR, so your life would likely be much better if you defined some intermediate form between the two than trying to round-trip through LLVM IR. —Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150211/7e433ef3/attachment.html>
On Wed, Feb 11, 2015 at 04:06:10PM +0000, Sam Kellett wrote:> Would it be feasible to compile LLVM IR into shading language assembler? If > so, is this already being done? >The R600 backend does this in conjunction with the Open Source mesa3D project: http://www.mesa3d.org/ Mesa has a glsl frontend that is used to emit LLVM IR for newer AMD GPUs, which is fed into the R600 backend to produce native GPU code. Besides hardware accelerated drivers, the Mesa3d project also comes with a software based rasterizer, which does the same thing, but instead of the R600 backend it uses some of llvm's CPU backends. -Tom> This would provide the obvious benefits of not having to differentiate > between GLSL and HLSL (et al.) and the pleasure of using some other > language to write and test the shader's that have support as an LLVM > frontend. > > I've googled and found nothing about this. The only LLVM and OpenGL talk I > can find it about Apple using it in Leopard but I don't think that's the > same thing as this is it? > > There may so much fundamentally wrong with my understanding of the LLVM > stack that comes through by asking this question so I'm sorry in advance if > that's the case! > > Cheers, > Sam> _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> On Feb 11, 2015, at 11:37 AM, Tom Stellard <tom at stellard.net> wrote: > > On Wed, Feb 11, 2015 at 04:06:10PM +0000, Sam Kellett wrote: >> Would it be feasible to compile LLVM IR into shading language assembler? If >> so, is this already being done? >> > > The R600 backend does this in conjunction with the Open Source mesa3D > project: http://www.mesa3d.org/ <http://www.mesa3d.org/> > > Mesa has a glsl frontend that is used to emit LLVM IR for newer AMD > GPUs, which is fed into the R600 backend to produce native GPU code. > > Besides hardware accelerated drivers, the Mesa3d project also comes with a > software based rasterizer, which does the same thing, but instead of the > R600 backend it uses some of llvm's CPU backends.I think he was asking about the other direction, from LLVM IR —> shading languages? —Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150211/61b78ace/attachment.html>