Cubyz/assets/cubyz/shaders/animation_pre_processing.comp
IntegratedQuantum c04819c5af
Compile shaders in the CI, to validate that their syntax is correct (#1427)
* Move to glslang's convention for shader file suffix

* Update ci.yml

* Oops, a mistake in the shader, how could that happen?

* Does the command error on its own?

* Update ci.yml

* Revert "Oops, a mistake in the shader, how could that happen?"

This reverts commit 869c3323f3d3b5fa607b40e7847c389a12b01f33.

* Update ci.yml
2025-05-10 12:32:51 +02:00

28 lines
632 B
Plaintext

#version 460
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
struct AnimationData {
uint startFrame;
uint frames;
uint time;
};
layout(std430, binding = 0) buffer _animation
{
AnimationData animation[];
};
layout(std430, binding = 1) buffer _animatedTexture
{
float animatedTexture[];
};
layout(location = 0) uniform uint time;
layout(location = 1) uniform uint size;
void main() {
uint textureIndex = gl_GlobalInvocationID.x;
if(textureIndex >= size) return;
animatedTexture[textureIndex] = animation[textureIndex].startFrame + time / animation[textureIndex].time % animation[textureIndex].frames;
}