blob: cef584fd87fce1f1c04f8834184638bb80c5cbef [file] [log] [blame]
Brian Paulc60eb632011-10-20 15:13:17 -06001<HTML>
2
3<TITLE>Viewperf Issues</TITLE>
4
5<link rel="stylesheet" type="text/css" href="mesa.css"></head>
6
7<BODY>
8
9<h1>Viewperf Issues</h1>
10
11<p>
12This page lists known issues with
13<a href="http://www.spec.org/gwpg/gpc.static/vp11info.html" target="_main">SPEC Viewperf 11</a>
14when running on Mesa-based drivers.
15</p>
16
17<p>
18The Viewperf data sets are basically GL API traces that are recorded from
19CAD applications, then replayed in the Viewperf framework.
20</p>
21
22<p>
23The primary problem with these traces is they blindly use features and
24OpenGL extensions that were supported by the OpenGL driver when the trace
25was recorded,
26but there's no checks to see if those features are supported by the driver
27when playing back the traces with Viewperf.
28</p>
29
30<p>
31These issues have been reported to the SPEC organization in the hope that
32they'll be fixed in the future.
33</p>
34
35
36
37<h2>Catia-03 tests 3, 4, 8</h2>
38
39<p>
40These tests use features of the
41<a href="http://www.opengl.org/registry/specs/NV/fragment_program2.txt"
42target="_main">
43GL_NV_fragment_program2</a> and
44<a href="http://www.opengl.org/registry/specs/NV/vertex_program3.txt"
45target="_main">
46GL_NV_vertex_program3</a> extensions without checking if the driver supports
47them.
48</p>
49<p>
50When Mesa tries to compile the vertex/fragment programs it generates errors
51(which Viewperf ignores).
52Subsequent drawing calls become no-ops and the rendering is incorrect.
53</p>
54
55
56
57<h2>sw-02 tests 1, 2, 4</h2>
58
59<p>
60These tests depend on the
61<a href="http://www.opengl.org/registry/specs/NV/primitive_restart.txt"
62target="_main">GL_NV_primitive_restart</a> extension.
63</p>
64
65<p>
66If the Mesa driver doesn't support this extension the rendering will
67be incorrect and the test will fail.
68</p>
69
70
71<h2>Lightwave-01 test 3</h2>
72
73<p>
74This test uses a number of mipmapped textures, but the textures are
75incomplete because the last/smallest mipmap level (1 x 1 pixel) is
76never specified.
77</p>
78
79<p>
80A trace captured with
81<a href="https://github.com/apitrace/apitrace" target="_main">API trace</a>
82shows this sequences of calls like this:
83
84<pre>
852504 glBindTexture(target = GL_TEXTURE_2D, texture = 55)
862505 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))
872506 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))
882507 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))
89[...]
902512 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))
912513 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))
922514 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_MIN_FILTER, param = GL_LINEAR_MIPMAP_LINEAR)
932515 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_WRAP_S, param = GL_REPEAT)
942516 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_WRAP_T, param = GL_REPEAT)
952517 glTexParameteri(target = GL_TEXTURE_2D, pname = GL_TEXTURE_MAG_FILTER, param = GL_NEAREST)
96</pre>
97
98<p>
99Note that one would expect call 2514 to be glTexImage(level=9, width=1,
100height=1) but it's not there.
101</p>
102
103<p>
104The minification filter is GL_LINEAR_MIPMAP_LINEAR and the texture's
105GL_TEXTURE_MAX_LEVEL is 1000 (the default) so a full mipmap is expected.
106</p>
107
108<p>
109Later, these incomplete textures are bound before drawing calls.
110According to the GL specification, if a fragment program or fragment shader
111is being used, the sampler should return (0,0,0,1) ("black") when sampling
112from an incomplete texture.
113This is what Mesa does and the resulting rendering is darker than it should
114be.
115</p>
116
117<p>
118It appears that NVIDIA's driver (and possibly AMD's driver) detects this case
119and returns (1,1,1,1) (white) which causes the rendering to appear brighter
120and match the reference image (however, AMD's rendering is <em>much</em>
121brighter than NVIDIA's).
122</p>
123
124<p>
125If the fallback texture created in _mesa_get_fallback_texture() is
126initialized to be full white instead of full black the rendering appears
127correct.
128However, we have no plans to implement this work-around in Mesa.
129
130</p>
131
132
133</BODY>
134</HTML>