Skip to content

Commit

Permalink
Make GLSL go upside down properly
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Mar 1, 2025
1 parent 939bd5e commit 343d8e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sources/backends/glsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ static void write_functions(char *code, size_t *offset, shader_stage stage, type
*offset += sprintf(&code[*offset], "gl_Position.x = _%" PRIu64 ".%s.x;\n", o->op_return.var.index, get_name(t->members.m[0].name));
indent(code, offset, indentation + 1);
*offset +=
sprintf(&code[*offset], "gl_Position.y = 1.0 - _%" PRIu64 ".%s.y;\n", o->op_return.var.index, get_name(t->members.m[0].name));
sprintf(&code[*offset], "gl_Position.y = -1.0 * _%" PRIu64 ".%s.y;\n", o->op_return.var.index, get_name(t->members.m[0].name));
indent(code, offset, indentation + 1);
*offset +=
sprintf(&code[*offset], "gl_Position.z = (_%" PRIu64 ".%s.z * 2.0) - _%" PRIu64 ".%s.w; // OpenGL clip space z is from -w to w\n",
Expand Down

0 comments on commit 343d8e7

Please sign in to comment.