17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 03:27:30 +01:00
Files
maszyna/shaders/vk14/water_clear.comp
2026-10-26 15:51:56 +01:00

22 lines
749 B
Plaintext

#version 460 core
#define STAGE_COMPUTE 1
// the water on the windscreens (water_sim.glsl): the counts of the cells of the grids emptied before the drops are put in them
// (water_grid.comp). a thread per cell, a row of groups per glass
// none of the pass set: everything the kernel reads is pushed with its dispatch (set COMPUTE_SET, water_sim.glsl), so it runs
// before the passes of the frame set theirs up
#define LAYOUT_UI 1
#include "common.glsl"
#include "water_sim.glsl"
layout(local_size_x = WATER_GROUP_SIZE) in;
void main()
{
uint slot = gl_WorkGroupID.y;
uint cell = gl_GlobalInvocationID.x;
if ((water_slots[slot].z < 0.5) || (cell >= uint(WATER_GRID * WATER_GRID)))
return;
water_cells[water_grid_base(slot) + cell] = 0u;
}