summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bbbbe70)
Previously, the code was mapping locations returned by
glGetUniformLocation and looking in the location map to try ot
determine which program to link in a glUniform1i call. This was
entirely bogus, as distinct programs do not have distinct location
spaces.
The correct answer is to simply track the currently active program and
link it to textures being bound to shaders.
/* Maps for tracking OpenGL state. */
std::map<GLenum, unsigned> texture_map;
/* Maps for tracking OpenGL state. */
std::map<GLenum, unsigned> texture_map;
- std::map<GLint, GLuint> location_program_map;
/* The final set of calls required. This consists of calls added
* explicitly with the require() method as well as all calls
/* The final set of calls required. This consists of calls added
* explicitly with the require() method as well as all calls
bool transformFeedbackActive;
bool framebufferObjectActive;
bool insideBeginEnd;
bool transformFeedbackActive;
bool framebufferObjectActive;
bool insideBeginEnd;
/* Rendering often has no side effects, but it can in some cases,
* (such as when transform feedback is active, or when rendering
/* Rendering often has no side effects, but it can in some cases,
* (such as when transform feedback is active, or when rendering
+ if (strcmp(name, "glUseProgram") == 0) {
+ activeProgram = call->arg(0).toUInt();
+ }
+
if (strcmp(name, "glBindFramebuffer") == 0) {
GLenum target;
GLuint framebuffer;
if (strcmp(name, "glBindFramebuffer") == 0) {
GLenum target;
GLuint framebuffer;
strcmp(name, "glGetVaryingLocationNV") == 0) {
GLuint program;
strcmp(name, "glGetVaryingLocationNV") == 0) {
GLuint program;
std::stringstream ss;
program = call->arg(0).toUInt();
std::stringstream ss;
program = call->arg(0).toUInt();
- location = call->ret->toSInt();
-
- location_program_map[location] = program;
ss << "program-" << program;
ss << "program-" << program;
if (call->sig->num_args > 0 &&
strcmp(call->sig->arg_names[0], "location") == 0) {
if (call->sig->num_args > 0 &&
strcmp(call->sig->arg_names[0], "location") == 0) {
- GLuint program;
- GLint location;
- location = call->arg(0).toSInt();
-
- program = location_program_map[location];
-
- ss << "program-" << program;
+ ss << "program-" << activeProgram;
provide(ss.str(), call->no);
provide(ss.str(), call->no);