16 行
374 B
C#
16 行
374 B
C#
namespace ComputeSharp.Sample.FSharp.Shaders;
|
|
|
|
/// <summary>
|
|
/// A sample shader thaat just multiplies items in a buffer by two.
|
|
/// </summary>
|
|
[AutoConstructor]
|
|
public readonly partial struct MultiplyByTwo : IComputeShader
|
|
{
|
|
private readonly ReadWriteBuffer<float> buffer;
|
|
|
|
/// <inheritdoc/>
|
|
public void Execute()
|
|
{
|
|
buffer[ThreadIds.X] *= 2;
|
|
}
|
|
} |