port: remove remnants of masked/blended texture support

This commit is contained in:
fgsfds committed 2024-05-12 16:48:33 +02:00
1 parent ce6424117e
commit dca1e1752b
4 files changed
+3 -95

No files matched your search

+1 -50
View File
@@ -373,18 +373,6 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
if (cc_features.used_textures[1]) {
append_line(fs_buf, &fs_len, "uniform sampler2D uTex1;");
}
if (cc_features.used_masks[0]) {
append_line(fs_buf, &fs_len, "uniform sampler2D uTexMask0;");
}
if (cc_features.used_masks[1]) {
append_line(fs_buf, &fs_len, "uniform sampler2D uTexMask1;");
}
if (cc_features.used_blend[0]) {
append_line(fs_buf, &fs_len, "uniform sampler2D uTexBlend0;");
}
if (cc_features.used_blend[1]) {
append_line(fs_buf, &fs_len, "uniform sampler2D uTexBlend1;");
}
append_line(fs_buf, &fs_len, "uniform int frame_count;");
append_line(fs_buf, &fs_len, "uniform float noise_scale;");
@@ -473,24 +461,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
}
}
fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = hookTexture2D(uTex%d, vTexCoordAdj%d, texSize%d);\n", i,
i, i, i);
if (cc_features.used_masks[i]) {
fs_len += sprintf(fs_buf + fs_len, "vec2 maskSize%d = textureSize(uTexMask%d, 0);\n", i, i);
fs_len +=
sprintf(fs_buf + fs_len,
"vec4 maskVal%d = hookTexture2D(uTexMask%d, vTexCoordAdj%d, maskSize%d);\n", i, i, i, i);
if (cc_features.used_blend[i]) {
fs_len += sprintf(fs_buf + fs_len,
"vec4 blendVal%d = hookTexture2D(uTexBlend%d, vTexCoordAdj%d, texSize%d);\n", i,
i, i, i);
} else {
fs_len += sprintf(fs_buf + fs_len, "vec4 blendVal%d = vec4(0, 0, 0, 0);\n", i);
}
fs_len += sprintf(fs_buf + fs_len, "texVal%d = mix(texVal%d, blendVal%d, maskVal%d.a);\n", i, i, i, i);
}
fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = hookTexture2D(uTex%d, vTexCoordAdj%d, texSize%d);\n", i, i, i, i);
}
}
@@ -653,10 +624,6 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
prg->num_inputs = cc_features.num_inputs;
prg->used_textures[0] = cc_features.used_textures[0];
prg->used_textures[1] = cc_features.used_textures[1];
prg->used_textures[2] = cc_features.used_masks[0];
prg->used_textures[3] = cc_features.used_masks[1];
prg->used_textures[4] = cc_features.used_blend[0];
prg->used_textures[5] = cc_features.used_blend[1];
prg->num_floats = num_floats;
prg->num_attribs = cnt;
@@ -670,22 +637,6 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad
GLint sampler_location = glGetUniformLocation(shader_program, "uTex1");
glUniform1i(sampler_location, 1);
}
if (cc_features.used_masks[0]) {
GLint sampler_location = glGetUniformLocation(shader_program, "uTexMask0");
glUniform1i(sampler_location, 2);
}
if (cc_features.used_masks[1]) {
GLint sampler_location = glGetUniformLocation(shader_program, "uTexMask1");
glUniform1i(sampler_location, 3);
}
if (cc_features.used_blend[0]) {
GLint sampler_location = glGetUniformLocation(shader_program, "uTexBlend0");
glUniform1i(sampler_location, 4);
}
if (cc_features.used_blend[1]) {
GLint sampler_location = glGetUniformLocation(shader_program, "uTexBlend1");
glUniform1i(sampler_location, 5);
}
prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count");
prg->noise_scale_location = glGetUniformLocation(shader_program, "noise_scale");