Changeset 53755 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Jan 6, 2015 9:06:53 PM (10 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r53751 r53755 2579 2579 SVGA3dCmdDefineContext *pCmd = (SVGA3dCmdDefineContext *)(pHdr + 1); 2580 2580 2581 rc = vmsvga3dContextDefine(pThis, pCmd->cid, false /*f Legacy*/);2581 rc = vmsvga3dContextDefine(pThis, pCmd->cid, false /*fOtherProfile*/); 2582 2582 break; 2583 2583 } -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.h
r53749 r53755 35 35 #endif 36 36 37 VMSVGA3D_DECL(void) vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLContextRef pSharedCtx, bool fLegacy); 37 VMSVGA3D_DECL(void) vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLContextRef pSharedCtx, 38 bool fOtherProfile); 38 39 VMSVGA3D_DECL(void) vmsvga3dCocoaDestroyContext(NativeNSOpenGLContextRef pCtx); 39 40 VMSVGA3D_DECL(void) vmsvga3dCocoaCreateView(NativeNSViewRef *ppView, NativeNSViewRef pParentView); -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-cocoa.m
r53749 r53755 623 623 624 624 625 void vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLContextRef pShareCtx, bool f Legacy)625 void vmsvga3dCocoaCreateContext(NativeNSOpenGLContextRef *ppCtx, NativeNSOpenGLContextRef pShareCtx, bool fOtherProfile) 626 626 { 627 627 DEBUG_FUNC_ENTER(); -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r53750 r53755 88 88 #include <float.h> 89 89 90 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE91 # define VBOX_D3D9CAPS_ONLY_DEFINES92 # include "shaderlib/wine/include/d3d9caps.h" /* For some capability constants. */93 #endif94 95 90 96 91 /* Generated by VBoxDef2LazyLoad from the VBoxSVGA3D.def and VBoxSVGA3DObjC.def files. */ … … 104 99 * Defined Constants And Macros * 105 100 *******************************************************************************/ 101 #ifndef VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE 102 # define VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE 1.0 103 #endif 104 106 105 #ifdef RT_OS_WINDOWS 107 106 # define OGLGETPROCADDRESS wglGetProcAddress … … 215 214 216 215 /** 217 * Macro wrapping glGetIntegerv for use during initialization.218 * Uses AssertLogRelMsg.219 */220 #define VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(a_enmGlValue, a_pDest) \221 do \222 { \223 glGetIntegerv(a_enmGlValue, a_pDest); \224 GLenum iGlError = glGetError(); \225 AssertLogRelMsg(iGlError == GL_NO_ERROR, \226 ("VMSVGA3d: glGetIntegerv(" #a_enmGlValue " (%#x),) -> %#x\n", (int)a_enmGlValue, iGlError)); \227 } while (0)228 229 /**230 216 * Macro for doing something and then checking for errors during initialization. 231 217 * Uses AssertLogRelMsg. … … 238 224 AssertLogRelMsg(iGlError == GL_NO_ERROR, ("VMSVGA3d: %s -> %#x\n", #a_Expr, iGlError)); \ 239 225 } while (0) 226 227 /** 228 * Macro for doing something and then checking for errors during initialization, 229 * doing the same in the other context when enabled. 230 * 231 * This will try both profiles in dual profile builds. Caller must be in the 232 * default context. 233 * 234 * Uses AssertLogRelMsg to indicate trouble. 235 */ 236 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 237 # define VMSVGA3D_INIT_CHECKED_BOTH(a_pState, a_pContext, a_pOtherCtx, a_Expr) \ 238 do \ 239 { \ 240 for (uint32_t i = 0; i < 64; i++) if (glGetError() == GL_NO_ERROR) break; Assert(glGetError() == GL_NO_ERROR); \ 241 a_Expr; \ 242 GLenum iGlError = glGetError(); \ 243 if (iGlError != GL_NO_ERROR) \ 244 { \ 245 VMSVGA3D_SET_CURRENT_CONTEXT(a_pState, a_pOtherCtx); \ 246 for (uint32_t i = 0; i < 64; i++) if (glGetError() == GL_NO_ERROR) break; Assert(glGetError() == GL_NO_ERROR); \ 247 a_Expr; \ 248 GLenum iGlError2 = glGetError(); \ 249 AssertLogRelMsg(iGlError2 == GL_NO_ERROR, ("VMSVGA3d: %s -> %#x / %#x\n", #a_Expr, iGlError, iGlError2)); \ 250 VMSVGA3D_SET_CURRENT_CONTEXT(a_pState, a_pContext); \ 251 } \ 252 } while (0) 253 #else 254 # define VMSVGA3D_INIT_CHECKED_BOTH(a_pState, a_pContext, a_pOtherCtx, a_Expr) VMSVGA3D_INIT_CHECKED(a_Expr) 255 #endif 240 256 241 257 … … 406 422 NativeNSOpenGLContextRef cocoaContext; 407 423 NativeNSViewRef cocoaView; 408 bool f Legacy;424 bool fOtherProfile; 409 425 #else 410 426 /** XGL rendering context handle */ … … 604 620 uint32_t idTestContext; 605 621 #endif 606 /** Legacy OpenGL profile GL_EXTENSIONS result (RTStrDup). 622 /** The GL_EXTENSIONS value (space padded) for the default OpenGL profile. 623 * Free with RTStrFree. */ 624 R3PTRTYPE(char *) pszExtensions; 625 626 /** The GL_EXTENSIONS value (space padded) for the other OpenGL profile. 627 * Free with RTStrFree. 628 * 607 629 * This is used to detect shader model version since some implementations 608 630 * (darwin) hides extensions that have made it into core and probably a 609 631 * bunch of others when using a OpenGL core profile instead of a legacy one */ 610 R3PTRTYPE(char *) pszLegacyExtensions; 632 R3PTRTYPE(char *) pszOtherExtensions; 633 /** The version of the other GL profile. */ 634 float fOtherGLVersion; 635 636 /** Shader talk back interface. */ 637 VBOXVMSVGASHADERIF ShaderIf; 611 638 } VMSVGA3DSTATE; 612 639 /** Pointer to the VMSVGA3d state. */ … … 670 697 * 671 698 * @returns true if supported, false if not. 699 * @param pState The VMSVGA3d state. 672 700 * @param fActualGLVersion The actual OpenGL version we're working against. 673 701 * @param fMinGLVersion The OpenGL version that introduced this feature 674 702 * into the core. 675 * @param pszWantedExtension The name of the OpenGL extension we want. 703 * @param pszWantedExtension The name of the OpenGL extension we want padded 704 * with one space at each end. 676 705 * @remarks Init time only. 677 706 */ 678 static bool vmsvga3dCheckGLExtension(float fActualGLVersion, float fMinGLVersion, const char *pszWantedExtension) 679 { 707 static bool vmsvga3dCheckGLExtension(PVMSVGA3DSTATE pState, float fMinGLVersion, const char *pszWantedExtension) 708 { 709 /* check padding. */ 710 Assert(pszWantedExtension[0] == ' '); 711 Assert(pszWantedExtension[1] != ' '); 712 Assert(strchr(&pszWantedExtension[1], ' ') + 1 == strchr(pszWantedExtension, '\0')); 713 714 /* Look it up. */ 680 715 bool fRet = false; 681 682 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 683 /* 684 * OpenGL 3.2+ core profile (glGetString(GL_EXTENSIONS) returns NULL). 685 * It also avoids listing extensions that have been promoted into the core. 686 */ 687 688 /* Seems like extensions are assimilated into the OpenGL core, so we do 689 hardcoded checks for these as per gl3.h. */ 690 if (0) { /*nothing*/ } 691 else if ( fActualGLVersion >= 2.0 692 && ( strcmp(pszWantedExtension, "GL_ARB_draw_buffers") == 0 693 || strcmp(pszWantedExtension, "GL_ARB_shader_objects") == 0 /*??*/ 694 || strcmp(pszWantedExtension, "GL_ARB_vertex_shader") == 0 /*??*/ 695 || strcmp(pszWantedExtension, "GL_ARB_fragment_shader") == 0 /*??*/ 696 || strcmp(pszWantedExtension, "GL_ARB_shading_language_100") == 0 /*??*/ 697 || strcmp(pszWantedExtension, "GL_ARB_texture_non_power_of_two") == 0 698 || strcmp(pszWantedExtension, "GL_ARB_point_sprite") == 0 699 || strcmp(pszWantedExtension, "GL_ATI_separate_stencil") == 0 700 || strcmp(pszWantedExtension, "GL_EXT_stencil_two_side") == 0) ) 716 if (strstr(pState->pszExtensions, pszWantedExtension)) 701 717 fRet = true; 702 else if ( fActualGLVersion >= 2.1 703 && ( strcmp(pszWantedExtension, "GL_EXT_texture_sRGB") == 0 704 || strcmp(pszWantedExtension, "GL_ARB_pixel_buffer_object") == 0) ) 705 fRet = true; 706 else if ( fActualGLVersion >= 3.0 707 && ( strcmp(pszWantedExtension, "GL_ARB_framebuffer_object") == 0 708 || strcmp(pszWantedExtension, "GL_ARB_map_buffer_range") == 0 709 || strcmp(pszWantedExtension, "GL_ARB_vertex_array_object") == 0) ) 710 fRet = true; 711 else if ( fActualGLVersion >= 3.1 712 && ( strcmp(pszWantedExtension, "GL_ARB_copy_buffer") == 0 713 || strcmp(pszWantedExtension, "GL_ARB_uniform_buffer_object") == 0 714 || strcmp(pszWantedExtension, "GL_ARB_vertex_array_object") == 0) ) 715 fRet = true; 716 else if ( fActualGLVersion >= 3.2 717 && ( strcmp(pszWantedExtension, "GL_ARB_draw_elements_base_vertex") == 0 718 || strcmp(pszWantedExtension, "GL_ARB_vertex_array_bgra") == 0 719 || strcmp(pszWantedExtension, "GL_ARB_provoking_vertex") == 0 720 || strcmp(pszWantedExtension, "GL_ARB_seamless_cube_map") == 0 721 || strcmp(pszWantedExtension, "GL_ARB_fragment_coord_conventions") == 0 722 || strcmp(pszWantedExtension, "GL_ARB_depth_clamp") == 0 723 || strcmp(pszWantedExtension, "GL_ARB_sync") == 0 724 || strcmp(pszWantedExtension, "GL_ARB_texture_multisample") == 0) ) 725 fRet = true; 726 else if ( fActualGLVersion >= 3.3 727 && ( strcmp(pszWantedExtension, "GL_ARB_blend_func_extended") == 0 728 || strcmp(pszWantedExtension, "GL_ARB_sampler_objects") == 0 729 || strcmp(pszWantedExtension, "GL_ARB_explicit_attrib_location") == 0 730 || strcmp(pszWantedExtension, "GL_ARB_occlusion_query2") == 0 731 || strcmp(pszWantedExtension, "GL_ARB_shader_bit_encoding") == 0 732 || strcmp(pszWantedExtension, "GL_ARB_texture_rgb10_a2ui") == 0 733 || strcmp(pszWantedExtension, "GL_ARB_texture_swizzle") == 0 734 || strcmp(pszWantedExtension, "GL_ARB_timer_query") == 0 735 || strcmp(pszWantedExtension, "GL_ARB_vertex_type_2_10_10_10_rev") == 0) ) 736 fRet = true; 737 else if ( fActualGLVersion >= 4.0 738 && ( strcmp(pszWantedExtension, "GL_ARB_texture_query_lod") == 0 739 || strcmp(pszWantedExtension, "GL_ARB_draw_indirect") == 0 740 || strcmp(pszWantedExtension, "GL_ARB_gpu_shader5") == 0 741 || strcmp(pszWantedExtension, "GL_ARB_gpu_shader_fp64") == 0 742 || strcmp(pszWantedExtension, "GL_ARB_shader_subroutine") == 0 743 || strcmp(pszWantedExtension, "GL_ARB_tessellation_shader") == 0 744 || strcmp(pszWantedExtension, "GL_ARB_texture_buffer_object_rgb32") == 0 745 || strcmp(pszWantedExtension, "GL_ARB_texture_cube_map_array") == 0 746 || strcmp(pszWantedExtension, "GL_ARB_texture_gather") == 0 747 || strcmp(pszWantedExtension, "GL_ARB_transform_feedback2") == 0 748 || strcmp(pszWantedExtension, "GL_ARB_transform_feedback3") == 0) ) 749 fRet = true; 750 else if ( fActualGLVersion >= 4.1 751 && ( strcmp(pszWantedExtension, "GL_ARB_ES2_compatibility") == 0 752 || strcmp(pszWantedExtension, "GL_ARB_get_program_binary") == 0 753 || strcmp(pszWantedExtension, "GL_ARB_separate_shader_objects") == 0 754 || strcmp(pszWantedExtension, "GL_ARB_shader_precision") == 0 755 || strcmp(pszWantedExtension, "GL_ARB_vertex_attrib_64bit") == 0 756 || strcmp(pszWantedExtension, "GL_ARB_viewport_array") == 0) ) 757 fRet = true; 758 else 759 { 760 /* Search the GL_EXTENSIONS array. */ 761 static PFNGLGETSTRINGIPROC s_pfnGlGetStringi = NULL; 762 if (!s_pfnGlGetStringi) 763 { 764 s_pfnGlGetStringi = (PFNGLGETSTRINGIPROC)OGLGETPROCADDRESS("glGetStringi"); 765 AssertLogRelReturn(s_pfnGlGetStringi, false); 766 } 767 768 GLint cExtensions = 1024; 769 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_NUM_EXTENSIONS, &cExtensions); 770 771 for (GLint idxCur = 0; idxCur < cExtensions; idxCur++) 772 { 773 const char *pszCur = (const char *)s_pfnGlGetStringi(GL_EXTENSIONS, idxCur); 774 if (pszCur && !strcmp(pszCur, pszWantedExtension)) 775 { 776 fRet = true; 777 break; 778 } 779 } 780 } 781 #else 782 /* 783 * Old interface. 784 */ 785 char *pSupportedExtensions = (char *)glGetString(GL_EXTENSIONS); 786 char *pExtensionSupported = pSupportedExtensions; 787 size_t cchWantedExtension = strlen(pszWantedExtension); 788 789 while (true) 790 { 791 pExtensionSupported = strstr(pExtensionSupported, pszWantedExtension); 792 if (pExtensionSupported == NULL) 793 break; 794 795 if ( ( pExtensionSupported == pSupportedExtensions 796 || pExtensionSupported[-1] == ' ') 797 && ( pExtensionSupported[cchWantedExtension] == ' ' 798 || pExtensionSupported[cchWantedExtension] == '\0') 799 ) 800 { 801 fRet = true; 802 break; 803 } 804 805 pExtensionSupported += cchWantedExtension; 806 } 718 719 /* Temporarily. Later start if (fMinGLVersion != 0.0 && fActualGLVersion >= fMinGLVersion) return true; */ 720 AssertMsg( fMinGLVersion == 0.0 721 || fRet == (pState->fGLVersion >= fMinGLVersion) 722 #ifdef RT_OS_DARWIN 723 || VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE == 2.1 807 724 #endif 808 809 /* Temporarily. Later start if (fMinGLVersion != 0.0 && fActualGLVersion >= fMinGLVersion) return true; */ 810 #if defined(VBOX_VMSVGA3D_USE_OPENGL_CORE) || !defined(RT_OS_DARWIN) 811 AssertMsg(fMinGLVersion == 0.0 || fRet == (fActualGLVersion >= fMinGLVersion), 812 ("%s actual:%d min:%d\n", pszWantedExtension, (int)(fActualGLVersion * 10), (int)(fMinGLVersion * 10) )); 813 #endif 725 , ("%s actual:%d min:%d fRet=%d\n", 726 pszWantedExtension, (int)(pState->fGLVersion * 10), (int)(fMinGLVersion * 10), fRet)); 814 727 return fRet; 815 728 } … … 819 732 * Outputs GL_EXTENSIONS list to the release log. 820 733 */ 821 static void vmsvga3dLogRelExtensions(void) 822 { 823 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 734 static void vmsvga3dLogRelExtensions(const char *pszPrefix, const char *pszExtensions) 735 { 824 736 /* OpenGL 3.0 interface (glGetString(GL_EXTENSIONS) return NULL). */ 825 PFNGLGETSTRINGIPROC pfnGlGetStringi = (PFNGLGETSTRINGIPROC)OGLGETPROCADDRESS("glGetStringi");826 AssertLogRelReturnVoid(pfnGlGetStringi);827 828 737 bool fBuffered = RTLogRelSetBuffering(true); 829 738 830 GLint cExtensions = 1024; 831 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_NUM_EXTENSIONS, &cExtensions); 832 LogRel(("VMSVGA3d: OpenGL extensions (GL_NUM_EXTENSIONS=%d)", cExtensions)); 833 834 for (GLint idxCur = 0; idxCur < cExtensions; idxCur++) 835 { 836 const char *pszExt = (const char *)pfnGlGetStringi(GL_EXTENSIONS, idxCur); 837 const char *pszFmt = idxCur % 3 ? " %-26s" : "\nVMSVGA3d: %-26s"; 838 LogRel((pszFmt, pszExt)); 739 /* 740 * Determin the column widths first. 741 */ 742 size_t acchWidths[4] = { 1, 1, 1, 1 }; 743 uint32_t i; 744 const char *psz = pszExtensions; 745 for (i = 0; ; i++) 746 { 747 while (*psz == ' ') 748 psz++; 749 if (!*psz) 750 break; 751 752 const char *pszEnd = strchr(psz, ' '); 753 AssertBreak(pszEnd); 754 size_t cch = pszEnd - psz; 755 756 uint32_t iColumn = i % RT_ELEMENTS(acchWidths); 757 if (acchWidths[iColumn] < cch) 758 acchWidths[iColumn] = cch; 759 760 psz = pszEnd; 761 } 762 763 /* 764 * Output it. 765 */ 766 LogRel(("VMSVGA3d: %sOpenGL extensions (%d):", pszPrefix, i)); 767 psz = pszExtensions; 768 for (i = 0; ; i++) 769 { 770 while (*psz == ' ') 771 psz++; 772 if (!*psz) 773 break; 774 775 const char *pszEnd = strchr(psz, ' '); 776 AssertBreak(pszEnd); 777 size_t cch = pszEnd - psz; 778 779 uint32_t iColumn = i % RT_ELEMENTS(acchWidths); 780 if (iColumn == 0) 781 LogRel(("\nVMSVGA3d: %-*.*s", acchWidths[iColumn], cch, psz)); 782 else if (iColumn != RT_ELEMENTS(acchWidths) - 1) 783 LogRel((" %-*.*s", acchWidths[iColumn], cch, psz)); 784 else 785 LogRel((" %.*s", cch, psz)); 786 787 psz = pszEnd; 839 788 } 840 789 841 790 RTLogRelSetBuffering(fBuffered); 842 791 LogRel(("\n")); 792 } 793 794 /** 795 * Gathers the GL_EXTENSIONS list, storing it as a space padded list at 796 * @a ppszExtensions. 797 * 798 * @returns VINF_SUCCESS or VERR_NO_STR_MEMORY 799 * @param ppszExtensions Pointer to the string pointer. Free with RTStrFree. 800 * @param fGLProfileVersion The OpenGL profile version. 801 */ 802 static int vmsvga3dGatherExtensions(char **ppszExtensions, float fGLProfileVersion) 803 { 804 int rc; 805 *ppszExtensions = NULL; 806 807 /* 808 * Try the old glGetString interface first. 809 */ 810 const char *pszExtensions = (const char *)glGetString(GL_EXTENSIONS); 811 if (pszExtensions) 812 { 813 rc = RTStrAAppendExN(ppszExtensions, 3, " ", (size_t)1, pszExtensions, RTSTR_MAX, " ", (size_t)1); 814 AssertLogRelRCReturn(rc, rc); 815 } 816 else 817 { 818 /* 819 * The new interface where each extension string is retrieved separately. 820 * Note! Cannot use VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE here because 821 * the above GL_EXTENSIONS error lingers on darwin. sucks. 822 */ 823 #ifndef GL_NUM_EXTENSIONS 824 # define GL_NUM_EXTENSIONS 0x821D 825 #endif 826 GLint cExtensions = 1024; 827 glGetIntegerv(GL_NUM_EXTENSIONS, &cExtensions); 828 Assert(cExtensions != 1024); 829 830 PFNGLGETSTRINGIPROC pfnGlGetStringi = (PFNGLGETSTRINGIPROC)OGLGETPROCADDRESS("glGetStringi"); 831 AssertLogRelReturn(pfnGlGetStringi, VERR_NOT_SUPPORTED); 832 833 rc = RTStrAAppend(ppszExtensions, " "); 834 for (GLint i = 0; RT_SUCCESS(rc) && i < cExtensions; i++) 835 { 836 const char *pszExt = (const char *)pfnGlGetStringi(GL_EXTENSIONS, i); 837 if (pszExt) 838 rc = RTStrAAppendExN(ppszExtensions, 2, pfnGlGetStringi(GL_EXTENSIONS, i), RTSTR_MAX, " ", (size_t)1); 839 } 840 AssertRCReturn(rc, rc); 841 } 842 843 #if 1 844 /* 845 * Add extensions promoted into the core OpenGL profile. 846 */ 847 static const struct 848 { 849 float fGLVersion; 850 const char *pszzExtensions; 851 } s_aPromotedExtensions[] = 852 { 853 { 854 1.1, 855 " GL_EXT_vertex_array \0" 856 " GL_EXT_polygon_offset \0" 857 " GL_EXT_blend_logic_op \0" 858 " GL_EXT_texture \0" 859 " GL_EXT_copy_texture \0" 860 " GL_EXT_subtexture \0" 861 " GL_EXT_texture_object \0" 862 " GL_ARB_framebuffer_object \0" 863 " GL_ARB_map_buffer_range \0" 864 " GL_ARB_vertex_array_object \0" 865 "\0" 866 }, 867 { 868 1.2, 869 " EXT_texture3D \0" 870 " EXT_bgra \0" 871 " EXT_packed_pixels \0" 872 " EXT_rescale_normal \0" 873 " EXT_separate_specular_color \0" 874 " SGIS_texture_edge_clamp \0" 875 " SGIS_texture_lod \0" 876 " EXT_draw_range_elements \0" 877 "\0" 878 }, 879 { 880 1.3, 881 " GL_ARB_texture_compression \0" 882 " GL_ARB_texture_cube_map \0" 883 " GL_ARB_multisample \0" 884 " GL_ARB_multitexture \0" 885 " GL_ARB_texture_env_add \0" 886 " GL_ARB_texture_env_combine \0" 887 " GL_ARB_texture_env_dot3 \0" 888 " GL_ARB_texture_border_clamp \0" 889 " GL_ARB_transpose_matrix \0" 890 "\0" 891 }, 892 { 893 1.5, 894 " GL_SGIS_generate_mipmap \0" 895 /*" GL_NV_blend_equare \0"*/ 896 " GL_ARB_depth_texture \0" 897 " GL_ARB_shadow \0" 898 " GL_EXT_fog_coord \0" 899 " GL_EXT_multi_draw_arrays \0" 900 " GL_ARB_point_parameters \0" 901 " GL_EXT_secondary_color \0" 902 " GL_EXT_blend_func_separate \0" 903 " GL_EXT_stencil_wrap \0" 904 " GL_ARB_texture_env_crossbar \0" 905 " GL_EXT_texture_lod_bias \0" 906 " GL_ARB_texture_mirrored_repeat \0" 907 " GL_ARB_window_pos \0" 908 "\0" 909 }, 910 { 911 1.6, 912 " GL_ARB_vertex_buffer_object \0" 913 " GL_ARB_occlusion_query \0" 914 " GL_EXT_shadow_funcs \0" 915 }, 916 { 917 2.0, 918 " GL_ARB_shader_objects \0" /*??*/ 919 " GL_ARB_vertex_shader \0" /*??*/ 920 " GL_ARB_fragment_shader \0" /*??*/ 921 " GL_ARB_shading_language_100 \0" /*??*/ 922 " GL_ARB_draw_buffers \0" 923 " GL_ARB_texture_non_power_of_two \0" 924 " GL_ARB_point_sprite \0" 925 " GL_ATI_separate_stencil \0" 926 " GL_EXT_stencil_two_side \0" 927 "\0" 928 }, 929 { 930 2.1, 931 " GL_ARB_pixel_buffer_object \0" 932 " GL_EXT_texture_sRGB \0" 933 "\0" 934 }, 935 { 936 3.0, 937 " GL_ARB_framebuffer_object \0" 938 " GL_ARB_map_buffer_range \0" 939 " GL_ARB_vertex_array_object \0" 940 "\0" 941 }, 942 { 943 3.1, 944 " GL_ARB_copy_buffer \0" 945 " GL_ARB_uniform_buffer_object \0" 946 "\0" 947 }, 948 { 949 3.2, 950 " GL_ARB_vertex_array_bgra \0" 951 " GL_ARB_draw_elements_base_vertex \0" 952 " GL_ARB_fragment_coord_conventions \0" 953 " GL_ARB_provoking_vertex \0" 954 " GL_ARB_seamless_cube_map \0" 955 " GL_ARB_texture_multisample \0" 956 " GL_ARB_depth_clamp \0" 957 " GL_ARB_sync \0" 958 " GL_ARB_geometry_shader4 \0" /*??*/ 959 "\0" 960 }, 961 { 962 3.3, 963 " GL_ARB_blend_func_extended \0" 964 " GL_ARB_sampler_objects \0" 965 " GL_ARB_explicit_attrib_location \0" 966 " GL_ARB_occlusion_query2 \0" 967 " GL_ARB_shader_bit_encoding \0" 968 " GL_ARB_texture_rgb10_a2ui \0" 969 " GL_ARB_texture_swizzle \0" 970 " GL_ARB_timer_query \0" 971 " GL_ARB_vertex_type_2_10_10_10_rev \0" 972 "\0" 973 }, 974 { 975 4.0, 976 " GL_ARB_texture_query_lod \0" 977 " GL_ARB_draw_indirect \0" 978 " GL_ARB_gpu_shader5 \0" 979 " GL_ARB_gpu_shader_fp64 \0" 980 " GL_ARB_shader_subroutine \0" 981 " GL_ARB_tessellation_shader \0" 982 " GL_ARB_texture_buffer_object_rgb32 \0" 983 " GL_ARB_texture_cube_map_array \0" 984 " GL_ARB_texture_gather \0" 985 " GL_ARB_transform_feedback2 \0" 986 " GL_ARB_transform_feedback3 \0" 987 "\0" 988 }, 989 { 990 4.1, 991 " GL_ARB_ES2_compatibility \0" 992 " GL_ARB_get_program_binary \0" 993 " GL_ARB_separate_shader_objects \0" 994 " GL_ARB_shader_precision \0" 995 " GL_ARB_vertex_attrib_64bit \0" 996 " GL_ARB_viewport_array \0" 997 "\0" 998 } 999 }; 1000 1001 uint32_t cPromoted = 0; 1002 for (uint32_t i = 0; i < RT_ELEMENTS(s_aPromotedExtensions) && s_aPromotedExtensions[i].fGLVersion <= fGLProfileVersion; i++) 1003 { 1004 const char *pszExt = s_aPromotedExtensions[i].pszzExtensions; 1005 while (*pszExt) 1006 { 1007 size_t cchExt = strlen(pszExt); 1008 Assert(cchExt > 3); 1009 Assert(pszExt[0] == ' '); 1010 Assert(pszExt[1] != ' '); 1011 Assert(pszExt[cchExt - 2] != ' '); 1012 Assert(pszExt[cchExt - 1] == ' '); 1013 1014 if (strstr(*ppszExtensions, pszExt) == NULL) 1015 { 1016 if (cPromoted++ == 0) 1017 { 1018 rc = RTStrAAppend(ppszExtensions, " <promoted-extensions:> <promoted-extensions:> <promoted-extensions:> "); 1019 AssertRCReturn(rc, rc); 1020 } 1021 1022 rc = RTStrAAppend(ppszExtensions, pszExt); 1023 AssertRCReturn(rc, rc); 1024 } 1025 1026 pszExt = strchr(pszExt, '\0') + 1; 1027 } 1028 } 1029 #endif 1030 1031 return VINF_SUCCESS; 1032 } 1033 1034 /** 1035 * @interface_method_impl{VBOXVMSVGASHADERIF, pfnSwitchInitProfile} 1036 */ 1037 static DECLCALLBACK(void) vmsvga3dShaderIfSwitchInitProfile(PVBOXVMSVGASHADERIF pThis, bool fOtherProfile) 1038 { 1039 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 1040 PVMSVGA3DSTATE pState = RT_FROM_MEMBER(pThis, VMSVGA3DSTATE, ShaderIf); 1041 VMSVGA3D_SET_CURRENT_CONTEXT(pState, &pState->paContext[fOtherProfile ? 2 : 1]); 843 1042 #else 844 /* Old interface. */845 LogRel(("VMSVGA3d: OpenGL extensions: %s\n\n", glGetString(GL_EXTENSIONS)));1043 NOREF(pThis); 1044 NOREF(fOtherProfile); 846 1045 #endif 1046 } 1047 1048 1049 /** 1050 * @interface_method_impl{VBOXVMSVGASHADERIF, pfnGetNextExtension} 1051 */ 1052 static DECLCALLBACK(bool) vmsvga3dShaderIfGetNextExtension(PVBOXVMSVGASHADERIF pThis, void **ppvEnumCtx, 1053 char *pszBuf, size_t cbBuf, bool fOtherProfile) 1054 { 1055 PVMSVGA3DSTATE pState = RT_FROM_MEMBER(pThis, VMSVGA3DSTATE, ShaderIf); 1056 const char *pszCur = *ppvEnumCtx ? (const char *)*ppvEnumCtx 1057 : fOtherProfile ? pState->pszOtherExtensions : pState->pszExtensions; 1058 while (*pszCur == ' ') 1059 pszCur++; 1060 if (!*pszCur) 1061 return false; 1062 1063 const char *pszEnd = strchr(pszCur, ' '); 1064 AssertReturn(pszEnd, false); 1065 size_t cch = pszEnd - pszCur; 1066 if (cch < cbBuf) 1067 { 1068 memcpy(pszBuf, pszCur, cch); 1069 pszBuf[cch] = '\0'; 1070 } 1071 else if (cbBuf > 0) 1072 { 1073 memcpy(pszBuf, "<overflow>", RT_MIN(sizeof("<overflow>"), cbBuf)); 1074 pszBuf[cbBuf - 1] = '\0'; 1075 } 1076 1077 *ppvEnumCtx = (void *)pszEnd; 1078 return true; 847 1079 } 848 1080 … … 917 1149 AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY); 918 1150 PVMSVGA3DCONTEXT pContext; 919 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE920 PVMSVGA3DCONTEXT p LegacyContext;1151 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 1152 PVMSVGA3DCONTEXT pOtherCtx; 921 1153 #endif 922 1154 int rc; … … 924 1156 if (pState->fGLVersion != 0.0) 925 1157 return VINF_SUCCESS; /* already initialized (load state) */ 926 927 /*928 * Initialize the capabilities with sensible defaults.929 */930 pState->caps.maxActiveLights = 1;931 pState->caps.maxTextureBufferSize = 65536;932 pState->caps.maxTextures = 1;933 pState->caps.maxClipDistances = 4;934 pState->caps.maxColorAttachments = 1;935 pState->caps.maxRectangleTextureSize = 2048;936 pState->caps.maxTextureAnisotropy = 2;937 pState->caps.maxVertexShaderInstructions = 1024;938 pState->caps.maxFragmentShaderInstructions = 1024;939 pState->caps.vertexShaderVersion = SVGA3DVSVERSION_NONE;940 pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_NONE;941 1158 942 1159 /* 943 1160 * OpenGL function calls aren't possible without a valid current context, so create a fake one here. 944 1161 */ 945 rc = vmsvga3dContextDefine(pThis, 1, false /*f Legacy*/);1162 rc = vmsvga3dContextDefine(pThis, 1, false /*fOtherProfile*/); 946 1163 AssertRCReturn(rc, rc); 947 1164 … … 949 1166 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext); 950 1167 951 LogRel(("VMSVGA3d: OpenGL version: %s\nOpenGL Vendor: %s\nOpenGL Renderer: %s\n", glGetString(GL_VERSION), glGetString(GL_VENDOR), glGetString(GL_RENDERER))); 952 LogRel(("VMSVGA3d: OpenGL shader language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION))); 953 vmsvga3dLogRelExtensions(); 1168 LogRel(("VMSVGA3d: OpenGL version: %s\n" 1169 "VMSVGA3d: OpenGL Vendor: %s\n" 1170 "VMSVGA3d: OpenGL Renderer: %s\n" 1171 "VMSVGA3d: OpenGL shader language version: %s\n", 1172 glGetString(GL_VERSION), glGetString(GL_VENDOR), glGetString(GL_RENDERER), 1173 glGetString(GL_SHADING_LANGUAGE_VERSION))); 1174 1175 rc = vmsvga3dGatherExtensions(&pState->pszExtensions, VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE); 1176 AssertRCReturn(rc, rc); 1177 vmsvga3dLogRelExtensions("", pState->pszExtensions); 954 1178 955 1179 pState->fGLVersion = atof((const char *)glGetString(GL_VERSION)); 956 1180 957 1181 958 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE1182 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 959 1183 /* 960 * Get the legacy extension list so we can better figure out the shader model.961 * We add space before and after the list, so we can use strstr for locating extensions.1184 * Get the extension list for the alternative profile so we can better 1185 * figure out the shader model and stuff. 962 1186 */ 963 rc = vmsvga3dContextDefine(pThis, 2, true /*f Legacy*/);1187 rc = vmsvga3dContextDefine(pThis, 2, true /*fOtherProfile*/); 964 1188 AssertLogRelRCReturn(rc, rc); 965 1189 pContext = &pState->paContext[1]; /* Array may have been reallocated. */ 966 1190 967 pLegacyContext = &pState->paContext[2]; 968 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pLegacyContext); 969 970 pState->pszLegacyExtensions = NULL; 971 rc = RTStrAAppendExN(&pState->pszLegacyExtensions, 3, 972 " ", (size_t)1, (const char *)glGetString(GL_EXTENSIONS), RTSTR_MAX, " ", (size_t)1); 973 AssertLogRelRCReturn(rc, rc); 974 975 LogRel(("VMSVGA3d: Legacy OpenGL version: %s\nOpenGL Vendor: %s\nOpenGL Renderer: %s\n", glGetString(GL_VERSION), glGetString(GL_VENDOR), glGetString(GL_RENDERER))); 976 LogRel(("VMSVGA3d: Legacy OpenGL shader language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION))); 977 LogRel(("VMSVGA3d: Legacy OpenGL extenions: %s\n", glGetString(GL_EXTENSIONS))); 1191 pOtherCtx = &pState->paContext[2]; 1192 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pOtherCtx); 1193 1194 LogRel(("VMSVGA3d: Alternative OpenGL version: %s\n" 1195 "VMSVGA3d: Alternative OpenGL Vendor: %s\n" 1196 "VMSVGA3d: Alternative OpenGL Renderer: %s\n" 1197 "VMSVGA3d: Alternative OpenGL shader language version: %s\n", 1198 glGetString(GL_VERSION), glGetString(GL_VENDOR), glGetString(GL_RENDERER), 1199 glGetString(GL_SHADING_LANGUAGE_VERSION))); 1200 1201 rc = vmsvga3dGatherExtensions(&pState->pszOtherExtensions, VBOX_VMSVGA3D_OTHER_OGL_PROFILE); 1202 AssertRCReturn(rc, rc); 1203 vmsvga3dLogRelExtensions("Alternative ", pState->pszOtherExtensions); 1204 1205 pState->fOtherGLVersion = atof((const char *)glGetString(GL_VERSION)); 978 1206 979 1207 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext); 980 1208 #else 981 pState->pszLegacyExtensions = (char *)""; 1209 pState->pszOtherExtensions = (char *)""; 1210 pState->fOtherGLVersion = pState->fGLVersion; 982 1211 #endif 983 1212 984 1213 985 if (vmsvga3dCheckGLExtension(pState ->fGLVersion, 3.0, "GL_ARB_framebuffer_object"))1214 if (vmsvga3dCheckGLExtension(pState, 3.0, " GL_ARB_framebuffer_object ")) 986 1215 { 987 1216 pState->ext.glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)OGLGETPROCADDRESS("glIsRenderbuffer"); … … 1048 1277 1049 1278 /* OpenGL 3.2 core */ 1050 if (vmsvga3dCheckGLExtension(pState ->fGLVersion, 3.2, "GL_ARB_draw_elements_base_vertex"))1279 if (vmsvga3dCheckGLExtension(pState, 3.2, " GL_ARB_draw_elements_base_vertex ")) 1051 1280 { 1052 1281 pState->ext.glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)OGLGETPROCADDRESS("glDrawElementsBaseVertex"); … … 1057 1286 1058 1287 /* OpenGL 3.2 core */ 1059 if (vmsvga3dCheckGLExtension(pState ->fGLVersion, 3.2, "GL_ARB_provoking_vertex"))1288 if (vmsvga3dCheckGLExtension(pState, 3.2, " GL_ARB_provoking_vertex ")) 1060 1289 { 1061 1290 pState->ext.glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)OGLGETPROCADDRESS("glProvokingVertex"); … … 1065 1294 1066 1295 /* Extension support */ 1067 #if def VBOX_VMSVGA3D_USE_OPENGL_CORE1296 #if defined(RT_OS_DARWIN) 1068 1297 /** @todo OpenGL version history suggest this, verify... */ 1069 pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension(pState ->fGLVersion, 2.0, "GL_EXT_stencil_two_side");1298 pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension(pState, 2.0, " GL_EXT_stencil_two_side "); 1070 1299 #else 1071 pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension(pState ->fGLVersion, 0.0, "GL_EXT_stencil_two_side");1300 pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension(pState, 0.0, " GL_EXT_stencil_two_side "); 1072 1301 #endif 1073 1302 1074 /* Query capabilities */ 1075 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1076 glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1077 if (glGetError() != GL_NO_ERROR) 1078 { 1079 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pLegacyContext); 1080 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1081 if (glGetError() != GL_NO_ERROR) 1082 pState->caps.maxActiveLights = 1; 1083 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext); 1084 } 1085 #else 1086 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1087 #endif 1088 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_BUFFER_SIZE, &pState->caps.maxTextureBufferSize); 1089 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1090 glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1091 if (glGetError() != GL_NO_ERROR) 1092 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_IMAGE_UNITS, &pState->caps.maxTextures); 1093 #else 1094 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_UNITS_ARB, &pState->caps.maxTextures); 1095 #endif 1096 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances); 1097 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_COLOR_ATTACHMENTS, &pState->caps.maxColorAttachments); 1098 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_RECTANGLE_TEXTURE_SIZE, &pState->caps.maxRectangleTextureSize); 1099 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &pState->caps.maxTextureAnisotropy); 1100 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1101 glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize); 1102 if (glGetError() != GL_NO_ERROR) 1103 { 1104 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pLegacyContext); 1105 VMSVGA3D_INIT_CHECKED(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize)); 1106 if (glGetError() != GL_NO_ERROR) 1107 { 1108 pState->caps.flPointSize[0] = 1; 1109 pState->caps.flPointSize[1] = 1; 1110 } 1111 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext); 1112 } 1113 #else 1114 VMSVGA3D_INIT_CHECKED(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize)); 1115 #endif 1303 /* 1304 * Initialize the capabilities with sensible defaults. 1305 */ 1306 pState->caps.maxActiveLights = 1; 1307 pState->caps.maxTextureBufferSize = 65536; 1308 pState->caps.maxTextures = 1; 1309 pState->caps.maxClipDistances = 4; 1310 pState->caps.maxColorAttachments = 1; 1311 pState->caps.maxRectangleTextureSize = 2048; 1312 pState->caps.maxTextureAnisotropy = 2; 1313 pState->caps.maxVertexShaderInstructions = 1024; 1314 pState->caps.maxFragmentShaderInstructions = 1024; 1315 pState->caps.vertexShaderVersion = SVGA3DVSVERSION_NONE; 1316 pState->caps.fragmentShaderVersion = SVGA3DPSVERSION_NONE; 1317 pState->caps.flPointSize[0] = 1; 1318 pState->caps.flPointSize[1] = 1; 1319 1320 /* 1321 * Query capabilities 1322 */ 1323 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights)); 1324 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, &pState->caps.maxTextureBufferSize)); 1325 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &pState->caps.maxTextures)); 1326 VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances)); 1327 VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &pState->caps.maxColorAttachments)); 1328 VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, &pState->caps.maxRectangleTextureSize)); 1329 VMSVGA3D_INIT_CHECKED(glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &pState->caps.maxTextureAnisotropy)); 1330 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize)); 1116 1331 1117 1332 if (pState->ext.glGetProgramivARB) 1118 1333 { 1119 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE /* None of these queries works with the OpenGL 3.2 Core context on darwin. */ 1120 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pLegacyContext); 1121 #endif 1122 VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1123 &pState->caps.maxFragmentShaderTemps)); 1124 VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1125 &pState->caps.maxFragmentShaderInstructions)); 1126 VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1127 &pState->caps.maxVertexShaderTemps)); 1128 VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1129 &pState->caps.maxVertexShaderInstructions)); 1130 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1131 VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext); 1132 #endif 1133 } 1134 pState->caps.fS3TCSupported = vmsvga3dCheckGLExtension(pState->fGLVersion, 0.0, "GL_EXT_texture_compression_s3tc"); 1334 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, 1335 pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1336 &pState->caps.maxFragmentShaderTemps)); 1337 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, 1338 pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1339 &pState->caps.maxFragmentShaderInstructions)); 1340 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, 1341 pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1342 &pState->caps.maxVertexShaderTemps)); 1343 VMSVGA3D_INIT_CHECKED_BOTH(pState, pContext, pOtherCtx, 1344 pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1345 &pState->caps.maxVertexShaderInstructions)); 1346 } 1347 pState->caps.fS3TCSupported = vmsvga3dCheckGLExtension(pState, 0.0, " GL_EXT_texture_compression_s3tc "); 1135 1348 1136 1349 /* http://http://www.opengl.org/wiki/Detecting_the_Shader_Model … … 1144 1357 */ 1145 1358 /** @todo: distinguish between vertex and pixel shaders??? */ 1146 if ( vmsvga3dCheckGLExtension(pState ->fGLVersion, 0.0, "GL_NV_gpu_program4")1147 || strstr(pState->psz LegacyExtensions, " GL_NV_gpu_program4 "))1359 if ( vmsvga3dCheckGLExtension(pState, 0.0, " GL_NV_gpu_program4 ") 1360 || strstr(pState->pszOtherExtensions, " GL_NV_gpu_program4 ")) 1148 1361 { 1149 1362 pState->caps.vertexShaderVersion = SVGA3DVSVERSION_40; … … 1151 1364 } 1152 1365 else 1153 if ( vmsvga3dCheckGLExtension(pState->fGLVersion, 0.0, "GL_NV_vertex_program3") 1154 || strstr(pState->pszLegacyExtensions, " GL_NV_vertex_program3 ") 1155 #if 0 /** @todo this is contrary to the ATI <= SM2.0. */ 1156 || vmsvga3dCheckGLExtension(pState->fGLVersion, 0.0, "GL_ARB_shader_texture_lod") /* Wine claims this suggests SM 3.0 support */ 1157 || strstr(pState->pszLegacyExtensions, " GL_ARB_shader_texture_lod ") 1158 #endif 1366 if ( vmsvga3dCheckGLExtension(pState, 0.0, " GL_NV_vertex_program3 ") 1367 || strstr(pState->pszOtherExtensions, " GL_NV_vertex_program3 ") 1368 || vmsvga3dCheckGLExtension(pState, 0.0, " GL_ARB_shader_texture_lod ") /* Wine claims this suggests SM 3.0 support */ 1369 || strstr(pState->pszOtherExtensions, " GL_ARB_shader_texture_lod ") 1159 1370 ) 1160 1371 { … … 1163 1374 } 1164 1375 else 1165 if ( vmsvga3dCheckGLExtension(pState ->fGLVersion, 0.0, "GL_ARB_fragment_program")1166 || strstr(pState->psz LegacyExtensions, " GL_ARB_fragment_program "))1376 if ( vmsvga3dCheckGLExtension(pState, 0.0, " GL_ARB_fragment_program ") 1377 || strstr(pState->pszOtherExtensions, " GL_ARB_fragment_program ")) 1167 1378 { 1168 1379 pState->caps.vertexShaderVersion = SVGA3DVSVERSION_20; … … 1176 1387 } 1177 1388 1178 if (!vmsvga3dCheckGLExtension(pState ->fGLVersion, 3.2, "GL_ARB_vertex_array_bgra"))1389 if (!vmsvga3dCheckGLExtension(pState, 3.2, " GL_ARB_vertex_array_bgra ")) 1179 1390 { 1180 1391 /** @todo Intel drivers don't support this extension! */ … … 1265 1476 1266 1477 /* Initialize the shader library. */ 1267 rc = ShaderInitLib(); 1478 pState->ShaderIf.pfnSwitchInitProfile = vmsvga3dShaderIfSwitchInitProfile; 1479 pState->ShaderIf.pfnGetNextExtension = vmsvga3dShaderIfGetNextExtension; 1480 rc = ShaderInitLib(&pState->ShaderIf); 1268 1481 AssertRC(rc); 1269 1482 … … 1271 1484 rc = vmsvga3dContextDestroy(pThis, 1); 1272 1485 AssertRC(rc); 1273 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE1486 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 1274 1487 rc = vmsvga3dContextDestroy(pThis, 2); 1275 1488 AssertRC(rc); 1276 1489 #endif 1277 1490 1278 #if !defined(RT_OS_DARWIN) || defined(VBOX_VMSVGA3D_USE_OPENGL_CORE) 1279 /* on the Mac, OpenGL 3 came very late so we have a capable 2.1 implementation */ 1280 if (pState->fGLVersion < 3.0) 1491 if ( pState->fGLVersion < 3.0 1492 && pState->fOtherGLVersion < 3.0 /* darwin: legacy profile hack */) 1281 1493 { 1282 1494 LogRel(("VMSVGA3d: unsupported OpenGL version; minimum is 3.0\n")); 1283 1495 return VERR_NOT_IMPLEMENTED; 1284 1496 } 1285 #endif1286 1497 if ( !pState->ext.glIsRenderbuffer 1287 1498 || !pState->ext.glBindRenderbuffer … … 1366 1577 #endif 1367 1578 1368 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1369 RTStrFree(pState->pszLegacyExtensions); 1579 RTStrFree(pState->pszExtensions); 1580 pState->pszExtensions = NULL; 1581 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 1582 RTStrFree(pState->pszOtherExtensions); 1370 1583 #endif 1371 pState->psz LegacyExtensions = NULL;1584 pState->pszOtherExtensions = NULL; 1372 1585 1373 1586 return VINF_SUCCESS; … … 3246 3459 * @param pThis VGA device instance data. 3247 3460 * @param cid Context id 3248 * @param fLegacy Whether to create a legacy context instead of 3249 * whatever is default. Only used at init time. 3461 * @param fOtherProfile When clear, the context is created using the default 3462 * OpenGL profile. When set, it's created using the 3463 * alternative profile. The latter is only allowed if 3464 * the VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE is set. 3250 3465 */ 3251 int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid, bool f Legacy)3466 int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid, bool fOtherProfile) 3252 3467 { 3253 3468 int rc; … … 3257 3472 AssertReturn(pState, VERR_NO_MEMORY); 3258 3473 AssertReturn(cid < SVGA3D_MAX_CONTEXT_IDS, VERR_INVALID_PARAMETER); 3259 #if !defined(VBOX_VMSVGA3D_ USE_OPENGL_CORE) || !(defined(RT_OS_DARWIN))3260 AssertReturn(!f Legacy, VERR_INTERNAL_ERROR_3);3474 #if !defined(VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE) || !(defined(RT_OS_DARWIN)) 3475 AssertReturn(!fOtherProfile, VERR_INTERNAL_ERROR_3); 3261 3476 #endif 3262 3477 … … 3266 3481 { 3267 3482 pState->idTestContext = 207; 3268 rc = vmsvga3dContextDefine(pThis, pState->idTestContext, false /*f Legacy*/);3483 rc = vmsvga3dContextDefine(pThis, pState->idTestContext, false /*fOtherProfile*/); 3269 3484 AssertRCReturn(rc, rc); 3270 3485 } … … 3386 3601 3387 3602 #elif defined(RT_OS_DARWIN) 3388 pContext->f Legacy = fLegacy;3603 pContext->fOtherProfile = fOtherProfile; 3389 3604 3390 3605 /* Find the first active context to share the display list with (necessary for sharing e.g. textures between contexts). */ … … 3394 3609 if ( pState->paContext[i].id != SVGA3D_INVALID_ID 3395 3610 && i != pContext->id 3396 && pState->paContext[i].f Legacy == fLegacy)3611 && pState->paContext[i].fOtherProfile == fOtherProfile) 3397 3612 { 3398 3613 Log(("Sharing display lists between cid=%d and cid=%d\n", pContext->id, i)); … … 3401 3616 } 3402 3617 } 3403 vmsvga3dCocoaCreateContext(&pContext->cocoaContext, shareContext, f Legacy);3618 vmsvga3dCocoaCreateContext(&pContext->cocoaContext, shareContext, fOtherProfile); 3404 3619 NativeNSViewRef pHostView = (NativeNSViewRef)pThis->svga.u64HostWindowId; 3405 3620 vmsvga3dCocoaCreateView(&pContext->cocoaView, pHostView); -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-shared.h
r53749 r53755 49 49 uint32_t cPixelShaderConst, cVertexShaderConst, cPixelShaders, cVertexShaders; 50 50 51 rc = vmsvga3dContextDefine(pThis, cid, false /*f Legacy*/);51 rc = vmsvga3dContextDefine(pThis, cid, false /*fOtherProfile*/); 52 52 AssertRCReturn(rc, rc); 53 53 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-win.cpp
r53749 r53755 2902 2902 * @param pThis VGA device instance data. 2903 2903 * @param cid Context id 2904 * @param f LegacyOpenGL(+darwin) specific argument, ignored.2904 * @param fOtherProfile OpenGL(+darwin) specific argument, ignored. 2905 2905 */ 2906 int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid, bool f Legacy)2906 int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid, bool fOtherProfile) 2907 2907 { 2908 2908 int rc; … … 2914 2914 AssertReturn(pState, VERR_NO_MEMORY); 2915 2915 AssertReturn(cid < SVGA3D_MAX_CONTEXT_IDS, VERR_INVALID_PARAMETER); 2916 NOREF(fOtherProfile); 2916 2917 2917 2918 Log(("vmsvga3dContextDefine id %x\n", cid)); … … 5355 5356 } 5356 5357 5357 int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, uint32_t numRanges, SVGA3dPrimitiveRange *pRange, uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor) 5358 int vmsvga3dDrawPrimitives(PVGASTATE pThis, uint32_t cid, uint32_t numVertexDecls, SVGA3dVertexDecl *pVertexDecl, 5359 uint32_t numRanges, SVGA3dPrimitiveRange *pRange, 5360 uint32_t cVertexDivisor, SVGA3dVertexDivisor *pVertexDivisor) 5358 5361 { 5359 5362 PVMSVGA3DCONTEXT pContext; -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d.h
r53750 r53755 62 62 int vmsvga3dSurfaceBlitToScreen(PVGASTATE pThis, uint32_t dest, SVGASignedRect destRect, SVGA3dSurfaceImageId src, SVGASignedRect srcRect, uint32_t cRects, SVGASignedRect *pRect); 63 63 64 int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid, bool f Legacy);64 int vmsvga3dContextDefine(PVGASTATE pThis, uint32_t cid, bool fOtherProfile); 65 65 int vmsvga3dContextDestroy(PVGASTATE pThis, uint32_t cid); 66 66 -
trunk/src/VBox/Devices/Graphics/shaderlib/directx.c
r53741 r53755 1908 1908 #endif 1909 1909 1910 #ifdef VBOX_ VMSVGA3D_USE_OPENGL_CORE1910 #ifdef VBOX_WITH_VMSVGA 1911 1911 /** Checks if @a pszExtension is one of the extensions we're looking for and 1912 1912 * updates @a pGlInfo->supported accordingly. */ … … 1926 1926 1927 1927 /* Context activation is done by the caller. */ 1928 BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter )1928 BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter, struct VBOXVMSVGASHADERIF *pVBoxShaderIf) 1929 1929 { 1930 1930 struct wined3d_driver_info *driver_info = &adapter->driver_info; 1931 1931 struct wined3d_gl_info *gl_info = &adapter->gl_info; 1932 #ifndef VBOX_ VMSVGA3D_USE_OPENGL_CORE1932 #ifndef VBOX_WITH_VMSVGA 1933 1933 const char *GL_Extensions = NULL; 1934 1934 const char *WGL_Extensions = NULL; … … 2008 2008 TRACE_(d3d_caps)("ClipPlanes support - num Planes=%d\n", gl_max); 2009 2009 2010 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE2010 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2011 2011 glGetIntegerv(GL_MAX_LIGHTS, &gl_max); 2012 2012 if (glGetError() != GL_NO_ERROR) 2013 gl_max = 0; 2013 { 2014 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2015 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_LIGHTS, &gl_max)); 2016 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2017 } 2014 2018 #else 2015 2019 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_LIGHTS, &gl_max)); … … 2022 2026 TRACE_(d3d_caps)("Maximum texture size support - max texture size=%d\n", gl_max); 2023 2027 2024 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE2028 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2025 2029 glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv); 2026 2030 if (glGetError() != GL_NO_ERROR) 2027 2031 { 2028 gl_floatv[0] = 1; 2029 gl_floatv[1] = 1; 2032 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2033 VBOX_CHECK_GL_CALL(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv)); 2034 if (glGetError() != GL_NO_ERROR) 2035 gl_floatv[0] = gl_floatv[1] = 1; 2036 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2030 2037 } 2031 2038 #else … … 2037 2044 2038 2045 /* Parse the gl supported features, in theory enabling parts of our code appropriately. */ 2039 #ifndef VBOX_ VMSVGA3D_USE_OPENGL_CORE2040 VBOX_CHECK_GL_CALL(GL_Extensions = (const char *)glGetString(GL_EXTENSIONS));2046 #ifndef VBOX_WITH_VMSVGA 2047 GL_Extensions = (const char *)glGetString(GL_EXTENSIONS); 2041 2048 if (!GL_Extensions) 2042 2049 { … … 2055 2062 gl_info->supported[VBOX_SHARED_CONTEXTS] = TRUE; 2056 2063 2057 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 2058 { 2059 /* We work with OpenGL 3.2+ on darwin, so we need to handle extensions differently. */ 2060 GLint idxExt; 2061 GLint cExtensions = 1024; 2062 float fGLVersion; 2063 VBOX_CHECK_GL_CALL(fGLVersion = atof((const char *)glGetString(GL_VERSION))); 2064 2065 # define GL_NUM_EXTENSIONS 0x821D /// FIXME 2066 extern const GLubyte * glGetStringi(GLenum name, GLuint index); /// FIXME 2067 2068 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_NUM_EXTENSIONS, &cExtensions)); 2069 for (idxExt = 0; idxExt < cExtensions; idxExt++) 2070 { 2071 const char *pszExt; 2072 VBOX_CHECK_GL_CALL((const char *)glGetStringi(GL_EXTENSIONS, idxExt)); 2073 check_gl_extension(gl_info, pszExt); 2074 } 2075 2076 if (fGLVersion >= 1.1) 2077 { 2078 check_gl_extension(gl_info, "GL_EXT_vertex_array"); 2079 check_gl_extension(gl_info, "GL_EXT_polygon_offset"); 2080 check_gl_extension(gl_info, "GL_EXT_blend_logic_op"); 2081 check_gl_extension(gl_info, "GL_EXT_texture"); 2082 check_gl_extension(gl_info, "GL_EXT_copy_texture"); 2083 check_gl_extension(gl_info, "GL_EXT_subtexture"); 2084 check_gl_extension(gl_info, "GL_EXT_texture_object"); 2085 check_gl_extension(gl_info, "GL_ARB_framebuffer_object"); 2086 check_gl_extension(gl_info, "GL_ARB_map_buffer_range"); 2087 check_gl_extension(gl_info, "GL_ARB_vertex_array_object"); 2088 } 2089 if (fGLVersion >= 1.2) 2090 { 2091 check_gl_extension(gl_info, "EXT_texture3D"); 2092 check_gl_extension(gl_info, "EXT_bgra"); 2093 check_gl_extension(gl_info, "EXT_packed_pixels"); 2094 check_gl_extension(gl_info, "EXT_rescale_normal"); 2095 check_gl_extension(gl_info, "EXT_separate_specular_color"); 2096 check_gl_extension(gl_info, "SGIS_texture_edge_clamp"); 2097 check_gl_extension(gl_info, "SGIS_texture_lod"); 2098 check_gl_extension(gl_info, "EXT_draw_range_elements"); 2099 } 2100 if (fGLVersion >= 1.3) 2101 { 2102 check_gl_extension(gl_info, "GL_ARB_texture_compression"); 2103 check_gl_extension(gl_info, "GL_ARB_texture_cube_map"); 2104 check_gl_extension(gl_info, "GL_ARB_multisample"); 2105 check_gl_extension(gl_info, "GL_ARB_multitexture"); 2106 check_gl_extension(gl_info, "GL_ARB_texture_env_add"); 2107 check_gl_extension(gl_info, "GL_ARB_texture_env_combine"); 2108 check_gl_extension(gl_info, "GL_ARB_texture_env_dot3"); 2109 check_gl_extension(gl_info, "GL_ARB_texture_border_clamp"); 2110 check_gl_extension(gl_info, "GL_ARB_transpose_matrix"); 2111 } 2112 if (fGLVersion >= 1.5) 2113 { 2114 check_gl_extension(gl_info, "GL_SGIS_generate_mipmap"); 2115 /*check_gl_extension(gl_info, "GL_NV_blend_equare");*/ 2116 check_gl_extension(gl_info, "GL_ARB_depth_texture"); 2117 check_gl_extension(gl_info, "GL_ARB_shadow"); 2118 check_gl_extension(gl_info, "GL_EXT_fog_coord"); 2119 check_gl_extension(gl_info, "GL_EXT_multi_draw_arrays"); 2120 check_gl_extension(gl_info, "GL_ARB_point_parameters"); 2121 check_gl_extension(gl_info, "GL_EXT_secondary_color"); 2122 check_gl_extension(gl_info, "GL_EXT_blend_func_separate"); 2123 check_gl_extension(gl_info, "GL_EXT_stencil_wrap"); 2124 check_gl_extension(gl_info, "GL_ARB_texture_env_crossbar"); 2125 check_gl_extension(gl_info, "GL_EXT_texture_lod_bias"); 2126 check_gl_extension(gl_info, "GL_ARB_texture_mirrored_repeat"); 2127 check_gl_extension(gl_info, "GL_ARB_window_pos"); 2128 } 2129 if (fGLVersion >= 1.6) 2130 { 2131 check_gl_extension(gl_info, "GL_ARB_vertex_buffer_object"); 2132 check_gl_extension(gl_info, "GL_ARB_occlusion_query"); 2133 check_gl_extension(gl_info, "GL_EXT_shadow_funcs"); 2134 } 2135 if (fGLVersion >= 2.0) 2136 { 2137 check_gl_extension(gl_info, "GL_ARB_shader_objects"); /*??*/ 2138 check_gl_extension(gl_info, "GL_ARB_vertex_shader"); /*??*/ 2139 check_gl_extension(gl_info, "GL_ARB_fragment_shader"); /*??*/ 2140 check_gl_extension(gl_info, "GL_ARB_shading_language_100"); /*??*/ 2141 check_gl_extension(gl_info, "GL_ARB_draw_buffers"); 2142 check_gl_extension(gl_info, "GL_ARB_texture_non_power_of_two"); 2143 check_gl_extension(gl_info, "GL_ARB_point_sprite"); 2144 check_gl_extension(gl_info, "GL_ATI_separate_stencil"); 2145 check_gl_extension(gl_info, "GL_EXT_stencil_two_side"); 2146 } 2147 if (fGLVersion >= 2.1) 2148 { 2149 check_gl_extension(gl_info, "GL_ARB_pixel_buffer_object"); 2150 check_gl_extension(gl_info, "GL_EXT_texture_sRGB"); 2151 } 2152 if (fGLVersion >= 3.0) 2153 { 2154 check_gl_extension(gl_info, "GL_ARB_framebuffer_object"); 2155 check_gl_extension(gl_info, "GL_ARB_map_buffer_range"); 2156 check_gl_extension(gl_info, "GL_ARB_vertex_array_object"); 2157 } 2158 if (fGLVersion >= 3.0) 2159 { 2160 check_gl_extension(gl_info, "GL_ARB_framebuffer_object"); 2161 check_gl_extension(gl_info, "GL_ARB_map_buffer_range"); 2162 check_gl_extension(gl_info, "GL_ARB_vertex_array_object"); 2163 } 2164 if (fGLVersion >= 3.1) 2165 { 2166 check_gl_extension(gl_info, "GL_ARB_copy_buffer"); 2167 check_gl_extension(gl_info, "GL_ARB_uniform_buffer_object"); 2168 } 2169 if (fGLVersion >= 3.2) 2170 { 2171 check_gl_extension(gl_info, "GL_ARB_draw_elements_base_vertex"); 2172 check_gl_extension(gl_info, "GL_ARB_provoking_vertex"); 2173 check_gl_extension(gl_info, "GL_ARB_sync"); 2174 check_gl_extension(gl_info, "GL_ARB_texture_multisample"); 2175 } 2176 if (fGLVersion >= 3.3) 2177 { 2178 check_gl_extension(gl_info, "GL_ARB_blend_func_extended"); 2179 check_gl_extension(gl_info, "GL_ARB_sampler_objects"); 2180 check_gl_extension(gl_info, "GL_ARB_explicit_attrib_location"); 2181 check_gl_extension(gl_info, "GL_ARB_occlusion_query2"); 2182 check_gl_extension(gl_info, "GL_ARB_shader_bit_encoding"); 2183 check_gl_extension(gl_info, "GL_ARB_texture_rgb10_a2ui"); 2184 check_gl_extension(gl_info, "GL_ARB_texture_swizzle"); 2185 check_gl_extension(gl_info, "GL_ARB_timer_query"); 2186 check_gl_extension(gl_info, "GL_ARB_vertex_type_2_10_10_10_rev"); 2187 } 2188 if (fGLVersion >=4.0) 2189 { 2190 check_gl_extension(gl_info, "GL_ARB_texture_query_lod"); 2191 check_gl_extension(gl_info, "GL_ARB_draw_indirect"); 2192 check_gl_extension(gl_info, "GL_ARB_gpu_shader5"); 2193 check_gl_extension(gl_info, "GL_ARB_gpu_shader_fp64"); 2194 check_gl_extension(gl_info, "GL_ARB_shader_subroutine"); 2195 check_gl_extension(gl_info, "GL_ARB_tessellation_shader"); 2196 check_gl_extension(gl_info, "GL_ARB_texture_buffer_object_rgb32"); 2197 check_gl_extension(gl_info, "GL_ARB_texture_cube_map_array"); 2198 check_gl_extension(gl_info, "GL_ARB_texture_gather"); 2199 check_gl_extension(gl_info, "GL_ARB_transform_feedback2"); 2200 check_gl_extension(gl_info, "GL_ARB_transform_feedback3"); 2201 } 2202 if (fGLVersion >=4.1) 2203 { 2204 check_gl_extension(gl_info, "GL_ARB_ES2_compatibility"); 2205 check_gl_extension(gl_info, "GL_ARB_get_program_binary"); 2206 check_gl_extension(gl_info, "GL_ARB_separate_shader_objects"); 2207 check_gl_extension(gl_info, "GL_ARB_shader_precision"); 2208 check_gl_extension(gl_info, "GL_ARB_vertex_attrib_64bit"); 2209 check_gl_extension(gl_info, "GL_ARB_viewport_array"); 2210 } 2211 } 2212 2213 LEAVE_GL(); 2214 2215 #else 2064 #ifdef VBOX_WITH_VMSVGA 2065 { 2066 void *pvEnumCtx = NULL; 2067 char szCurExt[256]; 2068 while (pVBoxShaderIf->pfnGetNextExtension(pVBoxShaderIf, &pvEnumCtx, szCurExt, sizeof(szCurExt), false /*fOtherProfile*/)) 2069 check_gl_extension(gl_info, szCurExt); 2070 2071 /* The cheap way out. */ 2072 pvEnumCtx = NULL; 2073 while (pVBoxShaderIf->pfnGetNextExtension(pVBoxShaderIf, &pvEnumCtx, szCurExt, sizeof(szCurExt), true /*fOtherProfile*/)) 2074 check_gl_extension(gl_info, szCurExt); 2075 } 2076 #else /* VBOX_WITH_VMSVGA */ 2216 2077 while (*GL_Extensions) 2217 2078 { … … 2361 2222 if (gl_info->supported[ARB_MULTITEXTURE]) 2362 2223 { 2363 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE2224 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2364 2225 glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max); 2365 2226 if (glGetError() != GL_NO_ERROR) … … 2426 2287 if (gl_info->supported[ARB_VERTEX_BLEND]) 2427 2288 { 2289 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2290 glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max); 2291 if (glGetError() != GL_NO_ERROR) 2292 { 2293 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2294 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max)); 2295 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2296 } 2297 #else 2428 2298 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max)); 2299 #endif 2429 2300 gl_info->limits.blends = gl_max; 2430 2301 TRACE_(d3d_caps)("Max blends: %u.\n", gl_info->limits.blends); … … 2444 2315 if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) 2445 2316 { 2317 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2318 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max)); 2319 if (glGetError() != GL_NO_ERROR) 2320 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2321 #endif 2446 2322 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max))); 2447 2323 gl_info->limits.arb_ps_float_constants = gl_max; … … 2460 2336 gl_info->limits.arb_ps_local_constants = gl_max; 2461 2337 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM local parameters: %d.\n", gl_info->limits.arb_ps_instructions); 2338 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2339 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2340 #endif 2462 2341 } 2463 2342 if (gl_info->supported[ARB_VERTEX_PROGRAM]) 2464 2343 { 2344 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2345 GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max)); 2346 if (glGetError() != GL_NO_ERROR) 2347 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2348 #endif 2465 2349 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max))); 2466 2350 gl_info->limits.arb_vs_float_constants = gl_max; … … 2476 2360 gl_info->limits.arb_vs_instructions = gl_max; 2477 2361 TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native instructions: %d.\n", gl_info->limits.arb_vs_instructions); 2362 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2363 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2364 #endif 2478 2365 #ifndef VBOX_WITH_VMSVGA 2479 2366 if (test_arb_vs_offset_limit(gl_info)) gl_info->quirks |= WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT; … … 2533 2420 #endif 2534 2421 TRACE_(d3d_caps)("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants); 2535 #ifdef VBOX_VMSVGA3D_ USE_OPENGL_CORE2422 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2536 2423 glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max); 2537 2424 if (glGetError() != GL_NO_ERROR) 2538 gl_max = 60; 2425 { 2426 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2427 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max)); 2428 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2429 } 2539 2430 #else 2540 2431 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max)); … … 2556 2447 if (gl_info->supported[NV_LIGHT_MAX_EXPONENT]) 2557 2448 { 2449 #ifdef VBOX_VMSVGA3D_DUAL_OPENGL_PROFILE 2450 glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess); 2451 if (glGetError() != GL_NO_ERROR) 2452 { 2453 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, true /*fOtherProfile*/); 2454 VBOX_CHECK_GL_CALL(glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess)); 2455 pVBoxShaderIf->pfnSwitchInitProfile(pVBoxShaderIf, false /*fOtherProfile*/); 2456 } 2457 #else 2558 2458 VBOX_CHECK_GL_CALL(glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess)); 2459 #endif 2559 2460 } 2560 2461 else -
trunk/src/VBox/Devices/Graphics/shaderlib/shaderapi.c
r53732 r53755 132 132 glGetAttribLocationARB, ARB_SHADER_OBJECTS, NULL) \ 133 133 134 static struct wined3d_context * pCurrentContext = NULL;135 static struct wined3d_adapter adapter = {0};136 static bool fInitializedLibrary = false;134 static struct wined3d_context *g_pCurrentContext = NULL; 135 static struct wined3d_adapter g_adapter = {0}; 136 static bool g_fInitializedLibrary = false; 137 137 138 138 #define SHADER_SET_CURRENT_CONTEXT(ctx) \ 139 pCurrentContext = (struct wined3d_context *)ctx; 140 141 SHADERDECL(int) ShaderInitLib(void) 142 { 143 struct wined3d_gl_info *gl_info = &adapter.gl_info; 144 139 g_pCurrentContext = (struct wined3d_context *)ctx; 140 141 SHADERDECL(int) ShaderInitLib(PVBOXVMSVGASHADERIF pVBoxShaderIf) 142 { 143 struct wined3d_gl_info *gl_info = &g_adapter.gl_info; 144 145 /* Dynamically load all GL core functions. */ 145 146 #ifdef RT_OS_WINDOWS 146 # define USE_GL_FUNC(pfn) pfn = (void*)GetProcAddress(GetModuleHandle("opengl32.dll"), #pfn);147 # define USE_GL_FUNC(pfn) pfn = (void*)GetProcAddress(GetModuleHandle("opengl32.dll"), #pfn); 147 148 #else 148 # define USE_GL_FUNC(pfn) pfn = (void*)OGLGETPROCADDRESS(#pfn);149 # define USE_GL_FUNC(pfn) pfn = (void*)OGLGETPROCADDRESS(#pfn); 149 150 #endif 150 151 /* Dynamically load all GL core functions */152 151 GL_FUNCS_GEN; 153 152 #undef USE_GL_FUNC 154 153 154 /* Dynamically load all GL extension functions. */ 155 155 #define USE_GL_FUNC(type, pfn, ext, replace) \ 156 156 { \ … … 159 159 GL_EXT_FUNCS_GEN; 160 160 161 IWineD3DImpl_FillGLCaps(&adapter); 162 fInitializedLibrary = true; 161 /* Fill in GL capabilities. */ 162 IWineD3DImpl_FillGLCaps(&g_adapter, pVBoxShaderIf); 163 164 LogRel(("shaderlib: GL Limits:\n")); 165 LogRel(("shaderlib: buffers=%-2u lights=%-2u textures=%-2u texture_stages=%u\n", 166 gl_info->limits.buffers, gl_info->limits.lights, gl_info->limits.textures, gl_info->limits.texture_stages)); 167 LogRel(("shaderlib: fragment_samplers=%-2u vertex_samplers=%-2u combined_samplers=%-3u general_combiners=%u\n", 168 gl_info->limits.fragment_samplers, gl_info->limits.vertex_samplers, gl_info->limits.combined_samplers, gl_info->limits.general_combiners)); 169 LogRel(("shaderlib: sampler_stages=%-2u clipplanes=%-2u texture_size=%-5u texture3d_size=%u\n", 170 gl_info->limits.sampler_stages, gl_info->limits.clipplanes, gl_info->limits.texture_size, gl_info->limits.texture3d_size)); 171 LogRel(("shaderlib: pointsize_max=%d.%d pointsize_min=%d.%d point_sprite_units=%-2u blends=%u\n", 172 (int)gl_info->limits.pointsize_max, (int)(gl_info->limits.pointsize_max * 10) % 10, 173 (int)gl_info->limits.pointsize_min, (int)(gl_info->limits.pointsize_min * 10) % 10, 174 gl_info->limits.point_sprite_units, gl_info->limits.blends)); 175 LogRel(("shaderlib: anisotropy=%-2u shininess=%d.%02d\n", 176 gl_info->limits.anisotropy, (int)gl_info->limits.shininess, (int)(gl_info->limits.shininess * 100) % 100)); 177 LogRel(("shaderlib: glsl_varyings=%-3u glsl_vs_float_constants=%-4u glsl_ps_float_constants=%u\n", 178 gl_info->limits.glsl_varyings, gl_info->limits.glsl_vs_float_constants, gl_info->limits.glsl_ps_float_constants)); 179 LogRel(("shaderlib: arb_vs_instructions=%-4u arb_vs_native_constants=%-4u qarb_vs_float_constants=%u\n", 180 gl_info->limits.arb_vs_instructions, gl_info->limits.arb_vs_native_constants, gl_info->limits.arb_vs_float_constants)); 181 LogRel(("shaderlib: arb_vs_temps=%-2u arb_ps_float_constants=%-4u arb_ps_local_constants=%u\n", 182 gl_info->limits.arb_vs_temps, gl_info->limits.arb_ps_float_constants, gl_info->limits.arb_ps_local_constants)); 183 LogRel(("shaderlib: arb_ps_instructions=%-4u arb_ps_temps=%-2u arb_ps_native_constants=%u\n", 184 gl_info->limits.arb_ps_instructions, gl_info->limits.arb_ps_temps, gl_info->limits.arb_ps_native_constants)); 185 186 g_fInitializedLibrary = true; 163 187 return VINF_SUCCESS; 164 188 } … … 176 200 struct wined3d_context *context_get_current(void) 177 201 { 178 return pCurrentContext;202 return g_pCurrentContext; 179 203 } 180 204 181 205 struct wined3d_context *context_acquire(IWineD3DDeviceImpl *This, IWineD3DSurface *target, enum ContextUsage usage) 182 206 { 183 return pCurrentContext;207 return g_pCurrentContext; 184 208 } 185 209 … … 194 218 AssertReturn(pContext->pDeviceContext, VERR_NO_MEMORY); 195 219 196 pContext->gl_info = & adapter.gl_info;197 198 pContext->pDeviceContext->adapter = & adapter;220 pContext->gl_info = &g_adapter.gl_info; 221 222 pContext->pDeviceContext->adapter = &g_adapter; 199 223 pContext->pDeviceContext->shader_backend = &glsl_shader_backend; 200 224 pContext->pDeviceContext->ps_selected_mode = SHADER_GLSL; … … 204 228 list_init(&pContext->pDeviceContext->shaders); 205 229 206 if ( fInitializedLibrary)230 if (g_fInitializedLibrary) 207 231 { 208 232 struct shader_caps shader_caps; … … 214 238 215 239 memset(&shader_caps, 0, sizeof(shader_caps)); 216 pContext->pDeviceContext->shader_backend->shader_get_caps(& adapter.gl_info, &shader_caps);240 pContext->pDeviceContext->shader_backend->shader_get_caps(&g_adapter.gl_info, &shader_caps); 217 241 pContext->pDeviceContext->d3d_vshader_constantF = shader_caps.MaxVertexShaderConst; 218 242 pContext->pDeviceContext->d3d_pshader_constantF = shader_caps.MaxPixelShaderConst; … … 290 314 291 315 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 292 This = pCurrentContext->pDeviceContext;316 This = g_pCurrentContext->pDeviceContext; 293 317 294 318 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); … … 324 348 325 349 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 326 This = pCurrentContext->pDeviceContext;350 This = g_pCurrentContext->pDeviceContext; 327 351 328 352 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); … … 379 403 380 404 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 381 This = pCurrentContext->pDeviceContext;405 This = g_pCurrentContext->pDeviceContext; 382 406 pShader = (IWineD3DVertexShader* )pShaderObj; 383 407 oldShader = This->updateStateBlock->vertexShader; … … 396 420 if(oldShader) IWineD3DVertexShader_Release(oldShader); 397 421 398 pCurrentContext->fChangedVertexShader = true;399 pCurrentContext->fChangedVertexShaderConstant = true; /* force constant reload. */422 g_pCurrentContext->fChangedVertexShader = true; 423 g_pCurrentContext->fChangedVertexShaderConstant = true; /* force constant reload. */ 400 424 401 425 return VINF_SUCCESS; … … 409 433 410 434 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 411 This = pCurrentContext->pDeviceContext;435 This = g_pCurrentContext->pDeviceContext; 412 436 pShader = (IWineD3DPixelShader* )pShaderObj; 413 437 oldShader = This->updateStateBlock->pixelShader; … … 426 450 if(oldShader) IWineD3DPixelShader_Release(oldShader); 427 451 428 pCurrentContext->fChangedPixelShader = true;429 pCurrentContext->fChangedPixelShaderConstant = true; /* force constant reload. */452 g_pCurrentContext->fChangedPixelShader = true; 453 g_pCurrentContext->fChangedPixelShaderConstant = true; /* force constant reload. */ 430 454 return VINF_SUCCESS; 431 455 } … … 437 461 438 462 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 439 This = pCurrentContext->pDeviceContext;463 This = g_pCurrentContext->pDeviceContext; 440 464 441 465 Log(("(ShaderSetVertexShaderConstantB %p, srcData %p, start %d, count %d)\n", … … 456 480 } 457 481 458 pCurrentContext->fChangedVertexShaderConstant = true;482 g_pCurrentContext->fChangedVertexShaderConstant = true; 459 483 460 484 return VINF_SUCCESS; … … 467 491 468 492 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 469 This = pCurrentContext->pDeviceContext;493 This = g_pCurrentContext->pDeviceContext; 470 494 471 495 Log(("(ShaderSetVertexShaderConstantI %p, srcData %p, start %d, count %d)\n", … … 484 508 } 485 509 486 pCurrentContext->fChangedVertexShaderConstant = true;510 g_pCurrentContext->fChangedVertexShaderConstant = true; 487 511 488 512 return VINF_SUCCESS; … … 494 518 495 519 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 496 This = pCurrentContext->pDeviceContext;520 This = g_pCurrentContext->pDeviceContext; 497 521 498 522 Log(("(ShaderSetVertexShaderConstantF %p, srcData %p, start %d, count %d)\n", … … 511 535 sizeof(*This->updateStateBlock->changed.vertexShaderConstantsF) * count); 512 536 513 pCurrentContext->fChangedVertexShaderConstant = true;537 g_pCurrentContext->fChangedVertexShaderConstant = true; 514 538 515 539 return VINF_SUCCESS; … … 522 546 523 547 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 524 This = pCurrentContext->pDeviceContext;548 This = g_pCurrentContext->pDeviceContext; 525 549 526 550 Log(("(ShaderSetPixelShaderConstantB %p, srcData %p, start %d, count %d)\n", … … 541 565 } 542 566 543 pCurrentContext->fChangedPixelShaderConstant = true;567 g_pCurrentContext->fChangedPixelShaderConstant = true; 544 568 545 569 return VINF_SUCCESS; … … 552 576 553 577 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 554 This = pCurrentContext->pDeviceContext;578 This = g_pCurrentContext->pDeviceContext; 555 579 556 580 Log(("(ShaderSetPixelShaderConstantI %p, srcData %p, start %d, count %d)\n", … … 569 593 } 570 594 571 pCurrentContext->fChangedPixelShaderConstant = true;595 g_pCurrentContext->fChangedPixelShaderConstant = true; 572 596 573 597 return VINF_SUCCESS; … … 579 603 580 604 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 581 This = pCurrentContext->pDeviceContext;605 This = g_pCurrentContext->pDeviceContext; 582 606 583 607 Log(("(ShaderSetPixelShaderConstantF %p, srcData %p, start %d, count %d)\n", … … 597 621 sizeof(*This->updateStateBlock->changed.pixelShaderConstantsF) * count); 598 622 599 pCurrentContext->fChangedPixelShaderConstant = true;623 g_pCurrentContext->fChangedPixelShaderConstant = true; 600 624 601 625 return VINF_SUCCESS; … … 609 633 610 634 SHADER_SET_CURRENT_CONTEXT(pShaderContext); 611 pThis = pCurrentContext->pDeviceContext;635 pThis = g_pCurrentContext->pDeviceContext; 612 636 613 637 glGetIntegerv(GL_VIEWPORT, viewport); … … 630 654 */ 631 655 632 if ( pCurrentContext->fChangedPixelShader633 || pCurrentContext->fChangedVertexShader)634 pThis->shader_backend->shader_select( pCurrentContext, !!pThis->updateStateBlock->pixelShader, !!pThis->updateStateBlock->vertexShader);635 pCurrentContext->fChangedPixelShader =pCurrentContext->fChangedVertexShader = false;636 637 if ( pCurrentContext->fChangedPixelShaderConstant638 || pCurrentContext->fChangedVertexShaderConstant)639 pThis->shader_backend->shader_load_constants( pCurrentContext, !!pThis->updateStateBlock->pixelShader, !!pThis->updateStateBlock->vertexShader);640 pCurrentContext->fChangedPixelShaderConstant = false;641 pCurrentContext->fChangedVertexShaderConstant = false;656 if ( g_pCurrentContext->fChangedPixelShader 657 || g_pCurrentContext->fChangedVertexShader) 658 pThis->shader_backend->shader_select(g_pCurrentContext, !!pThis->updateStateBlock->pixelShader, !!pThis->updateStateBlock->vertexShader); 659 g_pCurrentContext->fChangedPixelShader = g_pCurrentContext->fChangedVertexShader = false; 660 661 if ( g_pCurrentContext->fChangedPixelShaderConstant 662 || g_pCurrentContext->fChangedVertexShaderConstant) 663 pThis->shader_backend->shader_load_constants(g_pCurrentContext, !!pThis->updateStateBlock->pixelShader, !!pThis->updateStateBlock->vertexShader); 664 g_pCurrentContext->fChangedPixelShaderConstant = false; 665 g_pCurrentContext->fChangedVertexShaderConstant = false; 642 666 643 667 return VINF_SUCCESS; -
trunk/src/VBox/Devices/Graphics/shaderlib/shaderlib.h
r53725 r53755 30 30 #endif 31 31 32 /** Pointer to shaderlib callback interface. */ 33 typedef struct VBOXVMSVGASHADERIF *PVBOXVMSVGASHADERIF; 34 /** 35 * Interface the shader lib can use to talk back to the VBox VMSVGA OGL 3D code. 36 */ 37 typedef struct VBOXVMSVGASHADERIF 38 { 39 /** 40 * Switches the initialization profile in builds where we have to juggle two 41 * OpenGL profiles to gather all the data (i.e. mac os x). 42 * 43 * @param pThis Pointer to this structure. 44 * @param fOtherProfile If set, switch to the non-default profile. If 45 * clear, switch back to the default profile. 46 */ 47 DECLCALLBACKMEMBER(void, pfnSwitchInitProfile)(PVBOXVMSVGASHADERIF pThis, bool fOtherProfile); 32 48 33 SHADERDECL(int) ShaderInitLib(void); 49 /** 50 * Extension enumeration function. 51 * 52 * @param pThis Pointer to this structure. 53 * @param ppvEnumCtx Pointer to a void point that's initialized to NULL 54 * before the first call. 55 * @param pszBuf Where to store the extension name. Garbled on 56 * overflow (we assume no overflow). 57 * @param cbBuf The size of the buffer @a pszBuf points to. 58 * @param fOtherProfile Indicates which profile to get extensions from, 59 * we'll use the default profile if CLEAR and the 60 * non-default if SET. 61 */ 62 DECLCALLBACKMEMBER(bool, pfnGetNextExtension)(PVBOXVMSVGASHADERIF pThis, void **ppvEnumCtx, char *pszBuf, size_t cbBuf, 63 bool fOtherProfile); 64 } VBOXVMSVGASHADERIF; 65 66 SHADERDECL(int) ShaderInitLib(PVBOXVMSVGASHADERIF pVBoxShaderIf); 34 67 SHADERDECL(int) ShaderDestroyLib(void); 35 68 -
trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9caps.h
r53741 r53755 292 292 #define D3DMAX30SHADERINSTRUCTIONS 32768 293 293 294 #ifndef VBOX_D3D9CAPS_ONLY_DEFINES295 294 296 295 typedef struct _D3DVSHADERCAPS2_0 { … … 403 402 } D3DCAPS9; 404 403 405 #endif /* !VBOX_D3D9CAPS_ONLY_DEFINES */406 407 404 #endif -
trunk/src/VBox/Devices/Graphics/shaderlib/wined3d_private.h
r53747 r53755 69 69 # include <VBox/log.h> 70 70 # include "winoverride.h" 71 # include "shaderlib.h" 71 72 #endif 72 73 … … 1596 1597 extern void add_gl_compat_wrappers(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; 1597 1598 1598 extern BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter); 1599 struct VBOXVMSVGASHADERIF; 1600 extern BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter, struct VBOXVMSVGASHADERIF *pVBoxShaderIf); 1599 1601 1600 1602
Note:
See TracChangeset
for help on using the changeset viewer.