1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-14 10:55:43 +00:00

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
This commit is contained in:
reimar 2005-09-25 13:56:42 +00:00
parent fdabc5f2d6
commit 408a146a4e

View File

@ -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);
}
/**