Added slang shaders for additional compute samples
This commit is contained in:
parent
80ff4a41d2
commit
829118736f
8 changed files with 460 additions and 2 deletions
20
shaders/slang/computeshader/shared.slang
Normal file
20
shaders/slang/computeshader/shared.slang
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* Copyright (c) 2025, Sascha Willems
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
module shared;
|
||||
|
||||
public Texture2D inputImage;
|
||||
public RWTexture2D<float4> resultImage;
|
||||
|
||||
public float conv(in float kernel[9], in float data[9], in float denom, in float offset)
|
||||
{
|
||||
float res = 0.0;
|
||||
for (int i=0; i<9; ++i)
|
||||
{
|
||||
res += kernel[i] * data[i];
|
||||
}
|
||||
return saturate(res/denom + offset);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue