Skip to content

Commit

Permalink
Shadertoy: fix harmless OpenGL error
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Jun 3, 2016
1 parent 9e58da5 commit 8523da7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Shadertoy/ShadertoyRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,10 +826,8 @@ ShadertoyPlugin::RENDERFUNC(const OFX::RenderArguments &args)

std::vector<OFX::BitDepthEnum> srcBitDepth(NBINPUTS, OFX::eBitDepthNone);
std::vector<OFX::PixelComponentEnum> srcComponents(NBINPUTS, OFX::ePixelComponentNone);
# ifdef USE_OPENGL
std::vector<GLenum> srcTarget(NBINPUTS, GL_TEXTURE_2D);
std::vector<GLuint> srcIndex(NBINPUTS);
std::vector<GLenum> srcTarget(NBINPUTS);
# endif
#ifdef USE_OSMESA
GLenum format = 0;
GLint depthBits = 0;
Expand Down Expand Up @@ -1063,8 +1061,6 @@ ShadertoyPlugin::RENDERFUNC(const OFX::RenderArguments &args)
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
// Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the GL_ARB_texture_non_power_of_two extension. (Mesa does, of course)

std::vector<GLenum> srcTarget(4, GL_TEXTURE_2D);
std::vector<GLuint> srcIndex(NBINPUTS);
glActiveTexture(GL_TEXTURE0);
for (unsigned i = 0; i < NBINPUTS; ++i) {
if ( src[i].get() && (shadertoy->iChannelLoc[i] >= 0) ) {
Expand Down Expand Up @@ -1293,7 +1289,7 @@ ShadertoyPlugin::RENDERFUNC(const OFX::RenderArguments &args)
for (unsigned i = 0; i < NBINPUTS; ++i) {
if (shadertoy->iChannelLoc[i] >= 0) {
glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(srcTarget[i], 0);
}
}
glCheckError();
Expand Down

0 comments on commit 8523da7

Please sign in to comment.