Targeting Vulkan and SPIR-V

Paulo Pinto via Digitalmars-d digitalmars-d at
Sat Mar 7 04:30:56 PST 2015

On Saturday, 7 March 2015 at 11:35:59 UTC, ponce wrote:
> On Friday, 6 March 2015 at 23:25:40 UTC, Joakim wrote:
>> The ground-up redesign of OpenGL, now called Vulkan, has been 
>> announced at GDC:
>> Both graphics shaders and the latest verson of OpenCL, which 
>> enables computation on the GPU, will target a new IR called 
>> SPIR-V:
>> Rather than being forced to use C-like languages like GLSL or 
>> OpenCL in the past, this new IR will allow writing graphics 
>> shaders and OpenCL code using any language, including a subset 
>> of C++14 stripped of exceptions, function pointers, and 
>> virtual functions.
>> This would be a good opportunity for D, if ldc or gdc could be 
>> made to target SPIR-V.  Ldc would seem to have a leg up, since 
>> SPIR was originally based on LLVM IR before diverging with 
>> SPIR-V.
> Sure, you might target SPIR-V with a C-like language, but how 
> will you generate the IR corresponding to:
> - texture accesses
> - local memory vs global memory vs mapped pinned host memory. 
> Looks like you need annotations for your pointers.
> - sub-blocks operations made core in OpenCL 2.x
> All things that OpenCL C or GLSL are aware of.
> Having a GPU backend doesn't make general code fit for high 
> level of parallelism. GPUs are not designed to work-around the 
> poor efficiency of the programs they run.

The same way the Haskell, Java, Python and .NET implementations 
targeting CUDA PTX and HSAIL do.


More information about the Digitalmars-d mailing list