yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
86669cbb7
master
1// compute-simple.slang 2 3static const uint THREADGROUP_SIZE_X = 8; 4static const uint THREADGROUP_SIZE_Y = THREADGROUP_SIZE_X; 5 6struct ImageProcessingOptions 7{ 8 float3 tintColor; 9 float blurRadius; 10 11 bool useLookupTable; 12 StructuredBuffer<float4> lookupTable; 13} 14 15[shader("compute")] 16[numthreads(THREADGROUP_SIZE_X, THREADGROUP_SIZE_Y)] 17void processImage( 18 uint3 threadID : SV_DispatchThreadID, 19 uniform Texture2D inputImage, 20 uniform RWTexture2D outputImage, 21 uniform ImageProcessingOptions options) 22{ 23 /* actual logic would go here */ 24}