fix: GLint uniform location instead of GLuint
This commit is contained in:
+10
-10
@@ -24,7 +24,7 @@
|
|||||||
#include <GLFW/glfw3native.h>
|
#include <GLFW/glfw3native.h>
|
||||||
#endif /* VIDEO_IN */
|
#endif /* VIDEO_IN */
|
||||||
|
|
||||||
static const GLuint unused_uniform = (GLuint)-1;
|
static const GLint UNUSED_UNIFORM = -1;
|
||||||
|
|
||||||
static bool check_glerror_ro(const char *context) {
|
static bool check_glerror_ro(const char *context) {
|
||||||
unsigned int code;
|
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) {
|
static void write_uniform_1f(GLint location, float value) {
|
||||||
if (location != unused_uniform) {
|
if (location != UNUSED_UNIFORM) {
|
||||||
glUniform1f(location, value);
|
glUniform1f(location, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_uniform_1i(GLuint location, unsigned int value) {
|
static void write_uniform_1i(GLint location, unsigned int value) {
|
||||||
if (location != unused_uniform) {
|
if (location != UNUSED_UNIFORM) {
|
||||||
glUniform1i(location, (const GLint)value);
|
glUniform1i(location, (const GLint)value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_uniform_2f(GLuint location, const vec2 *value) {
|
static void write_uniform_2f(GLint location, const vec2 *value) {
|
||||||
if (location != unused_uniform) {
|
if (location != UNUSED_UNIFORM) {
|
||||||
glUniform2fv(location, 1, (const GLfloat *)value);
|
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) {
|
const vec3 *value) {
|
||||||
if (location != unused_uniform) {
|
if (location != UNUSED_UNIFORM) {
|
||||||
glUniform3fv(location, count, (const GLfloat *)value);
|
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 *
|
if (program->sub_locations[i * program->sub_variant_count *
|
||||||
program->sub_type_count +
|
program->sub_type_count +
|
||||||
j * program->sub_variant_count + k] !=
|
j * program->sub_variant_count + k] !=
|
||||||
unused_uniform) {
|
UNUSED_UNIFORM) {
|
||||||
subroutines[subcount++] =
|
subroutines[subcount++] =
|
||||||
program->sub_locations[i * program->sub_variant_count *
|
program->sub_locations[i * program->sub_variant_count *
|
||||||
program->sub_type_count +
|
program->sub_type_count +
|
||||||
|
|||||||
+21
-21
@@ -100,34 +100,34 @@ typedef struct ShaderProgram {
|
|||||||
GLuint frame_buffers[ARRAY_SIZE];
|
GLuint frame_buffers[ARRAY_SIZE];
|
||||||
GLuint fragment_shaders[ARRAY_SIZE];
|
GLuint fragment_shaders[ARRAY_SIZE];
|
||||||
|
|
||||||
GLuint itime_locations[ARRAY_SIZE];
|
GLint itime_locations[ARRAY_SIZE];
|
||||||
GLuint itempo_locations[ARRAY_SIZE];
|
GLint itempo_locations[ARRAY_SIZE];
|
||||||
GLuint ibeats_locations[ARRAY_SIZE];
|
GLint ibeats_locations[ARRAY_SIZE];
|
||||||
GLuint ifps_locations[ARRAY_SIZE];
|
GLint ifps_locations[ARRAY_SIZE];
|
||||||
GLuint ires_locations[ARRAY_SIZE];
|
GLint ires_locations[ARRAY_SIZE];
|
||||||
GLuint itexres_locations[ARRAY_SIZE];
|
GLint itexres_locations[ARRAY_SIZE];
|
||||||
GLuint iinres_locations[ARRAY_SIZE];
|
GLint iinres_locations[ARRAY_SIZE];
|
||||||
GLuint iinfmt_locations[ARRAY_SIZE];
|
GLint iinfmt_locations[ARRAY_SIZE];
|
||||||
GLuint iinfps_locations[ARRAY_SIZE];
|
GLint iinfps_locations[ARRAY_SIZE];
|
||||||
GLuint idemo_locations[ARRAY_SIZE];
|
GLint idemo_locations[ARRAY_SIZE];
|
||||||
GLuint iautorand_locations[ARRAY_SIZE];
|
GLint iautorand_locations[ARRAY_SIZE];
|
||||||
GLuint iautorandcycle_locations[ARRAY_SIZE];
|
GLint iautorandcycle_locations[ARRAY_SIZE];
|
||||||
GLuint iseed_locations[ARRAY_SIZE];
|
GLint iseed_locations[ARRAY_SIZE];
|
||||||
GLuint istate_locations[ARRAY_SIZE];
|
GLint istate_locations[ARRAY_SIZE];
|
||||||
GLuint ipage_locations[ARRAY_SIZE];
|
GLint ipage_locations[ARRAY_SIZE];
|
||||||
GLuint iselected_locations[ARRAY_SIZE];
|
GLint iselected_locations[ARRAY_SIZE];
|
||||||
GLuint iactive_locations[ARRAY_SIZE];
|
GLint iactive_locations[ARRAY_SIZE];
|
||||||
|
|
||||||
UintArray midi_lengths;
|
UintArray midi_lengths;
|
||||||
GLuint igroup_locations[ARRAY_SIZE];
|
GLint igroup_locations[ARRAY_SIZE];
|
||||||
|
|
||||||
GLuint vpos_locations[ARRAY_SIZE];
|
GLint vpos_locations[ARRAY_SIZE];
|
||||||
|
|
||||||
GLuint textures_locations[ARRAY_SIZE];
|
GLint textures_locations[ARRAY_SIZE];
|
||||||
|
|
||||||
unsigned int sub_type_count;
|
unsigned int sub_type_count;
|
||||||
unsigned int sub_variant_count;
|
unsigned int sub_variant_count;
|
||||||
GLuint sub_locations[ARRAY_SIZE];
|
GLint sub_locations[ARRAY_SIZE];
|
||||||
|
|
||||||
unsigned int active_count;
|
unsigned int active_count;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user