> 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>
Yeah that's right, like how Emscripten does LLVM --> JavaScript. How do you mean restictive, ie with memory allocation and the like? What sort of IR ops would not be representable in something like GLSL? On 11 February 2015 at 16:54, Owen Anderson <resistor at mac.com> wrote:> > 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/ > > 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/c4d77819/attachment.html>
If you’re really just looking for a way to write your shaders once and have them work everywhere, you might want to look at some of the tools game developers are using. Aras from Unity was using this tool (https://github.com/aras-p/hlsl2glslfork <https://github.com/aras-p/hlsl2glslfork>) at one point to translate HLSL to GLSL. He also has a nice blog post about cross-platform shaders from last year (http://aras-p.info/blog/2014/03/28/cross-platform-shaders-in-2014/ <http://aras-p.info/blog/2014/03/28/cross-platform-shaders-in-2014/>). -Chris> On Feb 11, 2015, at 8:58 AM, Sam Kellett <samkellett at gmail.com> wrote: > > Yeah that's right, like how Emscripten does LLVM --> JavaScript. > > How do you mean restictive, ie with memory allocation and the like? What sort of IR ops would not be representable in something like GLSL? > > On 11 February 2015 at 16:54, Owen Anderson <resistor at mac.com <mailto:resistor at mac.com>> wrote: > >> On Feb 11, 2015, at 11:37 AM, Tom Stellard <tom at stellard.net <mailto: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 > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150211/467e1672/attachment.html>