perf: optimize text rendering performance

This commit is contained in:
2026-03-28 16:22:38 +08:00
parent c37c45ad19
commit a7c42f249d
6 changed files with 89 additions and 47 deletions

View File

@@ -1,12 +1,14 @@
#version 460
in vec2 texCoord;
out vec4 color;
in vec2 tc;
flat in int tex_layer;
layout (binding = 0) uniform sampler2D text;
layout (binding = 0) uniform sampler2DArray text;
uniform vec3 textColor;
out vec4 color;
void main(void) {
vec4 smapled = vec4(1.0, 1.0, 1.0, texture(text, texCoord).r);
vec4 smapled = vec4(1.0, 1.0, 1.0, texture(text, vec3(tc, tex_layer)).r);
color = vec4(textColor, 1.0) * smapled;
}