Initial Compute Shader for Plate Generation.
This commit is contained in:
parent
9d2dd0ca82
commit
47ca1265e6
8 changed files with 214 additions and 29 deletions
17
shaders/compute/compute_example.glsl
Normal file
17
shaders/compute/compute_example.glsl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#[compute]
|
||||
#version 450
|
||||
|
||||
// Invocations in the (x, y, z) dimension
|
||||
layout(local_size_x = 2, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
// A binding to the buffer we create in our script
|
||||
layout(set = 0, binding = 0, std430) restrict buffer MyDataBuffer {
|
||||
float data[];
|
||||
}
|
||||
my_data_buffer;
|
||||
|
||||
// The code we want to execute in each invocation
|
||||
void main() {
|
||||
// gl_GlobalInvocationID.x uniquely identifies this invocation across all work groups
|
||||
my_data_buffer.data[gl_GlobalInvocationID.x] *= 2.0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue