On Mon, Feb 27, 2012 at 7:44 AM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com">brianp@vmware.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 02/23/2012 08:27 PM, Anuj Phogat wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Intel driver throws GL_OUT_OF_MEMORY and assertion failure / segmentation<br>
fault with large textures.<br>
<br>
Reproduces the errors reported in:<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=44970" target="_blank">https://bugs.freedesktop.org/<u></u>show_bug.cgi?id=44970</a><br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=46303" target="_blank">https://bugs.freedesktop.org/<u></u>show_bug.cgi?id=46303</a><br>
<br>
Signed-off-by: Anuj Phogat<<a href="mailto:anuj.phogat@gmail.com" target="_blank">anuj.phogat@gmail.com</a>><br>
---<br>
V3: Added the test using proxy textures, deleted redundant code,<br>
data array allocation based on size returned<br>
<br>
ToDo: getMaxTarget, getProxyTarget and isValidTexSize functions can be added<br>
as piglit utility functions in piglit-util-gl.c<br>
I will do it in a separate patch.<br>
<br>
tests/all.tests | 1 +<br>
tests/bugs/CMakeLists.gl.txt | 1 +<br>
tests/bugs/large-textures.c | 352 ++++++++++++++++++++++++++++++<u></u>++++++++++++<br>
3 files changed, 354 insertions(+), 0 deletions(-)<br>
create mode 100644 tests/bugs/large-textures.c<br>
</blockquote>
<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
diff --git a/tests/bugs/large-textures.c b/tests/bugs/large-textures.c<br>
new file mode 100644<br>
index 0000000..c43f51e<br>
--- /dev/null<br>
+++ b/tests/bugs/large-textures.c<br>
@@ -0,0 +1,352 @@<br>
</blockquote>
<br></div>
The test should be moved to test/texturing/. I think we agreed to move away from the tests/bugs/ directory.<br>
<br>
<br>
<br>
[...]<div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+void piglit_init(int argc, char **argv)<br>
+{<br>
+ GLuint tex;<br>
+ int i, j;<br>
+<br>
+ glMatrixMode(GL_PROJECTION);<br>
+ glPushMatrix();<br>
+ glLoadIdentity();<br>
+ glOrtho(0, piglit_width, 0, piglit_height, -1, 1);<br>
+ glMatrixMode(GL_MODELVIEW);<br>
+ glPushMatrix();<br>
+ glLoadIdentity();<br>
+ glClearColor(0.2, 0.2, 0.2, 1.0);<br>
+ glClear(GL_COLOR_BUFFER_BIT);<br>
+<br>
+ for ( i = 0; i< ARRAY_SIZE(target); i++) {<br>
+<br>
+ glGenTextures(1,&tex);<br>
+ glBindTexture(target[i], tex);<br>
+ glTexParameteri(target[i], GL_TEXTURE_MIN_FILTER, GL_NEAREST);<br>
+ glTexParameteri(target[i], GL_TEXTURE_MAG_FILTER, GL_NEAREST);<br>
+<br>
+ for (j = 0; j< ARRAY_SIZE(internalformat); j++) {<br>
+<br>
+ if (internalformat[j] == GL_RGBA16F ||<br>
+ internalformat[j] == GL_RGBA32F)<br>
+ piglit_require_extension("GL_<u></u>ARB_texture_float");<br>
</blockquote>
<br></div></div>
I think you should simply skip the float formats if GL_ARB_texture_float is not supported (don't exit with SKIP result).<br></blockquote><div>Yes. That's the right thing i should do.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I ran the test with NVIDIA's driver. Here's what it printed:<br>
<br>
GL_PROXY_TEXTURE_1D, Internal Format = GL_RGBA8, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_1D, Internal Format = GL_RGBA16, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_1D, Internal Format = GL_RGBA32F, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_2D, Internal Format = GL_RGBA8, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_2D, Internal Format = GL_RGBA16, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_2D, Internal Format = GL_RGBA32F, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_CUBE_MAP, Internal Format = GL_RGBA8, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_CUBE_MAP, Internal Format = GL_RGBA16, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_CUBE_MAP, Internal Format = GL_RGBA32F, Largest Texture Size = 16384<br>
GL_PROXY_TEXTURE_3D, Internal Format = GL_RGBA8, Largest Texture Size = 2048<br>
GL_PROXY_TEXTURE_3D, Internal Format = GL_RGBA16, Largest Texture Size = 2048<br>
GL_PROXY_TEXTURE_3D, Internal Format = GL_RGBA32F, Largest Texture Size = 2048<br>
<br>
GL_TEXTURE_1D, Internal Format = GL_RGBA8, Largest Texture Size = 16384<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
GL_TEXTURE_1D, Internal Format = GL_RGBA16, Largest Texture Size = 16384<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
GL_TEXTURE_1D, Internal Format = GL_RGBA32F, Largest Texture Size = 16384<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
GL_TEXTURE_2D, Internal Format = GL_RGBA8, Largest Texture Size = 16384<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
GL_TEXTURE_2D, Internal Format = GL_RGBA16, Largest Texture Size = 16384<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
GL_TEXTURE_2D, Internal Format = GL_RGBA32F, Largest Texture Size = 16384<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
Unexpected GL error: GL_INVALID_VALUE 0x501<br>
GL_TEXTURE_CUBE_MAP, Internal Format = GL_RGBA16, Largest Texture Size = 16384<br>
[I killed it here after 10+ minutes of runtime]<br>
<br>
I don't know what's causing the INVALID_VALUE error. </blockquote><div>GL_INVALID_VALUE error is thrown by the driver when we test with textures larger than maximum supported size. So, this is an expected error.</div>
<div>Another expected error is GL_OUT_OF_MEMORY when driver is unable to map a previously created large texture in glSubTexImage1D/2D/3D.</div><div>I will include both these errors as expected errors and put a comment about it.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The test runs _extremely_ slowly. It looks like the driver is allocating some really large image buffers so we're falling back to virtual memory. I don't know a way around this. On one hand, it's good to test this, but nobody wants to wait 10+ minutes for the outcome.</blockquote>
<div>The purpose of this test case is to make sure that driver doesn't segfault with large textures and throws relevant errors in case it is unable to allocate memory or map large textures. I am able to identify few issues in intel driver using this test case. If nVidia driver takes a long time to run the test, there's a possibility that they are not handling such cases properly. May be they should return GL_OUT_OF_MEMORY in that case.</div>
<div>or we can comment out GL_RGBA16 and GL_RGBA32F and put a comment informing users about the time test takes with those formats.</div></div><br>