diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-25 13:56:42 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-25 13:56:42 +0000 |
commit | 408a146a4e9ab50bbb481754987cbe66230c2c3d (patch) | |
tree | 1d286a3304f32f3fb43d39fca66fa25d73b0b37b | |
parent | fdabc5f2d6bbe25ddbfb1de3ae35f04223eeb5e7 (diff) |
texture units do not need to be explicitly enabled when using a fragment
program.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16583 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libvo/gl_common.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 7031890be7..91c2981e57 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -644,23 +644,21 @@ void glSetupYUVConversion(int type, float brightness, float contrast, */ void inline glEnableYUVConversion(GLenum target, int type) { if (type <= 0) return; - ActiveTexture(GL_TEXTURE1); - glEnable(target); - ActiveTexture(GL_TEXTURE2); - glEnable(target); switch (type) { case YUV_CONVERSION_COMBINERS: + ActiveTexture(GL_TEXTURE1); + glEnable(target); + ActiveTexture(GL_TEXTURE2); + glEnable(target); + ActiveTexture(GL_TEXTURE0); glEnable(GL_REGISTER_COMBINERS_NV); break; case YUV_CONVERSION_FRAGMENT_LOOKUP: - ActiveTexture(GL_TEXTURE3); - glEnable(GL_TEXTURE_2D); case YUV_CONVERSION_FRAGMENT_POW: case YUV_CONVERSION_FRAGMENT: glEnable(GL_FRAGMENT_PROGRAM); break; } - ActiveTexture(GL_TEXTURE0); } /** @@ -670,23 +668,21 @@ void inline glEnableYUVConversion(GLenum target, int type) { */ void inline glDisableYUVConversion(GLenum target, int type) { if (type <= 0) return; - ActiveTexture(GL_TEXTURE1); - glDisable(target); - ActiveTexture(GL_TEXTURE2); - glDisable(target); switch (type) { case YUV_CONVERSION_COMBINERS: + ActiveTexture(GL_TEXTURE1); + glDisable(target); + ActiveTexture(GL_TEXTURE2); + glDisable(target); + ActiveTexture(GL_TEXTURE0); glDisable(GL_REGISTER_COMBINERS_NV); break; case YUV_CONVERSION_FRAGMENT_LOOKUP: - ActiveTexture(GL_TEXTURE3); - glDisable(GL_TEXTURE_2D); case YUV_CONVERSION_FRAGMENT_POW: case YUV_CONVERSION_FRAGMENT: glDisable(GL_FRAGMENT_PROGRAM); break; } - ActiveTexture(GL_TEXTURE0); } /** |