fix: GLint uniform location instead of GLuint
This commit is contained in:
+10
-10
@@ -24,7 +24,7 @@
|
||||
#include <GLFW/glfw3native.h>
|
||||
#endif /* VIDEO_IN */
|
||||
|
||||
static const GLuint unused_uniform = (GLuint)-1;
|
||||
static const GLint UNUSED_UNIFORM = -1;
|
||||
|
||||
static bool check_glerror_ro(const char *context) {
|
||||
unsigned int code;
|
||||
@@ -666,27 +666,27 @@ static void update_viewport(ShaderProgram *program, const Context *context) {
|
||||
}
|
||||
}
|
||||
|
||||
static void write_uniform_1f(GLuint location, float value) {
|
||||
if (location != unused_uniform) {
|
||||
static void write_uniform_1f(GLint location, float value) {
|
||||
if (location != UNUSED_UNIFORM) {
|
||||
glUniform1f(location, value);
|
||||
}
|
||||
}
|
||||
|
||||
static void write_uniform_1i(GLuint location, unsigned int value) {
|
||||
if (location != unused_uniform) {
|
||||
static void write_uniform_1i(GLint location, unsigned int value) {
|
||||
if (location != UNUSED_UNIFORM) {
|
||||
glUniform1i(location, (const GLint)value);
|
||||
}
|
||||
}
|
||||
|
||||
static void write_uniform_2f(GLuint location, const vec2 *value) {
|
||||
if (location != unused_uniform) {
|
||||
static void write_uniform_2f(GLint location, const vec2 *value) {
|
||||
if (location != UNUSED_UNIFORM) {
|
||||
glUniform2fv(location, 1, (const GLfloat *)value);
|
||||
}
|
||||
}
|
||||
|
||||
static void write_uniform_multi_3f(GLuint location, unsigned int count,
|
||||
static void write_uniform_multi_3f(GLint location, unsigned int count,
|
||||
const vec3 *value) {
|
||||
if (location != unused_uniform) {
|
||||
if (location != UNUSED_UNIFORM) {
|
||||
glUniform3fv(location, count, (const GLfloat *)value);
|
||||
}
|
||||
}
|
||||
@@ -774,7 +774,7 @@ static void use_program(const ShaderProgram *program, int i, bool output,
|
||||
if (program->sub_locations[i * program->sub_variant_count *
|
||||
program->sub_type_count +
|
||||
j * program->sub_variant_count + k] !=
|
||||
unused_uniform) {
|
||||
UNUSED_UNIFORM) {
|
||||
subroutines[subcount++] =
|
||||
program->sub_locations[i * program->sub_variant_count *
|
||||
program->sub_type_count +
|
||||
|
||||
Reference in New Issue
Block a user