mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-05-16 14:53:04 -04:00
Part of https://github.com/compiler-explorer/compiler-explorer/issues/2331 and similar to [my GLSL change](https://github.com/compiler-explorer/compiler-explorer/pull/6883) [Slang](https://shader-slang.com/) is a GPU focused shading language that has been worked on for years. Last week [The Khronos Group](https://www.khronos.org/news/press/khronos-group-launches-slang-initiative-hosting-open-source-compiler-contributed-by-nvidia) will now be running the project as open governance. The latest [Vulkan SDK](https://www.lunarg.com/lunarg-releases-vulkan-sdk-1-3-296-0-for-windows-linux-macos/) has also added a build of `Slangc` (slang compiler). This change adds support for Slang (the language) as a front end with `Slangc` (the compiler) as the only compiler. Slang can be used for things like GLSL/HLSL, but that is for a future PR. I am in contacts with people on the Slang development and plan to support things for Slang as well as the other GPU related shading languages --- of course, screen shots as well  
12 lines
350 B
Plaintext
12 lines
350 B
Plaintext
// Default target is 'spirv' but need to add entry for other targets
|
|
StructuredBuffer<float> buffer0;
|
|
StructuredBuffer<float> buffer1;
|
|
RWStructuredBuffer<float> result;
|
|
|
|
[shader("compute")]
|
|
[numthreads(1,1,1)]
|
|
void computeMain(uint3 threadId : SV_DispatchThreadID)
|
|
{
|
|
uint index = threadId.x;
|
|
result[index] = buffer0[index] + buffer1[index];
|
|
} |