| 1234567891011121314151617181920212223242526 |
- #version 430 core
- struct cell_t {
- float pheromone;
- float result;
- int population;
- };
- uniform int map_width;
- uniform int map_height;
- layout(std430, binding = 2) coherent buffer map_buffer
- {
- cell_t map[];
- };
- layout(local_size_x = 256, local_size_y = 1, local_size_z = 1) in;
- void main(){
- uint cell_id = gl_GlobalInvocationID.x;
- if(cell_id >= uint(map_width * map_height)){
- return;
- }
- map[cell_id].pheromone = map[cell_id].result;
- map[cell_id].result = 0;
- map[cell_id].population = 0;
- }
|