Files
spark/src/shaders/computeVec4.glsl
T
Diego Marcos 3332f609a9 Initial commit
2025-05-24 00:14:53 -07:00

37 lines
841 B
GLSL

precision highp float;
precision highp int;
precision highp sampler2D;
precision highp usampler2D;
precision highp isampler2D;
precision highp sampler2DArray;
precision highp usampler2DArray;
precision highp isampler2DArray;
precision highp sampler3D;
precision highp usampler3D;
precision highp isampler3D;
#include <splatDefines>
uniform uint targetLayer;
uniform int targetBase;
uniform int targetCount;
out vec4 target;
{{ GLOBALS }}
void computeReadback(int index) {
{{ STATEMENTS }}
}
void main() {
int targetIndex = int(targetLayer << SPLAT_TEX_LAYER_BITS) + int(uint(gl_FragCoord.y) << SPLAT_TEX_WIDTH_BITS) + int(gl_FragCoord.x);
int index = targetIndex - targetBase;
if ((index >= 0) && (index < targetCount)) {
computeReadback(index);
} else {
target = vec4(0.0, 0.0, 0.0, 0.0);
}
}