mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 20:51:29 +11:00
27 lines
517 B
GLSL
27 lines
517 B
GLSL
|
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
||
|
|
||
|
// Clear a buffer.
|
||
|
|
||
|
#version 450
|
||
|
|
||
|
layout(local_size_x = 256) in;
|
||
|
|
||
|
// This should probably be uniform rather than readonly,
|
||
|
// but we haven't done the binding work yet.
|
||
|
layout(binding = 0) readonly buffer ConfigBuf {
|
||
|
// size is in uint (4 byte) units
|
||
|
uint size;
|
||
|
uint value;
|
||
|
};
|
||
|
|
||
|
layout(binding = 1) buffer TargetBuf {
|
||
|
uint[] data;
|
||
|
};
|
||
|
|
||
|
void main() {
|
||
|
uint ix = gl_GlobalInvocationID.x;
|
||
|
if (ix < size) {
|
||
|
data[ix] = value;
|
||
|
}
|
||
|
}
|