17ec681f3SmrgViewperf Issues 27ec681f3Smrg=============== 37ec681f3Smrg 47ec681f3SmrgThis page lists known issues with `SPEC Viewperf 57ec681f3Smrg11 <https://www.spec.org/gwpg/gpc.static/vp11info.html>`__ and `SPEC 67ec681f3SmrgViewperf 12 <https://www.spec.org/gwpg/gpc.static/vp12info.html>`__ when 77ec681f3Smrgrunning on Mesa-based drivers. 87ec681f3Smrg 97ec681f3SmrgThe Viewperf data sets are basically GL API traces that are recorded 107ec681f3Smrgfrom CAD applications, then replayed in the Viewperf framework. 117ec681f3Smrg 127ec681f3SmrgThe primary problem with these traces is they blindly use features and 137ec681f3SmrgOpenGL extensions that were supported by the OpenGL driver when the 147ec681f3Smrgtrace was recorded, but there's no checks to see if those features are 157ec681f3Smrgsupported by the driver when playing back the traces with Viewperf. 167ec681f3Smrg 177ec681f3SmrgThese issues have been reported to the SPEC organization in the hope 187ec681f3Smrgthat they'll be fixed in the future. 197ec681f3Smrg 207ec681f3SmrgViewperf 11 217ec681f3Smrg----------- 227ec681f3Smrg 237ec681f3SmrgSome of the Viewperf 11 tests use a lot of memory. At least 2GB of RAM 247ec681f3Smrgis recommended. 257ec681f3Smrg 267ec681f3SmrgCatia-03 test 2 277ec681f3Smrg~~~~~~~~~~~~~~~ 287ec681f3Smrg 297ec681f3SmrgThis test creates over 38000 vertex buffer objects. On some systems this 307ec681f3Smrgcan exceed the maximum number of buffer allocations. Mesa generates 317ec681f3SmrgGL_OUT_OF_MEMORY errors in this situation, but Viewperf does no error 327ec681f3Smrgchecking and continues. When this happens, some drawing commands become 337ec681f3Smrgno-ops. This can also eventually lead to a segfault either in Viewperf 347ec681f3Smrgor the Mesa driver. 357ec681f3Smrg 367ec681f3SmrgCatia-03 tests 3, 4, 8 377ec681f3Smrg~~~~~~~~~~~~~~~~~~~~~~ 387ec681f3Smrg 397ec681f3SmrgThese tests use features of the 407ec681f3Smrg`GL_NV_fragment_program2 <https://www.opengl.org/registry/specs/NV/fragment_program2.txt>`__ 417ec681f3Smrgand 427ec681f3Smrg`GL_NV_vertex_program3 <https://www.opengl.org/registry/specs/NV/vertex_program3.txt>`__ 437ec681f3Smrgextensions without checking if the driver supports them. 447ec681f3Smrg 457ec681f3SmrgWhen Mesa tries to compile the vertex/fragment programs it generates 467ec681f3Smrgerrors (which Viewperf ignores). Subsequent drawing calls become no-ops 477ec681f3Smrgand the rendering is incorrect. 487ec681f3Smrg 497ec681f3Smrgsw-02 tests 1, 2, 4, 6 507ec681f3Smrg~~~~~~~~~~~~~~~~~~~~~~ 517ec681f3Smrg 527ec681f3SmrgThese tests depend on the 537ec681f3Smrg`GL_NV_primitive_restart <https://www.opengl.org/registry/specs/NV/primitive_restart.txt>`__ 547ec681f3Smrgextension. 557ec681f3Smrg 567ec681f3SmrgIf the Mesa driver doesn't support this extension the rendering will be 577ec681f3Smrgincorrect and the test will fail. 587ec681f3Smrg 597ec681f3SmrgAlso, the color of the line drawings in test 2 seem to appear in a 607ec681f3Smrgrandom color. This is probably due to some uninitialized state 617ec681f3Smrgsomewhere. 627ec681f3Smrg 637ec681f3Smrgsw-02 test 6 647ec681f3Smrg~~~~~~~~~~~~ 657ec681f3Smrg 667ec681f3SmrgThe lines drawn in this test appear in a random color. That's because 677ec681f3Smrgtexture mapping is enabled when the lines are drawn, but no texture 687ec681f3Smrgimage is defined (glTexImage2D() is called with pixels=NULL). Since GL 697ec681f3Smrgsays the contents of the texture image are undefined in that situation, 707ec681f3Smrgwe get a random color. 717ec681f3Smrg 727ec681f3SmrgLightwave-01 test 3 737ec681f3Smrg~~~~~~~~~~~~~~~~~~~ 747ec681f3Smrg 757ec681f3SmrgThis test uses a number of mipmapped textures, but the textures are 767ec681f3Smrgincomplete because the last/smallest mipmap level (1 x 1 pixel) is never 777ec681f3Smrgspecified. 787ec681f3Smrg 797ec681f3SmrgA trace captured with `API 807ec681f3Smrgtrace <https://github.com/apitrace/apitrace>`__ shows this sequences of 817ec681f3Smrgcalls like this: 827ec681f3Smrg 837ec681f3Smrg:: 847ec681f3Smrg 857ec681f3Smrg 2504 glBindTexture(target = GL_TEXTURE_2D, texture = 55) 867ec681f3Smrg 2505 glTexImage2D(target = GL_TEXTURE_2D, level = 0, internalformat = GL_RGBA, width = 512, height = 512, border = 0, format = GL_RGB, type = GL_UNSIGNED_SHORT, pixels = blob(1572864)) 877ec681f3Smrg 2506 glTexImage2D(target = GL_TEXTURE_2D, level = 1, internalformat = GL_RGBA, width = 256, height = 256, border = 0, format = GL_RGB, type = GL_UNSIGNED_SHORT, pixels = blob(393216)) 887ec681f3Smrg 2507 glTexImage2D(target = GL_TEXTURE_2D, level = 2, internalformat = GL_RGBA, width = 128, height = 128, border = 0, format = GL_RGB, type = GL_UNSIGNED_SHORT, pixels = blob(98304)) 897ec681f3Smrg [...] 907ec681f3Smrg 2512 glTexImage2D(target = GL_TEXTURE_2D, level = 7, internalformat = GL_RGBA, width = 4, height = 4, border = 0, format = GL_RGB, type = GL_UNSIGNED_SHORT, pixels = blob(96)) 917ec681f3Smrg 2513 glTexImage2D(target = GL_TEXTURE_2D, level = 8, internalformat = GL_RGBA, width = 2, height = 2, border = 0, format = GL_RGB, type = GL_UNSIGNED_SHORT, pixels = blob(24)) 927ec681f3Smrg 2514 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_MIN_FILTER, param = GL_LINEAR_MIPMAP_LINEAR) 937ec681f3Smrg 2515 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_WRAP_S, param = GL_REPEAT) 947ec681f3Smrg 2516 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_WRAP_T, param = GL_REPEAT) 957ec681f3Smrg 2517 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_MAG_FILTER, param = GL_NEAREST) 967ec681f3Smrg 977ec681f3SmrgNote that one would expect call 2514 to be glTexImage(level=9, width=1, 987ec681f3Smrgheight=1) but it's not there. 997ec681f3Smrg 1007ec681f3SmrgThe minification filter is GL_LINEAR_MIPMAP_LINEAR and the texture's 1017ec681f3SmrgGL_TEXTURE_MAX_LEVEL is 1000 (the default) so a full mipmap is expected. 1027ec681f3Smrg 1037ec681f3SmrgLater, these incomplete textures are bound before drawing calls. 1047ec681f3SmrgAccording to the GL specification, if a fragment program or fragment 1057ec681f3Smrgshader is being used, the sampler should return (0,0,0,1) ("black") when 1067ec681f3Smrgsampling from an incomplete texture. This is what Mesa does and the 1077ec681f3Smrgresulting rendering is darker than it should be. 1087ec681f3Smrg 1097ec681f3SmrgIt appears that NVIDIA's driver (and possibly AMD's driver) detects this 1107ec681f3Smrgcase and returns (1,1,1,1) (white) which causes the rendering to appear 1117ec681f3Smrgbrighter and match the reference image (however, AMD's rendering is 1127ec681f3Smrg*much* brighter than NVIDIA's). 1137ec681f3Smrg 1147ec681f3SmrgIf the fallback texture created in \_mesa_get_fallback_texture() is 1157ec681f3Smrginitialized to be full white instead of full black the rendering appears 1167ec681f3Smrgcorrect. However, we have no plans to implement this work-around in 1177ec681f3SmrgMesa. 1187ec681f3Smrg 1197ec681f3SmrgMaya-03 test 2 1207ec681f3Smrg~~~~~~~~~~~~~~ 1217ec681f3Smrg 1227ec681f3SmrgThis test makes some unusual calls to glRotate. For example: 1237ec681f3Smrg 1247ec681f3Smrg.. code-block:: c 1257ec681f3Smrg 1267ec681f3Smrg glRotate(50, 50, 50, 1); 1277ec681f3Smrg glRotate(100, 100, 100, 1); 1287ec681f3Smrg glRotate(52, 52, 52, 1); 1297ec681f3Smrg 1307ec681f3SmrgThese unusual values lead to invalid modelview matrices. For example, 1317ec681f3Smrgthe last glRotate command above produces this matrix with Mesa: 1327ec681f3Smrg 1337ec681f3Smrg.. math:: 1347ec681f3Smrg 1357ec681f3Smrg \begin{matrix} 1367ec681f3Smrg 1.08536 \times 10^{24} & 2.55321 \times 10^{-23} & -0.000160389 & 0\\ 1377ec681f3Smrg 5.96937 \times 10^{25} & 1.08536 \times 10^{24} & 103408 & 0\\ 1387ec681f3Smrg 103408 & -0.000160389 & 1.74755\times 10^{9} & 0\\ 1397ec681f3Smrg 0 & 0 & 0 & nan 1407ec681f3Smrg \end{matrix} 1417ec681f3Smrg 1427ec681f3Smrgand with NVIDIA's OpenGL: 1437ec681f3Smrg 1447ec681f3Smrg.. math:: 1457ec681f3Smrg 1467ec681f3Smrg \begin{matrix} 1477ec681f3Smrg 1.4013 \times 10^{-45} & 0 & -nan & 0\\ 1487ec681f3Smrg 0 & 1.4013 \times 10^{-45} & 1.4013 \times 10^{-45} & 0\\ 1497ec681f3Smrg 1.4013 \times 10^{-45} & -nan & 1.4013 \times 10^{-45} & 0\\ 1507ec681f3Smrg 0 & 0 & 0 & 1.4013 \times 10^{-45} 1517ec681f3Smrg \end{matrix} 1527ec681f3Smrg 1537ec681f3SmrgThis causes the object in question to be drawn in a strange orientation 1547ec681f3Smrgand with a semi-random color (between white and black) since GL_FOG is 1557ec681f3Smrgenabled. 1567ec681f3Smrg 1577ec681f3SmrgProe-05 test 1 1587ec681f3Smrg~~~~~~~~~~~~~~ 1597ec681f3Smrg 1607ec681f3SmrgThis uses depth testing but there's two problems: 1617ec681f3Smrg 1627ec681f3Smrg#. The glXChooseFBConfig() call doesn't request a depth buffer 1637ec681f3Smrg#. The test never calls glClear(GL_DEPTH_BUFFER_BIT) to initialize the 1647ec681f3Smrg depth buffer 1657ec681f3Smrg 1667ec681f3SmrgIf the chosen visual does not have a depth buffer, you'll see the 1677ec681f3Smrgwireframe car model but it won't be rendered correctly. 1687ec681f3Smrg 1697ec681f3SmrgIf (by luck) the chosen visual has a depth buffer, its initial contents 1707ec681f3Smrgwill be undefined so you may or may not see parts of the model. 1717ec681f3Smrg 1727ec681f3SmrgInterestingly, with NVIDIA's driver most visuals happen to have a depth 1737ec681f3Smrgbuffer and apparently the contents are initialized to 1.0 by default so 1747ec681f3Smrgthis test just happens to work with their drivers. 1757ec681f3Smrg 1767ec681f3SmrgFinally, even if a depth buffer was requested and the 1777ec681f3SmrgglClear(GL_COLOR_BUFFER_BIT) calls were changed to 1787ec681f3SmrgglClear(GL_COLOR_BUFFER_BIT \| GL_DEPTH_BUFFER_BIT) the problem still 1797ec681f3Smrgwouldn't be fixed because GL_DEPTH_WRITEMASK=GL_FALSE when glClear is 1807ec681f3Smrgcalled so clearing the depth buffer would be a no-op anyway. 1817ec681f3Smrg 1827ec681f3SmrgProe-05 test 6 1837ec681f3Smrg~~~~~~~~~~~~~~ 1847ec681f3Smrg 1857ec681f3SmrgThis test draws an engine model with a two-pass algorithm. The first 1867ec681f3Smrgpass is drawn with polygon stipple enabled. The second pass is drawn 1877ec681f3Smrgwithout polygon stipple but with blending and GL_DEPTH_FUNC=GL_LEQUAL. 1887ec681f3SmrgIf either of the two passes happen to use a software fallback of some 1897ec681f3Smrgsort, the Z values of fragments may be different between the two passes. 1907ec681f3SmrgThis leads to incorrect rendering. 1917ec681f3Smrg 1927ec681f3SmrgFor example, the VMware SVGA Gallium driver uses a special semi-fallback 1937ec681f3Smrgpath for drawing with polygon stipple. Since the two passes are rendered 1947ec681f3Smrgwith different vertex transformation implementations, the rendering 1957ec681f3Smrgdoesn't appear as expected. Setting the SVGA_FORCE_SWTNL environment 1967ec681f3Smrgvariable to 1 will force the driver to use the software vertex path all 1977ec681f3Smrgthe time and clears up this issue. 1987ec681f3Smrg 1997ec681f3SmrgAccording to the OpenGL invariance rules, there's no guarantee that the 2007ec681f3Smrgpixels produced by these two rendering states will match. To achieve 2017ec681f3Smrginvariance, both passes should enable polygon stipple and blending with 2027ec681f3Smrgappropriate patterns/modes to ensure the same fragments are produced in 2037ec681f3Smrgboth passes. 2047ec681f3Smrg 2057ec681f3SmrgViewperf 12 2067ec681f3Smrg----------- 2077ec681f3Smrg 2087ec681f3SmrgNote that Viewperf 12 only runs on 64-bit Windows 7 or later. 2097ec681f3Smrg 2107ec681f3Smrgcatia-04 2117ec681f3Smrg~~~~~~~~ 2127ec681f3Smrg 2137ec681f3SmrgOne of the catia tests calls wglGetProcAddress() to get some 2147ec681f3SmrgGL_EXT_direct_state_access functions (such as glBindMultiTextureEXT) and 2157ec681f3Smrgsome GL_NV_half_float functions (such as glMultiTexCoord3hNV). If the 2167ec681f3Smrgextension/function is not supported, wglGetProcAddress() can return 2177ec681f3SmrgNULL. Unfortunately, Viewperf doesn't check for null pointers and 2187ec681f3Smrgcrashes when it later tries to use the pointer. 2197ec681f3Smrg 2207ec681f3SmrgAnother catia test uses OpenGL 3.1's primitive restart feature. But when 2217ec681f3SmrgViewperf creates an OpenGL context, it doesn't request version 3.1 If 2227ec681f3Smrgthe driver returns version 3.0 or earlier all the calls related to 2237ec681f3Smrgprimitive restart generate an OpenGL error. Some of the rendering is 2247ec681f3Smrgthen incorrect. 2257ec681f3Smrg 2267ec681f3Smrgenergy-01 2277ec681f3Smrg~~~~~~~~~ 2287ec681f3Smrg 2297ec681f3SmrgThis test creates a 3D luminance texture of size 1K x 1K x 1K. If the 2307ec681f3SmrgOpenGL driver/device doesn't support a texture of this size the 2317ec681f3SmrgglTexImage3D() call will fail with GL_INVALID_VALUE or GL_OUT_OF_MEMORY 2327ec681f3Smrgand all that's rendered is plain white polygons. Ideally, the test would 2337ec681f3Smrguse a proxy texture to determine the max 3D texture size. But it does 2347ec681f3Smrgnot do that. 2357ec681f3Smrg 2367ec681f3Smrgmaya-04 2377ec681f3Smrg~~~~~~~ 2387ec681f3Smrg 2397ec681f3SmrgThis test generates many GL_INVALID_OPERATION errors in its calls to 2407ec681f3SmrgglUniform(). Causes include: 2417ec681f3Smrg 2427ec681f3Smrg- Trying to set float uniforms with glUniformi() 2437ec681f3Smrg- Trying to set float uniforms with glUniform3f() 2447ec681f3Smrg- Trying to set matrix uniforms with glUniform() instead of 2457ec681f3Smrg glUniformMatrix(). 2467ec681f3Smrg 2477ec681f3SmrgApparently, the indexes returned by glGetUniformLocation() were 2487ec681f3Smrghard-coded into the application trace when it was created. Since 2497ec681f3Smrgdifferent implementations of glGetUniformLocation() may return different 2507ec681f3Smrgvalues for any given uniform name, subsequent calls to glUniform() will 2517ec681f3Smrgbe invalid since they refer to the wrong uniform variables. This causes 2527ec681f3Smrgmany OpenGL errors and leads to incorrect rendering. 2537ec681f3Smrg 2547ec681f3Smrgmedical-01 2557ec681f3Smrg~~~~~~~~~~ 2567ec681f3Smrg 2577ec681f3SmrgThis test uses a single GLSL fragment shader which contains a GLSL 1.20 2587ec681f3Smrgarray initializer statement, but it neglects to specify ``#version 120`` 2597ec681f3Smrgat the top of the shader code. So, the shader does not compile and all 2607ec681f3Smrgthat's rendered is plain white polygons. 2617ec681f3Smrg 2627ec681f3SmrgAlso, the test tries to create a very large 3D texture that may exceed 2637ec681f3Smrgthe device driver's limit. When this happens, the glTexImage3D call 2647ec681f3Smrgfails and all that's rendered is a white box. 2657ec681f3Smrg 2667ec681f3Smrgshowcase-01 2677ec681f3Smrg~~~~~~~~~~~ 2687ec681f3Smrg 2697ec681f3SmrgThis is actually a DX11 test based on Autodesk's Showcase product. As 2707ec681f3Smrgsuch, it won't run with Mesa. 271