Changeset 53741 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Jan 5, 2015 11:08:23 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97523
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r53737 r53741 88 88 #include <float.h> 89 89 90 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 91 # define VBOX_D3D9CAPS_ONLY_DEFINES 92 # include "shaderlib/wine/include/d3d9caps.h" /* For some capability constants. */ 93 #endif 94 90 95 91 96 /* Generated by VBoxDef2LazyLoad from the VBoxSVGA3D.def file. */ … … 205 210 #endif 206 211 207 /** Macro wrapping glGetIntegerv for use during initialization. 208 * This will release log errors. */ 212 213 /** 214 * Macro wrapping glGetIntegerv for use during initialization. 215 * Uses AssertLogRelMsg. 216 */ 209 217 #define VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(a_enmGlValue, a_pDest) \ 210 218 do \ … … 212 220 glGetIntegerv(a_enmGlValue, a_pDest); \ 213 221 GLenum iGlError = glGetError(); \ 214 if (RT_UNLIKELY(iGlError != GL_NO_ERROR))\215 LogRel(("VMSVGA3d: glGetIntegerv(" #a_enmGlValue " (%#x),) -> %#x\n", (int)a_enmGlValue, iGlError)); \222 AssertLogRelMsg(iGlError == GL_NO_ERROR, \ 223 ("VMSVGA3d: glGetIntegerv(" #a_enmGlValue " (%#x),) -> %#x\n", (int)a_enmGlValue, iGlError)); \ 216 224 } while (0) 217 225 218 /** Macro for doing something and then checking for errors during initialization. */ 226 /** 227 * Macro for doing something and then checking for errors during initialization. 228 * Uses AssertLogRelMsg. 229 */ 219 230 #define VMSVGA3D_INIT_CHECKED(a_Expr) \ 220 231 do \ … … 222 233 a_Expr; \ 223 234 GLenum iGlError = glGetError(); \ 224 if (RT_UNLIKELY(iGlError != GL_NO_ERROR)) \ 225 LogRel(("VMSVGA3d: " #a_Expr " -> %#x\n", iGlError)); \ 235 AssertLogRelMsg(iGlError == GL_NO_ERROR, ("VMSVGA3d: %s -> %#x\n", #a_Expr, iGlError)); \ 226 236 } while (0) 227 237 … … 654 664 bool fRet = false; 655 665 656 #if defined(RT_OS_DARWIN)666 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 657 667 /* 658 668 * OpenGL 3.2+ core profile (glGetString(GL_EXTENSIONS) returns NULL). … … 782 792 783 793 /* Temporarily. Later start if (fMinGLVersion != 0.0 && fActualGLVersion >= fMinGLVersion) return true; */ 794 #if defined(VBOX_VMSVGA3D_USE_OPENGL_CORE) || !defined(RT_OS_DARWIN) 784 795 AssertMsg(fMinGLVersion == 0.0 || fRet == (fActualGLVersion >= fMinGLVersion), 785 796 ("%s actual:%d min:%d\n", pszWantedExtension, (int)(fActualGLVersion * 10), (int)(fMinGLVersion * 10) )); 797 #endif 786 798 return fRet; 787 799 } … … 793 805 static void vmsvga3dLogRelExtensions(void) 794 806 { 795 #if defined(RT_OS_DARWIN)807 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 796 808 /* OpenGL 3.0 interface (glGetString(GL_EXTENSIONS) return NULL). */ 797 809 PFNGLGETSTRINGIPROC pfnGlGetStringi = (PFNGLGETSTRINGIPROC)OGLGETPROCADDRESS("glGetStringi"); … … 981 993 982 994 /* Extension support */ 983 #ifdef RT_OS_DARWIN995 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 984 996 /** @todo OpenGL version history suggest this, verify... */ 985 997 pState->ext.fEXT_stencil_two_side = vmsvga3dCheckGLExtension(pState->fGLVersion, 2.0, "GL_EXT_stencil_two_side"); … … 1002 1014 1003 1015 /* Query capabilities */ 1016 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1017 glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1018 if (glGetError() != GL_NO_ERROR) 1019 pState->caps.maxActiveLights = 1; 1020 #else 1004 1021 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1022 #endif 1005 1023 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_BUFFER_SIZE, &pState->caps.maxTextureBufferSize); 1024 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1025 glGetIntegerv(GL_MAX_LIGHTS, &pState->caps.maxActiveLights); 1026 if (glGetError() != GL_NO_ERROR) 1027 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_IMAGE_UNITS, &pState->caps.maxTextures); 1028 #else 1006 1029 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_UNITS_ARB, &pState->caps.maxTextures); 1030 #endif 1007 1031 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_CLIP_DISTANCES, &pState->caps.maxClipDistances); 1008 1032 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_COLOR_ATTACHMENTS, &pState->caps.maxColorAttachments); 1009 1033 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_RECTANGLE_TEXTURE_SIZE, &pState->caps.maxRectangleTextureSize); 1010 1034 VMSVGA3D_INIT_CHECKED_GL_GET_INTEGER_VALUE(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &pState->caps.maxTextureAnisotropy); 1035 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1036 glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize); 1037 if (glGetError() != GL_NO_ERROR) 1038 { 1039 pState->caps.flPointSize[0] = 1; 1040 pState->caps.flPointSize[1] = 1; 1041 } 1042 #else 1011 1043 VMSVGA3D_INIT_CHECKED(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pState->caps.flPointSize)); 1044 #endif 1012 1045 1013 1046 if (pState->ext.glGetProgramivARB) 1014 1047 { 1048 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1049 pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1050 &pState->caps.maxFragmentShaderTemps); 1051 if (glGetError() != GL_NO_ERROR) 1052 pState->caps.maxFragmentShaderTemps = D3DVS20_MAX_NUMTEMPS; 1053 pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1054 &pState->caps.maxFragmentShaderInstructions); 1055 if (glGetError() != GL_NO_ERROR) 1056 pState->caps.maxFragmentShaderInstructions = 0; 1057 1058 pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1059 &pState->caps.maxVertexShaderTemps); 1060 if (glGetError() != GL_NO_ERROR) 1061 pState->caps.maxVertexShaderTemps = D3DVS20_MAX_NUMTEMPS; 1062 pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1063 &pState->caps.maxVertexShaderInstructions); 1064 if (glGetError() != GL_NO_ERROR) 1065 pState->caps.maxVertexShaderInstructions = 0; 1066 1067 #else 1015 1068 VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, 1016 1069 &pState->caps.maxFragmentShaderTemps)); … … 1021 1074 VMSVGA3D_INIT_CHECKED(pState->ext.glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, 1022 1075 &pState->caps.maxVertexShaderInstructions)); 1076 #endif 1023 1077 } 1024 1078 pState->caps.fS3TCSupported = vmsvga3dCheckGLExtension(pState->fGLVersion, 0.0, "GL_EXT_texture_compression_s3tc"); … … 1158 1212 AssertRC(rc); 1159 1213 1160 #if ndef RT_OS_DARWIN1214 #if !defined(RT_OS_DARWIN) || defined(VBOX_VMSVGA3D_USE_OPENGL_CORE) 1161 1215 /* on the Mac, OpenGL 3 came very late so we have a capable 2.1 implementation */ 1162 1216 if (pState->fGLVersion < 3.0) -
trunk/src/VBox/Devices/Graphics/shaderlib/directx.c
r53731 r53741 1908 1908 #endif 1909 1909 1910 #if defined(RT_OS_DARWIN)1910 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 1911 1911 /** Checks if @a pszExtension is one of the extensions we're looking for and 1912 1912 * updates @a pGlInfo->supported accordingly. */ … … 1930 1930 struct wined3d_driver_info *driver_info = &adapter->driver_info; 1931 1931 struct wined3d_gl_info *gl_info = &adapter->gl_info; 1932 #if !defined(RT_OS_DARWIN)1932 #ifndef VBOX_VMSVGA3D_USE_OPENGL_CORE 1933 1933 const char *GL_Extensions = NULL; 1934 1934 const char *WGL_Extensions = NULL; … … 1951 1951 ENTER_GL(); 1952 1952 1953 gl_renderer_str = (const char *)glGetString(GL_RENDERER);1953 VBOX_CHECK_GL_CALL(gl_renderer_str = (const char *)glGetString(GL_RENDERER)); 1954 1954 TRACE_(d3d_caps)("GL_RENDERER: %s.\n", debugstr_a(gl_renderer_str)); 1955 1955 if (!gl_renderer_str) … … 1960 1960 } 1961 1961 1962 gl_vendor_str = (const char *)glGetString(GL_VENDOR);1962 VBOX_CHECK_GL_CALL(gl_vendor_str = (const char *)glGetString(GL_VENDOR)); 1963 1963 TRACE_(d3d_caps)("GL_VENDOR: %s.\n", debugstr_a(gl_vendor_str)); 1964 1964 if (!gl_vendor_str) … … 1970 1970 1971 1971 /* Parse the GL_VERSION field into major and minor information */ 1972 gl_version_str = (const char *)glGetString(GL_VERSION);1972 VBOX_CHECK_GL_CALL(gl_version_str = (const char *)glGetString(GL_VERSION)); 1973 1973 TRACE_(d3d_caps)("GL_VERSION: %s.\n", debugstr_a(gl_version_str)); 1974 1974 if (!gl_version_str) … … 2004 2004 2005 2005 /* Retrieve opengl defaults */ 2006 glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max);2006 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_CLIP_PLANES, &gl_max)); 2007 2007 gl_info->limits.clipplanes = min(WINED3DMAXUSERCLIPPLANES, gl_max); 2008 2008 TRACE_(d3d_caps)("ClipPlanes support - num Planes=%d\n", gl_max); 2009 2009 2010 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 2010 2011 glGetIntegerv(GL_MAX_LIGHTS, &gl_max); 2012 if (glGetError() != GL_NO_ERROR) 2013 gl_max = 0; 2014 #else 2015 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_LIGHTS, &gl_max)); 2016 #endif 2011 2017 gl_info->limits.lights = gl_max; 2012 2018 TRACE_(d3d_caps)("Lights support - max lights=%d\n", gl_max); 2013 2019 2014 glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max);2020 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max)); 2015 2021 gl_info->limits.texture_size = gl_max; 2016 2022 TRACE_(d3d_caps)("Maximum texture size support - max texture size=%d\n", gl_max); 2017 2023 2024 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 2018 2025 glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv); 2026 if (glGetError() != GL_NO_ERROR) 2027 { 2028 gl_floatv[0] = 1; 2029 gl_floatv[1] = 1; 2030 } 2031 #else 2032 VBOX_CHECK_GL_CALL(glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, gl_floatv)); 2033 #endif 2019 2034 gl_info->limits.pointsize_min = gl_floatv[0]; 2020 2035 gl_info->limits.pointsize_max = gl_floatv[1]; … … 2022 2037 2023 2038 /* Parse the gl supported features, in theory enabling parts of our code appropriately. */ 2024 #if !defined(RT_OS_DARWIN)2025 GL_Extensions = (const char *)glGetString(GL_EXTENSIONS);2039 #ifndef VBOX_VMSVGA3D_USE_OPENGL_CORE 2040 VBOX_CHECK_GL_CALL(GL_Extensions = (const char *)glGetString(GL_EXTENSIONS)); 2026 2041 if (!GL_Extensions) 2027 2042 { … … 2040 2055 gl_info->supported[VBOX_SHARED_CONTEXTS] = TRUE; 2041 2056 2042 #if defined(RT_OS_DARWIN)2057 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 2043 2058 { 2044 2059 /* We work with OpenGL 3.2+ on darwin, so we need to handle extensions differently. */ 2045 2060 GLint idxExt; 2046 2061 GLint cExtensions = 1024; 2047 float fGLVersion = atof((const char *)glGetString(GL_VERSION)); 2062 float fGLVersion; 2063 VBOX_CHECK_GL_CALL(fGLVersion = atof((const char *)glGetString(GL_VERSION))); 2048 2064 2049 2065 # define GL_NUM_EXTENSIONS 0x821D /// FIXME 2050 2066 extern const GLubyte * glGetStringi(GLenum name, GLuint index); /// FIXME 2051 2067 2052 glGetIntegerv(GL_NUM_EXTENSIONS, &cExtensions);2068 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_NUM_EXTENSIONS, &cExtensions)); 2053 2069 for (idxExt = 0; idxExt < cExtensions; idxExt++) 2054 check_gl_extension(gl_info, (const char *)glGetStringi(GL_EXTENSIONS, 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 } 2055 2075 2056 2076 if (fGLVersion >= 1.1) … … 2329 2349 if (gl_info->supported[NV_REGISTER_COMBINERS]) 2330 2350 { 2331 glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &gl_max);2351 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &gl_max)); 2332 2352 gl_info->limits.general_combiners = gl_max; 2333 2353 TRACE_(d3d_caps)("Max general combiners: %d.\n", gl_max); … … 2335 2355 if (gl_info->supported[ARB_DRAW_BUFFERS]) 2336 2356 { 2337 glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &gl_max);2357 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &gl_max)); 2338 2358 gl_info->limits.buffers = gl_max; 2339 2359 TRACE_(d3d_caps)("Max draw buffers: %u.\n", gl_max); … … 2341 2361 if (gl_info->supported[ARB_MULTITEXTURE]) 2342 2362 { 2363 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 2343 2364 glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max); 2365 if (glGetError() != GL_NO_ERROR) 2366 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &gl_max)); 2367 #else 2368 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max)); 2369 #endif 2344 2370 gl_info->limits.textures = min(MAX_TEXTURES, gl_max); 2345 2371 TRACE_(d3d_caps)("Max textures: %d.\n", gl_info->limits.textures); … … 2348 2374 { 2349 2375 GLint tmp; 2350 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &tmp);2376 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS_ARB, &tmp)); 2351 2377 gl_info->limits.fragment_samplers = min(MAX_FRAGMENT_SAMPLERS, tmp); 2352 2378 } … … 2360 2386 { 2361 2387 GLint tmp; 2362 glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &tmp);2388 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &tmp)); 2363 2389 gl_info->limits.vertex_samplers = tmp; 2364 glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &tmp);2390 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &tmp)); 2365 2391 gl_info->limits.combined_samplers = tmp; 2366 2392 … … 2400 2426 if (gl_info->supported[ARB_VERTEX_BLEND]) 2401 2427 { 2402 glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max);2428 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max)); 2403 2429 gl_info->limits.blends = gl_max; 2404 2430 TRACE_(d3d_caps)("Max blends: %u.\n", gl_info->limits.blends); … … 2406 2432 if (gl_info->supported[EXT_TEXTURE3D]) 2407 2433 { 2408 glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max);2434 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max)); 2409 2435 gl_info->limits.texture3d_size = gl_max; 2410 2436 TRACE_(d3d_caps)("Max texture3D size: %d.\n", gl_info->limits.texture3d_size); … … 2412 2438 if (gl_info->supported[EXT_TEXTURE_FILTER_ANISOTROPIC]) 2413 2439 { 2414 glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max);2440 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gl_max)); 2415 2441 gl_info->limits.anisotropy = gl_max; 2416 2442 TRACE_(d3d_caps)("Max anisotropy: %d.\n", gl_info->limits.anisotropy); … … 2418 2444 if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) 2419 2445 { 2420 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max));2446 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max))); 2421 2447 gl_info->limits.arb_ps_float_constants = gl_max; 2422 2448 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM float constants: %d.\n", gl_info->limits.arb_ps_float_constants); 2423 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max));2449 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max))); 2424 2450 gl_info->limits.arb_ps_native_constants = gl_max; 2425 2451 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native float constants: %d.\n", 2426 2452 gl_info->limits.arb_ps_native_constants); 2427 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max));2453 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max))); 2428 2454 gl_info->limits.arb_ps_temps = gl_max; 2429 2455 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native temporaries: %d.\n", gl_info->limits.arb_ps_temps); 2430 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max));2456 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max))); 2431 2457 gl_info->limits.arb_ps_instructions = gl_max; 2432 2458 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM native instructions: %d.\n", gl_info->limits.arb_ps_instructions); 2433 GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &gl_max));2459 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB, GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB, &gl_max))); 2434 2460 gl_info->limits.arb_ps_local_constants = gl_max; 2435 2461 TRACE_(d3d_caps)("Max ARB_FRAGMENT_PROGRAM local parameters: %d.\n", gl_info->limits.arb_ps_instructions); … … 2437 2463 if (gl_info->supported[ARB_VERTEX_PROGRAM]) 2438 2464 { 2439 GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max));2465 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_ENV_PARAMETERS_ARB, &gl_max))); 2440 2466 gl_info->limits.arb_vs_float_constants = gl_max; 2441 2467 TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM float constants: %d.\n", gl_info->limits.arb_vs_float_constants); 2442 GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max));2468 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB, &gl_max))); 2443 2469 gl_info->limits.arb_vs_native_constants = gl_max; 2444 2470 TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native float constants: %d.\n", 2445 2471 gl_info->limits.arb_vs_native_constants); 2446 GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max));2472 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB, &gl_max))); 2447 2473 gl_info->limits.arb_vs_temps = gl_max; 2448 2474 TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native temporaries: %d.\n", gl_info->limits.arb_vs_temps); 2449 GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max));2475 VBOX_CHECK_GL_CALL(GL_EXTCALL(glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, &gl_max))); 2450 2476 gl_info->limits.arb_vs_instructions = gl_max; 2451 2477 TRACE_(d3d_caps)("Max ARB_VERTEX_PROGRAM native instructions: %d.\n", gl_info->limits.arb_vs_instructions); … … 2456 2482 if (gl_info->supported[ARB_VERTEX_SHADER]) 2457 2483 { 2458 glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max);2484 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max)); 2459 2485 gl_info->limits.glsl_vs_float_constants = gl_max / 4; 2460 2486 #ifdef VBOX_WITH_WDDM … … 2483 2509 if (gl_info->supported[ARB_FRAGMENT_SHADER]) 2484 2510 { 2485 glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max);2511 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max)); 2486 2512 gl_info->limits.glsl_ps_float_constants = gl_max / 4; 2487 2513 #ifdef VBOX_WITH_WDDM … … 2507 2533 #endif 2508 2534 TRACE_(d3d_caps)("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants); 2535 #ifdef VBOX_VMSVGA3D_USE_OPENGL_CORE 2509 2536 glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max); 2537 if (glGetError() != GL_NO_ERROR) 2538 gl_max = 60; 2539 #else 2540 VBOX_CHECK_GL_CALL(glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max)); 2541 #endif 2510 2542 gl_info->limits.glsl_varyings = gl_max; 2511 2543 TRACE_(d3d_caps)("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_max, gl_max / 4); … … 2524 2556 if (gl_info->supported[NV_LIGHT_MAX_EXPONENT]) 2525 2557 { 2526 glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess);2558 VBOX_CHECK_GL_CALL(glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess)); 2527 2559 } 2528 2560 else -
trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/d3d9caps.h
r53206 r53741 292 292 #define D3DMAX30SHADERINSTRUCTIONS 32768 293 293 294 #ifndef VBOX_D3D9CAPS_ONLY_DEFINES 294 295 295 296 typedef struct _D3DVSHADERCAPS2_0 { … … 402 403 } D3DCAPS9; 403 404 405 #endif /* !VBOX_D3D9CAPS_ONLY_DEFINES */ 406 404 407 #endif -
trunk/src/VBox/Devices/Graphics/shaderlib/wined3d_private.h
r53735 r53741 3438 3438 #endif 3439 3439 3440 #endif 3440 /** @def VBOX_CHECK_GL_CALL 3441 * Performs OpenGL call @a a_Expr and check glGetError. 3442 * Errors will be asserted in strict builds and hit the release log in 3443 * non-strict builds. 3444 * @param a_Expr The OpenGL call expression. Always executed! 3445 */ 3446 #ifdef VBOX_WITH_VMSVGA 3447 # define VBOX_CHECK_GL_CALL(a_Expr) \ 3448 do { \ 3449 GLint rcCheckCall; \ 3450 a_Expr; \ 3451 rcCheckCall = glGetError(); \ 3452 AssertLogRelMsg(rcCheckCall == GL_NO_ERROR, ("%s -> %#x\n", #a_Expr, rcCheckCall)); \ 3453 } while (0) 3454 #else 3455 # define VBOX_CHECK_GL_CALL(a_Expr) do { a_Expr; } while (0) 3456 #endif 3457 3458 #endif
Note:
See TracChangeset
for help on using the changeset viewer.