opengl: replace all texture2Ds with texture

No idea how this passed through the cracks but oh well
This commit is contained in:
itsmattkc
2022-03-24 09:30:53 -07:00
parent a4056d8454
commit a8bb3a9880
16 changed files with 26 additions and 26 deletions
+2 -2
View File
@@ -48,7 +48,7 @@ ShaderCode MathNodeBase::GetShaderCodeInternal(const QString &shader_id, const Q
const QString& mat_in = (type_a == NodeValue::kTexture) ? param_b_in : param_a_in;
// No-op frag shader (can we return QString() instead?)
operation = QStringLiteral("texture2D(%1, ove_texcoord)").arg(tex_in);
operation = QStringLiteral("texture(%1, ove_texcoord)").arg(tex_in);
vert = QStringLiteral("uniform mat4 %1;\n"
"\n"
@@ -130,7 +130,7 @@ QString MathNodeBase::GetShaderUniformType(const olive::NodeValue::Type &type)
QString MathNodeBase::GetShaderVariableCall(const QString &input_id, const NodeValue::Type &type, const QString& coord_op)
{
if (type == NodeValue::kTexture) {
return QStringLiteral("texture2D(%1, ove_texcoord%2)").arg(input_id, coord_op);
return QStringLiteral("texture(%1, ove_texcoord%2)").arg(input_id, coord_op);
}
return input_id;
+2 -2
View File
@@ -64,7 +64,7 @@ void main(void) {
int mode = determine_mode();
if (mode == MODE_NONE) {
frag_color = texture2D(tex_in, ove_texcoord);
frag_color = texture(tex_in, ove_texcoord);
return;
}
@@ -116,7 +116,7 @@ void main(void) {
&& pixel_coord.x < 1.0
&& pixel_coord.y >= 0.0
&& pixel_coord.y < 1.0)) {
composite += texture2D(tex_in, pixel_coord) * weight;
composite += texture(tex_in, pixel_coord) * weight;
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ void main() {
return;
}
vec4 col = texture2D(ove_maintex, cropped_coord);
vec4 col = texture(ove_maintex, cropped_coord);
// If alpha is associated, de-associate now
if (ove_maintex_alpha == ALPHA_ASSOC) {
+2 -2
View File
@@ -18,7 +18,7 @@ float Wedge2D(vec2 v, vec2 w) {
void main() {
if(perspective_in){
frag_color = texture2D(tex_in, ove_texcoord);
frag_color = texture(tex_in, ove_texcoord);
} else {
float A = Wedge2D(b2, b3);
float B = Wedge2D(b3, q) - Wedge2D(b1, b2);
@@ -44,6 +44,6 @@ void main() {
uv.y = 1.0 - uv.y;
frag_color = texture2D(tex_in, uv);
frag_color = texture(tex_in, uv);
}
}
+1 -1
View File
@@ -45,7 +45,7 @@ void main() {
}
if (multiplier > 0.0) {
vec4 color = texture2D(tex_in, ove_texcoord) * multiplier;
vec4 color = texture(tex_in, ove_texcoord) * multiplier;
frag_color = color;
} else {
frag_color = vec4(0.0);
+2 -2
View File
@@ -27,11 +27,11 @@ void main(void) {
vec4 composite = vec4(0.0);
if (out_block_in_enabled) {
composite += texture2D(out_block_in, ove_texcoord) * TransformCurve(1.0 - ove_tprog_all);
composite += texture(out_block_in, ove_texcoord) * TransformCurve(1.0 - ove_tprog_all);
}
if (in_block_in_enabled) {
composite += texture2D(in_block_in, ove_texcoord) * TransformCurve(ove_tprog_all);
composite += texture(in_block_in, ove_texcoord) * TransformCurve(ove_tprog_all);
}
frag_color = composite;
+1 -1
View File
@@ -6,6 +6,6 @@ in vec2 ove_texcoord;
out vec4 frag_color;
void main() {
vec4 color = texture2D(ove_maintex, ove_texcoord);
vec4 color = texture(ove_maintex, ove_texcoord);
frag_color = color;
}
+1 -1
View File
@@ -19,6 +19,6 @@ void main() {
float half_vert = round(resolution_in.y / 2.0);
using_texcoord.y = (round(using_texcoord.y * half_vert) + 0.25) / half_vert;
vec4 color = texture2D(ove_maintex, using_texcoord);
vec4 color = texture(ove_maintex, using_texcoord);
frag_color = color;
}
+4 -4
View File
@@ -13,14 +13,14 @@ out vec4 frag_color;
void main(void) {
if (out_block_in_enabled && in_block_in_enabled) {
vec4 out_block_col = mix(texture2D(out_block_in, ove_texcoord), color_in, ove_tprog_out);
vec4 in_block_col = mix(texture2D(in_block_in, ove_texcoord), color_in, 1.0 - ove_tprog_in);
vec4 out_block_col = mix(texture(out_block_in, ove_texcoord), color_in, ove_tprog_out);
vec4 in_block_col = mix(texture(in_block_in, ove_texcoord), color_in, 1.0 - ove_tprog_in);
frag_color = out_block_col + in_block_col;
} else if (out_block_in_enabled) {
frag_color = mix(texture2D(out_block_in, ove_texcoord), color_in, ove_tprog_all);
frag_color = mix(texture(out_block_in, ove_texcoord), color_in, ove_tprog_all);
} else if (in_block_in_enabled) {
frag_color = mix(texture2D(in_block_in, ove_texcoord), color_in, 1.0 - ove_tprog_all);
frag_color = mix(texture(in_block_in, ove_texcoord), color_in, 1.0 - ove_tprog_all);
} else {
frag_color = vec4(0.0);
}
+2 -2
View File
@@ -7,7 +7,7 @@ out vec4 frag_color;
void main(void) {
if (!horiz_in && !vert_in) {
frag_color = texture2D(tex_in, ove_texcoord);
frag_color = texture(tex_in, ove_texcoord);
return;
}
@@ -16,5 +16,5 @@ void main(void) {
if (horiz_in) new_coord.x = 1.0 - new_coord.x;
if (vert_in) new_coord.y = 1.0 - new_coord.y;
frag_color = texture2D(tex_in, new_coord);
frag_color = texture(tex_in, new_coord);
}
+2 -2
View File
@@ -9,8 +9,8 @@ void main() {
float y_pixel = floor(ove_texcoord.y * resolution_in.y);
if (mod(y_pixel, 2.0) == 0.0) {
frag_color = texture2D(top_tex_in, ove_texcoord);
frag_color = texture(top_tex_in, ove_texcoord);
} else {
frag_color = texture2D(bottom_tex_in, ove_texcoord);
frag_color = texture(bottom_tex_in, ove_texcoord);
}
}
+1 -1
View File
@@ -24,6 +24,6 @@ void main() {
y = ove_texcoord.y;
}
vec4 color = texture2D(tex_in, vec2(x, y));
vec4 color = texture(tex_in, vec2(x, y));
frag_color = color;
}
+1 -1
View File
@@ -14,7 +14,7 @@ void main(void) {
for (int i = 0; float(i) < histogram_width; i++) {
ratio = float(i) / float(histogram_width - 1.0);
cur_col = texture2D(
cur_col = texture(
ove_maintex,
vec2(ove_texcoord.y, ratio)
).rgb;
+1 -1
View File
@@ -18,7 +18,7 @@ void main(void) {
for (int i = 0; float(i) < histogram_height; i++) {
ratio = float(i) / float(histogram_height - 1.0);
sum += texture2D(
sum += texture(
ove_maintex,
vec2(ove_texcoord.x, ratio)
).rgb;
+1 -1
View File
@@ -18,7 +18,7 @@ void main(void) {
for (int i = 0; float(i) < waveform_height; i++) {
ratio = float(i) / float(waveform_height - 1.0);
cur_col.rgb = texture2D(
cur_col.rgb = texture(
ove_maintex,
vec2(ove_texcoord.x, ratio)
).rgb;
+2 -2
View File
@@ -13,7 +13,7 @@ in vec2 ove_texcoord;
out vec4 frag_color;
void main(void) {
vec4 pixel_here = texture2D(tex_in, ove_texcoord);
vec4 pixel_here = texture(tex_in, ove_texcoord);
// Detect no-op situations
if (radius_in == 0.0
@@ -38,7 +38,7 @@ void main(void) {
if (abs(length(vec2(i, j))) < radius) {
// Get pixel here
float alpha = texture2D(tex_in, ove_texcoord + vec2(x_coord, y_coord)).a;
float alpha = texture(tex_in, ove_texcoord + vec2(x_coord, y_coord)).a;
if (inner_in) {
alpha = 1.0 - alpha;