diff options
Diffstat (limited to 'linden/indra/llwindow/llgl.cpp')
-rw-r--r-- | linden/indra/llwindow/llgl.cpp | 146 |
1 files changed, 65 insertions, 81 deletions
diff --git a/linden/indra/llwindow/llgl.cpp b/linden/indra/llwindow/llgl.cpp index aabe9da..07348b7 100644 --- a/linden/indra/llwindow/llgl.cpp +++ b/linden/indra/llwindow/llgl.cpp | |||
@@ -1,9 +1,10 @@ | |||
1 | /** | 1 | /** |
2 | * @file llgl.cpp | 2 | * @file llgl.cpp |
3 | * @brief LLGL implementation | 3 | * @brief LLGL implementation |
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -44,8 +45,6 @@ | |||
44 | 45 | ||
45 | #include "llglheaders.h" | 46 | #include "llglheaders.h" |
46 | 47 | ||
47 | #define LL_DEBUG_GL 1 | ||
48 | |||
49 | #if LL_LINUX && !LL_MESA_HEADLESS | 48 | #if LL_LINUX && !LL_MESA_HEADLESS |
50 | // The __APPLE__ hack is to make glh_extensions.h not symbol-clash horribly | 49 | // The __APPLE__ hack is to make glh_extensions.h not symbol-clash horribly |
51 | # define __APPLE__ | 50 | # define __APPLE__ |
@@ -123,6 +122,25 @@ PFNGLGETQUERYOBJECTUIVARBPROC glGetQueryObjectuivARB = NULL; | |||
123 | PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB = NULL; | 122 | PFNGLPOINTPARAMETERFARBPROC glPointParameterfARB = NULL; |
124 | PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB = NULL; | 123 | PFNGLPOINTPARAMETERFVARBPROC glPointParameterfvARB = NULL; |
125 | 124 | ||
125 | // GL_EXT_framebuffer_object | ||
126 | PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT = NULL; | ||
127 | PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT = NULL; | ||
128 | PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT = NULL; | ||
129 | PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT = NULL; | ||
130 | PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT = NULL; | ||
131 | PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT = NULL; | ||
132 | PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT = NULL; | ||
133 | PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT = NULL; | ||
134 | PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT = NULL; | ||
135 | PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = NULL; | ||
136 | PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT = NULL; | ||
137 | PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT = NULL; | ||
138 | PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT = NULL; | ||
139 | PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT = NULL; | ||
140 | PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT = NULL; | ||
141 | PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT = NULL; | ||
142 | PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT = NULL; | ||
143 | |||
126 | //shader object prototypes | 144 | //shader object prototypes |
127 | PFNGLDELETEOBJECTARBPROC glDeleteObjectARB = NULL; | 145 | PFNGLDELETEOBJECTARBPROC glDeleteObjectARB = NULL; |
128 | PFNGLGETHANDLEARBPROC glGetHandleARB = NULL; | 146 | PFNGLGETHANDLEARBPROC glGetHandleARB = NULL; |
@@ -253,17 +271,10 @@ LLGLManager::LLGLManager() | |||
253 | mIsDisabled = FALSE; | 271 | mIsDisabled = FALSE; |
254 | mHasCubeMap = FALSE; | 272 | mHasCubeMap = FALSE; |
255 | mHasMultitexture = FALSE; | 273 | mHasMultitexture = FALSE; |
256 | mHasAnyAGP = FALSE; | ||
257 | mHasMipMapGeneration = FALSE; | 274 | mHasMipMapGeneration = FALSE; |
258 | mHasAnisotropic = FALSE; | 275 | mHasAnisotropic = FALSE; |
259 | mHasCompressedTextures = FALSE; | 276 | mHasCompressedTextures = FALSE; |
260 | mHasNVVertexArrayRange = FALSE; | ||
261 | mHasNVFence = FALSE; | ||
262 | mHasARBEnvCombine = FALSE; | 277 | mHasARBEnvCombine = FALSE; |
263 | mHasATIVAO = FALSE; | ||
264 | mIsRadeon8500 = FALSE; | ||
265 | mIsRadeon9700 = FALSE; | ||
266 | mIsMobilityRadeon9000 = FALSE; | ||
267 | mIsGF2or4MX = FALSE; | 278 | mIsGF2or4MX = FALSE; |
268 | mIsGF3 = FALSE; | 279 | mIsGF3 = FALSE; |
269 | mIsGFFX = FALSE; | 280 | mIsGFFX = FALSE; |
@@ -377,31 +388,8 @@ bool LLGLManager::initGL() | |||
377 | mobile = TRUE; | 388 | mobile = TRUE; |
378 | } | 389 | } |
379 | mIsATI = TRUE; | 390 | mIsATI = TRUE; |
380 | if ( mGLRenderer.find("9500") != LLString::npos | ||
381 | || mGLRenderer.find("9600") != LLString::npos | ||
382 | || mGLRenderer.find("9700") != LLString::npos | ||
383 | || mGLRenderer.find("9800") != LLString::npos ) | ||
384 | { | ||
385 | mIsRadeon9700 = TRUE; | ||
386 | } | ||
387 | else if (mGLRenderer.find("8500") != LLString::npos | ||
388 | || mGLRenderer.find( "9000") != LLString::npos | ||
389 | || mGLRenderer.find("9100") != LLString::npos | ||
390 | || mGLRenderer.find("9200") != LLString::npos) | ||
391 | { | ||
392 | mIsRadeon8500 = TRUE; | ||
393 | if (mobile && mGLRenderer.find("9000") != LLString::npos) | ||
394 | { | ||
395 | mIsMobilityRadeon9000 = TRUE; | ||
396 | } | ||
397 | } | ||
398 | 391 | ||
399 | #if LL_WINDOWS && !LL_MESA_HEADLESS | 392 | #if LL_WINDOWS && !LL_MESA_HEADLESS |
400 | if (mIsRadeon9700 && mDriverVersionRelease < 3833) | ||
401 | { | ||
402 | return false; // Unsupported hardware | ||
403 | } | ||
404 | |||
405 | if (mDriverVersionRelease < 3842) | 393 | if (mDriverVersionRelease < 3842) |
406 | { | 394 | { |
407 | mATIOffsetVerticalLines = TRUE; | 395 | mATIOffsetVerticalLines = TRUE; |
@@ -532,14 +520,16 @@ void LLGLManager::initExtensions() | |||
532 | # else | 520 | # else |
533 | mHasVertexBufferObject = FALSE; | 521 | mHasVertexBufferObject = FALSE; |
534 | # endif | 522 | # endif |
523 | # if GL_EXT_framebuffer_object | ||
524 | mHasFramebufferObject = TRUE; | ||
525 | # else | ||
526 | mHasFramebufferObject = FALSE; | ||
527 | # endif | ||
535 | mHasMipMapGeneration = FALSE; | 528 | mHasMipMapGeneration = FALSE; |
536 | mHasPalettedTextures = FALSE; | 529 | mHasPalettedTextures = FALSE; |
537 | mHasNVVertexArrayRange = FALSE; | ||
538 | mHasNVFence = FALSE; | ||
539 | mHasSeparateSpecularColor = FALSE; | 530 | mHasSeparateSpecularColor = FALSE; |
540 | mHasAnisotropic = FALSE; | 531 | mHasAnisotropic = FALSE; |
541 | mHasCubeMap = FALSE; | 532 | mHasCubeMap = FALSE; |
542 | mHasATIVAO = FALSE; | ||
543 | mHasOcclusionQuery = FALSE; | 533 | mHasOcclusionQuery = FALSE; |
544 | mHasPointParameters = FALSE; | 534 | mHasPointParameters = FALSE; |
545 | mHasShaderObjects = FALSE; | 535 | mHasShaderObjects = FALSE; |
@@ -549,17 +539,15 @@ void LLGLManager::initExtensions() | |||
549 | mHasMultitexture = glh_init_extensions("GL_ARB_multitexture"); | 539 | mHasMultitexture = glh_init_extensions("GL_ARB_multitexture"); |
550 | mHasMipMapGeneration = glh_init_extensions("GL_SGIS_generate_mipmap"); | 540 | mHasMipMapGeneration = glh_init_extensions("GL_SGIS_generate_mipmap"); |
551 | mHasPalettedTextures = glh_init_extension("GL_EXT_paletted_texture"); | 541 | mHasPalettedTextures = glh_init_extension("GL_EXT_paletted_texture"); |
552 | mHasNVVertexArrayRange = glh_init_extensions("GL_NV_vertex_array_range"); | ||
553 | mHasNVFence = glh_init_extensions("GL_NV_fence"); | ||
554 | mHasSeparateSpecularColor = glh_init_extensions("GL_EXT_separate_specular_color"); | 542 | mHasSeparateSpecularColor = glh_init_extensions("GL_EXT_separate_specular_color"); |
555 | mHasAnisotropic = glh_init_extensions("GL_EXT_texture_filter_anisotropic"); | 543 | mHasAnisotropic = glh_init_extensions("GL_EXT_texture_filter_anisotropic"); |
556 | glh_init_extensions("GL_ARB_texture_cube_map"); | 544 | glh_init_extensions("GL_ARB_texture_cube_map"); |
557 | mHasCubeMap = ExtensionExists("GL_ARB_texture_cube_map", gGLHExts.mSysExts); | 545 | mHasCubeMap = ExtensionExists("GL_ARB_texture_cube_map", gGLHExts.mSysExts); |
558 | mHasARBEnvCombine = ExtensionExists("GL_ARB_texture_env_combine", gGLHExts.mSysExts); | 546 | mHasARBEnvCombine = ExtensionExists("GL_ARB_texture_env_combine", gGLHExts.mSysExts); |
559 | mHasCompressedTextures = glh_init_extensions("GL_ARB_texture_compression"); | 547 | mHasCompressedTextures = glh_init_extensions("GL_ARB_texture_compression"); |
560 | mHasATIVAO = ExtensionExists("GL_ATI_vertex_array_object", gGLHExts.mSysExts); | ||
561 | mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts); | 548 | mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts); |
562 | mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts); | 549 | mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts); |
550 | mHasFramebufferObject = ExtensionExists("GL_EXT_framebuffer_object", gGLHExts.mSysExts); | ||
563 | #if !LL_DARWIN | 551 | #if !LL_DARWIN |
564 | mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); | 552 | mHasPointParameters = !mIsATI && ExtensionExists("GL_ARB_point_parameters", gGLHExts.mSysExts); |
565 | #endif | 553 | #endif |
@@ -578,14 +566,12 @@ void LLGLManager::initExtensions() | |||
578 | mHasARBEnvCombine = FALSE; | 566 | mHasARBEnvCombine = FALSE; |
579 | mHasCompressedTextures = FALSE; | 567 | mHasCompressedTextures = FALSE; |
580 | mHasVertexBufferObject = FALSE; | 568 | mHasVertexBufferObject = FALSE; |
569 | mHasFramebufferObject = FALSE; | ||
581 | mHasMipMapGeneration = FALSE; | 570 | mHasMipMapGeneration = FALSE; |
582 | mHasPalettedTextures = FALSE; | 571 | mHasPalettedTextures = FALSE; |
583 | mHasNVVertexArrayRange = FALSE; | ||
584 | mHasNVFence = FALSE; | ||
585 | mHasSeparateSpecularColor = FALSE; | 572 | mHasSeparateSpecularColor = FALSE; |
586 | mHasAnisotropic = FALSE; | 573 | mHasAnisotropic = FALSE; |
587 | mHasCubeMap = FALSE; | 574 | mHasCubeMap = FALSE; |
588 | mHasATIVAO = FALSE; | ||
589 | mHasOcclusionQuery = FALSE; | 575 | mHasOcclusionQuery = FALSE; |
590 | mHasPointParameters = FALSE; | 576 | mHasPointParameters = FALSE; |
591 | mHasShaderObjects = FALSE; | 577 | mHasShaderObjects = FALSE; |
@@ -602,11 +588,8 @@ void LLGLManager::initExtensions() | |||
602 | // proper blacklist/whitelist on Linux. | 588 | // proper blacklist/whitelist on Linux. |
603 | mHasMipMapGeneration = FALSE; | 589 | mHasMipMapGeneration = FALSE; |
604 | mHasPalettedTextures = FALSE; | 590 | mHasPalettedTextures = FALSE; |
605 | mHasNVVertexArrayRange = FALSE; | ||
606 | mHasNVFence = FALSE; | ||
607 | mHasAnisotropic = FALSE; | 591 | mHasAnisotropic = FALSE; |
608 | mHasCubeMap = FALSE; // apparently fatal on Intel 915 & similar | 592 | mHasCubeMap = FALSE; // apparently fatal on Intel 915 & similar |
609 | mHasATIVAO = FALSE; | ||
610 | mHasOcclusionQuery = FALSE; // source of many ATI system hangs | 593 | mHasOcclusionQuery = FALSE; // source of many ATI system hangs |
611 | mHasShaderObjects = FALSE; | 594 | mHasShaderObjects = FALSE; |
612 | mHasVertexShader = FALSE; | 595 | mHasVertexShader = FALSE; |
@@ -626,17 +609,18 @@ void LLGLManager::initExtensions() | |||
626 | if (strchr(blacklist,'c')) mHasVertexBufferObject = FALSE; | 609 | if (strchr(blacklist,'c')) mHasVertexBufferObject = FALSE; |
627 | if (strchr(blacklist,'d')) mHasMipMapGeneration = FALSE;//S | 610 | if (strchr(blacklist,'d')) mHasMipMapGeneration = FALSE;//S |
628 | if (strchr(blacklist,'e')) mHasPalettedTextures = FALSE;//S | 611 | if (strchr(blacklist,'e')) mHasPalettedTextures = FALSE;//S |
629 | if (strchr(blacklist,'f')) mHasNVVertexArrayRange = FALSE;//S | 612 | // if (strchr(blacklist,'f')) mHasNVVertexArrayRange = FALSE;//S |
630 | if (strchr(blacklist,'g')) mHasNVFence = FALSE;//S | 613 | // if (strchr(blacklist,'g')) mHasNVFence = FALSE;//S |
631 | if (strchr(blacklist,'h')) mHasSeparateSpecularColor = FALSE; | 614 | if (strchr(blacklist,'h')) mHasSeparateSpecularColor = FALSE; |
632 | if (strchr(blacklist,'i')) mHasAnisotropic = FALSE;//S | 615 | if (strchr(blacklist,'i')) mHasAnisotropic = FALSE;//S |
633 | if (strchr(blacklist,'j')) mHasCubeMap = FALSE;//S | 616 | if (strchr(blacklist,'j')) mHasCubeMap = FALSE;//S |
634 | if (strchr(blacklist,'k')) mHasATIVAO = FALSE;//S | 617 | // if (strchr(blacklist,'k')) mHasATIVAO = FALSE;//S |
635 | if (strchr(blacklist,'l')) mHasOcclusionQuery = FALSE; | 618 | if (strchr(blacklist,'l')) mHasOcclusionQuery = FALSE; |
636 | if (strchr(blacklist,'m')) mHasShaderObjects = FALSE;//S | 619 | if (strchr(blacklist,'m')) mHasShaderObjects = FALSE;//S |
637 | if (strchr(blacklist,'n')) mHasVertexShader = FALSE;//S | 620 | if (strchr(blacklist,'n')) mHasVertexShader = FALSE;//S |
638 | if (strchr(blacklist,'o')) mHasFragmentShader = FALSE;//S | 621 | if (strchr(blacklist,'o')) mHasFragmentShader = FALSE;//S |
639 | if (strchr(blacklist,'p')) mHasPointParameters = FALSE;//S | 622 | if (strchr(blacklist,'p')) mHasPointParameters = FALSE;//S |
623 | if (strchr(blacklist,'q')) mHasFramebufferObject = FALSE;//S | ||
640 | } | 624 | } |
641 | #endif // LL_LINUX | 625 | #endif // LL_LINUX |
642 | 626 | ||
@@ -663,14 +647,6 @@ void LLGLManager::initExtensions() | |||
663 | { | 647 | { |
664 | llinfos << "Couldn't initialize GL_EXT_paletted_texture" << llendl; | 648 | llinfos << "Couldn't initialize GL_EXT_paletted_texture" << llendl; |
665 | } | 649 | } |
666 | if (!mHasNVVertexArrayRange) | ||
667 | { | ||
668 | llinfos << "Couldn't initialize GL_NV_vertex_array_range" << llendl; | ||
669 | } | ||
670 | if (!mHasNVFence) | ||
671 | { | ||
672 | llinfos << "Couldn't initialize GL_NV_fence" << llendl; | ||
673 | } | ||
674 | if (!mHasSeparateSpecularColor) | 650 | if (!mHasSeparateSpecularColor) |
675 | { | 651 | { |
676 | llinfos << "Couldn't initialize separate specular color" << llendl; | 652 | llinfos << "Couldn't initialize separate specular color" << llendl; |
@@ -717,10 +693,6 @@ void LLGLManager::initExtensions() | |||
717 | } | 693 | } |
718 | 694 | ||
719 | // Misc | 695 | // Misc |
720 | if (mHasNVFence || mHasATIVAO) | ||
721 | { | ||
722 | mHasAnyAGP = TRUE; | ||
723 | } | ||
724 | glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); | 696 | glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, (GLint*) &mGLMaxVertexRange); |
725 | glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); | 697 | glGetIntegerv(GL_MAX_ELEMENTS_INDICES, (GLint*) &mGLMaxIndexRange); |
726 | 698 | ||
@@ -744,10 +716,6 @@ void LLGLManager::initExtensions() | |||
744 | llinfos << "Has GL_APPLE_vertex_array_object!" << llendl; | 716 | llinfos << "Has GL_APPLE_vertex_array_object!" << llendl; |
745 | } | 717 | } |
746 | 718 | ||
747 | if(mHasAPPLEFence) | ||
748 | { | ||
749 | mHasAnyAGP = TRUE; | ||
750 | } | ||
751 | #endif // LL_DARWIN | 719 | #endif // LL_DARWIN |
752 | 720 | ||
753 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS | 721 | #if (LL_WINDOWS || LL_LINUX) && !LL_MESA_HEADLESS |
@@ -773,23 +741,25 @@ void LLGLManager::initExtensions() | |||
773 | mHasVertexBufferObject = FALSE; | 741 | mHasVertexBufferObject = FALSE; |
774 | } | 742 | } |
775 | } | 743 | } |
776 | if (mHasATIVAO) | 744 | if (mHasFramebufferObject) |
777 | { | 745 | { |
778 | // Initialize the extension. | 746 | glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glIsRenderbufferEXT"); |
779 | llinfos << "Has ATI_vertex_array_object!" << llendl; | 747 | glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glBindRenderbufferEXT"); |
780 | glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)GLH_EXT_GET_PROC_ADDRESS("glNewObjectBufferATI"); | 748 | glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteRenderbuffersEXT"); |
781 | glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)GLH_EXT_GET_PROC_ADDRESS("glIsObjectBufferATI"); | 749 | glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGenRenderbuffersEXT"); |
782 | glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)GLH_EXT_GET_PROC_ADDRESS("glUpdateObjectBufferATI"); | 750 | glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glRenderbufferStorageEXT"); |
783 | glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetObjectBufferfvATI"); | 751 | glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGetRenderbufferParameterivEXT"); |
784 | glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetObjectBufferivATI"); | 752 | glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glIsFramebufferEXT"); |
785 | glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)GLH_EXT_GET_PROC_ADDRESS("glFreeObjectBufferATI"); | 753 | glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glBindFramebufferEXT"); |
786 | glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)GLH_EXT_GET_PROC_ADDRESS("glArrayObjectATI"); | 754 | glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteFramebuffersEXT"); |
787 | glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)GLH_EXT_GET_PROC_ADDRESS("glVertexAttribArrayObjectATI"); | 755 | glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGenFramebuffersEXT"); |
788 | glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetArrayObjectfvATI"); | 756 | glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glCheckFramebufferStatusEXT"); |
789 | glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetArrayObjectivATI"); | 757 | glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture1DEXT"); |
790 | glVariantObjectArrayATI = (PFNGLVARIANTARRAYOBJECTATIPROC)GLH_EXT_GET_PROC_ADDRESS("glVariantObjectArrayATI"); | 758 | glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture2DEXT"); |
791 | glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVariantArrayObjectfvATI"); | 759 | glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glFramebufferTexture3DEXT"); |
792 | glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)GLH_EXT_GET_PROC_ADDRESS("glGetVariantArrayObjectivATI"); | 760 | glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) GLH_EXT_GET_PROC_ADDRESS("glFramebufferRenderbufferEXT"); |
761 | glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGetFramebufferAttachmentParameterivEXT"); | ||
762 | glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC) GLH_EXT_GET_PROC_ADDRESS("glGenerateMipmapEXT"); | ||
793 | } | 763 | } |
794 | #if !LL_LINUX | 764 | #if !LL_LINUX |
795 | // This is expected to be a static symbol on Linux GL implementations | 765 | // This is expected to be a static symbol on Linux GL implementations |
@@ -1005,6 +975,20 @@ void LLGLState::restoreGL() | |||
1005 | initClass(); | 975 | initClass(); |
1006 | } | 976 | } |
1007 | 977 | ||
978 | //static | ||
979 | // Really shouldn't be needed, but seems we sometimes do. | ||
980 | void LLGLState::resetTextureStates() | ||
981 | { | ||
982 | GLint maxTextureUnits; | ||
983 | glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &maxTextureUnits); | ||
984 | for (S32 j = maxTextureUnits-1; j >=0; j--) | ||
985 | { | ||
986 | glActiveTextureARB(GL_TEXTURE0_ARB+j); | ||
987 | glClientActiveTextureARB(GL_TEXTURE0_ARB+j); | ||
988 | j == 0 ? glEnable(GL_TEXTURE_2D) : glDisable(GL_TEXTURE_2D); | ||
989 | } | ||
990 | } | ||
991 | |||
1008 | void LLGLState::dumpStates() | 992 | void LLGLState::dumpStates() |
1009 | { | 993 | { |
1010 | llinfos << "GL States:" << llendl; | 994 | llinfos << "GL States:" << llendl; |