Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-14 Thread Brian Paul

On 07/11/2014 04:30 PM, Matthew McClure wrote:

Okay fixed. If approved, I am new to the project and do not have commit access 
so I will need help checking this in.

Thanks,
Matthew


LGTM.  I'll put my R-b on it and push it soon.

-Brian


___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-11 Thread Matthew McClure
Okay fixed. If approved, I am new to the project and do not have commit access 
so I will need help checking this in.

Thanks,
Matthew

--- Begin Updated Patch ---

With this patch, we add a test that will stress the bound
resource limits as determined by the GL API getInteger
values. The bound resources are populated with floats given
a table of primes. Each contribution is multiplied into the
final expression, and uniquely represents the successful
reference of the resource's memory.

Reviewed-by: needed
---
 tests/all.py  |1 +
 tests/spec/gl-3.0/CMakeLists.gl.txt   |1 +
 tests/spec/gl-3.0/bound-resource-limits.c | 1336 +
 3 files changed, 1338 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/gl-3.0/bound-resource-limits.c

diff --git a/tests/all.py b/tests/all.py
index f792a84..403f040 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -885,6 +885,7 @@ gl30['attribs'] = concurrent_test('attribs GL3')
 add_concurrent_test(gl30, 'bindfragdata-invalid-parameters')
 add_concurrent_test(gl30, 'bindfragdata-link-error')
 add_concurrent_test(gl30, 'bindfragdata-nonexistent-variable')
+gl30['bound-resource-limits'] = concurrent_test('gl-3.0-bound-resource-limits')
 add_concurrent_test(gl30, 'clearbuffer-depth')
 add_concurrent_test(gl30, 'clearbuffer-depth-stencil')
 add_plain_test(gl30, 'clearbuffer-display-lists')
diff --git a/tests/spec/gl-3.0/CMakeLists.gl.txt 
b/tests/spec/gl-3.0/CMakeLists.gl.txt
index 29c59ee..a802da3 100644
--- a/tests/spec/gl-3.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-3.0/CMakeLists.gl.txt
@@ -9,6 +9,7 @@ link_libraries (
${OPENGL_glu_LIBRARY}
 )
 
+piglit_add_executable (gl-3.0-bound-resource-limits bound-resource-limits.c)
 piglit_add_executable (gl-3.0-minmax minmax.c)
 piglit_add_executable (gl-3.0-render-integer render-integer.c)
 piglit_add_executable (gl-3.0-required-sized-texture-formats 
required-sized-texture-formats.c)
diff --git a/tests/spec/gl-3.0/bound-resource-limits.c 
b/tests/spec/gl-3.0/bound-resource-limits.c
new file mode 100644
index 000..851c361
--- /dev/null
+++ b/tests/spec/gl-3.0/bound-resource-limits.c
@@ -0,0 +1,1336 @@
+/*
+ * Copyright 2014 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Test resource limits given the maximum supported by the implementation.
+ *
+ * Each component of the fragment output is derived using the following
+ * expression (indexed at the scalar level):
+ *
+ *   result[i] = texture[i] * texture[i] * ... * attrib[i + l * numOutputs]
+ *
+ * Depending on the limits for vertex/fragment image units, the texture
+ * contribution will vary. See the generation of g_expected at the end of
+ * piglit_init.
+ *
+ * Since the scalar inputs are primes, multiplication will yield a unique
+ * result. Results can be diagnosed by evaluating for their missing factor(s).
+ *
+ * Matthew McClure
+ * 7 July 2014
+ */
+
+#include piglit-util-gl-common.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+config.supports_gl_compat_version = 30;
+config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+
+/*
+ * Definitions for the runtime behavior.
+ */
+#define GLSL_VERSION#version 130
+#define BUFFER_WIDTH32
+#define BUFFER_HEIGHT   32
+#define MAX_SHADER_LINE_CHARS   256
+#define MAX_SHADER_TEXT_CHARS   16*1024
+#define MAX_COMPONENTS  4
+#define MAX_EXPRESSION_OUTPUTS  1
+#define MAX_EXPRESSION_ARGUMENTS2
+#define MAX_EXPRESSION_TEMPS1
+#define TEMP_TEXT_SIZE  (MAX_EXPRESSION_OUTPUTS +  \
+ MAX_EXPRESSION_ARGUMENTS +  \
+ MAX_EXPRESSION_ARGUMENTS)
+
+#define NUM_PRIMES  512
+#define NUM_VERTICES

Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-09 Thread Matthew McClure
I reproduced Brian's issue with the NVIDIA drivers. Below is a list of the 
configurations I ran:

GeForce GTX 650
* Ubuntu NVIDIA 304.88 - Allocation of Variable[GL_MAX_VARYING_FLOATS] 
succeeded, VBO usage succeeds.
* Ubuntu NVIDIA 331.89 - Allocation of Variable[GL_MAX_VARYING_FLOATS] fails 
with the following message:
   
 0(2) : error C5041: cannot locate suitable resource to bind variable 
Variable. Possibly large array.

GeForce GT 740M
* Windows 8.1 NVIDIA 332.88 - Allocation of Variable[GL_MAX_VARYING_FLOATS] 
succeeded, VBO usage fails.

Due to the issues above, I clamped the return value of GL_MAX_VARYING_FLOATS to 
32 and only used immediate mode rendering with one attribute. A developer can 
disable varying floats clamping by specifying the command line argument 
-dontClampMaxVaryings. A developer can also re-enable different draw paths 
using command line arguments -drawArraysVBO or -drawElementsVBO.

Below is an updated patch to address the issues, as they are not a blocking 
issue for the test to be useful.

Thanks,
Matthew

--- Begin Updated Patch ---

With this patch, we add a test that will stress the bound resource limits
as determined by the GL API getInteger values. The bound resources are
populated with floats given a table of primes. Each contribution is
multiplied into the final expression, and uniquely represents the successful
reference of the resource's memory.
---
 tests/all.py  |1 +
 tests/spec/gl-3.0/CMakeLists.gl.txt   |1 +
 tests/spec/gl-3.0/bound-resource-limits.c | 1320 +
 3 files changed, 1322 insertions(+)
 create mode 100644 tests/spec/gl-3.0/bound-resource-limits.c

diff --git a/tests/all.py b/tests/all.py
index 7ce90d8..27d620e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -927,6 +927,7 @@ gl30['attribs'] = concurrent_test('attribs GL3')
 add_concurrent_test(gl30, 'bindfragdata-invalid-parameters')
 add_concurrent_test(gl30, 'bindfragdata-link-error')
 add_concurrent_test(gl30, 'bindfragdata-nonexistent-variable')
+gl30['bound-resource-limits'] = concurrent_test('gl-3.0-bound-resource-limits')
 add_concurrent_test(gl30, 'clearbuffer-depth')
 add_concurrent_test(gl30, 'clearbuffer-depth-stencil')
 add_plain_test(gl30, 'clearbuffer-display-lists')
diff --git a/tests/spec/gl-3.0/CMakeLists.gl.txt 
b/tests/spec/gl-3.0/CMakeLists.gl.txt
index 29c59ee..a802da3 100644
--- a/tests/spec/gl-3.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-3.0/CMakeLists.gl.txt
@@ -9,6 +9,7 @@ link_libraries (
${OPENGL_glu_LIBRARY}
 )
 
+piglit_add_executable (gl-3.0-bound-resource-limits bound-resource-limits.c)
 piglit_add_executable (gl-3.0-minmax minmax.c)
 piglit_add_executable (gl-3.0-render-integer render-integer.c)
 piglit_add_executable (gl-3.0-required-sized-texture-formats 
required-sized-texture-formats.c)
diff --git a/tests/spec/gl-3.0/bound-resource-limits.c 
b/tests/spec/gl-3.0/bound-resource-limits.c
new file mode 100644
index 000..e963465
--- /dev/null
+++ b/tests/spec/gl-3.0/bound-resource-limits.c
@@ -0,0 +1,1320 @@
+/*
+ * Copyright 2014 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Test resource limits given the maximum supported by the implementation.
+ *
+ * Each component of the fragment output is derived using the following
+ * expression (indexed at the scalar level):
+ *
+ *   result[i] = texture[i] * texture[i] * ... * attrib[i + l * numOutputs]
+ *
+ * Depending on the limits for vertex/fragment image units, the texture
+ * contribution will vary. See the generation of g_expected at the end of
+ * piglit_init.
+ *
+ * Since the scalar inputs are primes, multiplication will yield a unique
+ * result. Results can be diagnosed by evaluating for their missing factor(s).
+ *
+ * Matthew McClure
+ * 7 July 2014
+ */
+
+#include piglit-util-gl-common.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+  

Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-09 Thread Brian Paul

On 07/09/2014 03:10 PM, Matthew McClure wrote:

I reproduced Brian's issue with the NVIDIA drivers. Below is a list of the 
configurations I ran:

GeForce GTX 650
* Ubuntu NVIDIA 304.88 - Allocation of Variable[GL_MAX_VARYING_FLOATS] 
succeeded, VBO usage succeeds.
* Ubuntu NVIDIA 331.89 - Allocation of Variable[GL_MAX_VARYING_FLOATS] fails 
with the following message:

  0(2) : error C5041: cannot locate suitable resource to bind variable 
Variable. Possibly large array.

GeForce GT 740M
* Windows 8.1 NVIDIA 332.88 - Allocation of Variable[GL_MAX_VARYING_FLOATS] 
succeeded, VBO usage fails.

Due to the issues above, I clamped the return value of GL_MAX_VARYING_FLOATS to 32 and only used immediate 
mode rendering with one attribute. A developer can disable varying floats clamping by specifying the command 
line argument -dontClampMaxVaryings. A developer can also re-enable different draw paths using 
command line arguments -drawArraysVBO or -drawElementsVBO.

Below is an updated patch to address the issues, as they are not a blocking 
issue for the test to be useful.



OK, the test passes now with my nvidia driver, softpipe, llvmpipe and svga.

A couple more comments on the code.

1. Some of the static, initialized arrays could be const-qualified.  Not 
a big deal though.


2. The standard indentation practice is to use 8-space tabs.

-Brian

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-08 Thread Brian Paul

On 07/07/2014 07:51 AM, Matthew McClure wrote:

With this patch, we add a test that will stress the bound resource limits
as determined by the GL API getInteger values. The bound resources are
populated with floats given a table of primes. Each contribution is
multiplied into the final expression, and uniquely represents the successful
reference of the resource's memory.
---
  tests/all.py  |1 +
  tests/spec/gl-3.0/CMakeLists.gl.txt   |1 +
  tests/spec/gl-3.0/bound-resource-limits.c | 1136 +
  3 files changed, 1138 insertions(+)
  create mode 100644 tests/spec/gl-3.0/bound-resource-limits.c

diff --git a/tests/all.py b/tests/all.py
index 7ce90d8..27d620e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -927,6 +927,7 @@ gl30['attribs'] = concurrent_test('attribs GL3')
  add_concurrent_test(gl30, 'bindfragdata-invalid-parameters')
  add_concurrent_test(gl30, 'bindfragdata-link-error')
  add_concurrent_test(gl30, 'bindfragdata-nonexistent-variable')
+gl30['bound-resource-limits'] = concurrent_test('gl-3.0-bound-resource-limits')
  add_concurrent_test(gl30, 'clearbuffer-depth')
  add_concurrent_test(gl30, 'clearbuffer-depth-stencil')
  add_plain_test(gl30, 'clearbuffer-display-lists')
diff --git a/tests/spec/gl-3.0/CMakeLists.gl.txt 
b/tests/spec/gl-3.0/CMakeLists.gl.txt
index 29c59ee..a802da3 100644
--- a/tests/spec/gl-3.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-3.0/CMakeLists.gl.txt
@@ -9,6 +9,7 @@ link_libraries (
${OPENGL_glu_LIBRARY}
  )

+piglit_add_executable (gl-3.0-bound-resource-limits bound-resource-limits.c)
  piglit_add_executable (gl-3.0-minmax minmax.c)
  piglit_add_executable (gl-3.0-render-integer render-integer.c)
  piglit_add_executable (gl-3.0-required-sized-texture-formats 
required-sized-texture-formats.c)
diff --git a/tests/spec/gl-3.0/bound-resource-limits.c 
b/tests/spec/gl-3.0/bound-resource-limits.c
new file mode 100644
index 000..b89a9f6
--- /dev/null
+++ b/tests/spec/gl-3.0/bound-resource-limits.c
@@ -0,0 +1,1136 @@
+/*
+ * Copyright 2014 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Test resource limits given the maximum supported by the implementation.
+ *
+ * Each component of the fragment output is derived using the following
+ * expression (indexed at the scalar level):
+ *
+ *   result[i] = texture[i] * texture[i] * ... * attrib[i + l * numOutputs]
+ *
+ * Depending on the limits for vertex/fragment image units, the texture
+ * contribution will vary. See the generation of g_expected at the end of
+ * piglit_init.
+ *
+ * Since the scalar inputs are primes, multiplication will yield a unique
+ * result. Results can be diagnosed by evaluating for their missing factor(s).
+ *
+ * Matthew McClure
+ * 7 July 2014
+ */
+
+#include piglit-util-gl-common.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+  config.supports_gl_compat_version = 30;
+  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+
+/*
+ * Definitions for the runtime behavior.
+ */
+#define GLSL_VERSION  #version 130
+#define BUFFER_WIDTH  32
+#define BUFFER_HEIGHT 32
+#define MAX_SHADER_LINE_CHARS 256
+#define MAX_SHADER_TEXT_CHARS 16*1024
+#define MAX_COMPONENTS4
+#define MAX_EXPRESSION_OUTPUTS1
+#define MAX_EXPRESSION_ARGUMENTS  2
+#define MAX_EXPRESSION_TEMPS  1
+#define TEMP_TEXT_SIZE(MAX_EXPRESSION_OUTPUTS +  \
+   MAX_EXPRESSION_ARGUMENTS +  \
+   MAX_EXPRESSION_ARGUMENTS)
+
+#define NUM_PRIMES512
+#define NUM_VERTICES  3
+#define DRAW_ARRAYS   0
+#define DRAW_ELEMENTS 1
+#define DRAW_IMMEDIATE0
+
+#define DEBUG_INPUT   0
+#define DEBUG_READBACK0
+#define DEBUG_SHADERS 0

Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-08 Thread Brian Paul

On 07/08/2014 11:01 AM, Matthew McClure wrote:

I ran this on Ubuntu 12.04.3 with:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 650/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 304.116
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler
OpenGL extensions:

.../Devel/fdo.piglit$ bin/gl-3.0-bound-resource-limits -auto
GL_MAX_VARYING_FLOATS: 124
GL_MAX_VERTEX_ATTRIBS: 16
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: 160
GL_AUX_BUFFERS: 4
GL_MAX_DRAW_BUFFERS: 8
GL_MAX_COLOR_ATTACHMENTS: 8
g_expected[0]=(23921766400.00, 86156951552.00, 480410238976.00, 
1425854431232.00)
g_expected[1]=(6227219709952.00, 11347125338112.00, 
27230952488960.00, 41933363740672.00)
g_expected[2]=(81694296113152.00, 171963293106176.00, 
241784881938432.00, 428522141122560.00)
g_expected[3]=(623247401943040.00, 751236219404288.00, 
1125101110034432.00, 1856184336252928.00)
g_expected[4]=(2735942485934080.00, 3101938392498176.00, 
4440612589797376.00, 5674358320136192.00)
g_expected[5]=(6377906712346624.00, 8903007106236416.00, 
11072865923235840.00, 14685310302552064.00)
g_expected[6]=(20124361323184128.00, 23577553683873792.00, 
26507988395098112.00, 31646100720975872.00)
g_expected[7]=(178482200576.00, 207579496448.00, 313797935104.00, 
351675613184.00)
PIGLIT: {result: pass }

Below are my replies:


+static char *
+get_packed_decl(PackedDesc *desc,
+char *str,
+unsigned strSize,
+char *tmpStr,
+unsigned tmpStrSize)


Here and elsewhere, can you const-qualify any pointer args to help
understand which are inputs vs. outputs?



Sounds good. I'll make the changes.


+setup_vertex_element_buffers()


I think MSVC warns on () so we use (void) usually.


Thanks, I'll go ahead and add that.


The code generally looks good, but is a bit dense.  It would take me a
while to understand the intricacies.

In any case, when I tested it with my nvidia driver I got a failure:

$ bin/gl-3.0-bound-resource-limits -auto
GL_MAX_VARYING_FLOATS: 124
GL_MAX_VERTEX_ATTRIBS: 16
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: 192
GL_AUX_BUFFERS: 4
GL_MAX_DRAW_BUFFERS: 8
GL_MAX_COLOR_ATTACHMENTS: 8
Failed to link: Fragment info
-
0(8) : warning C7533: global variable gl_FragData is deprecated after
version 120
0(2) : error C5041: cannot locate suitable resource to bind variable
Variable. Possibly large array.

PIGLIT: {result: fail }


What was your NVIDIA driver version?


325.15

-Brian

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-08 Thread Matthew McClure
Update to reflect feedback from Brian Paul. The update includes documentation 
for each function and removal of the flat qualifier, since this version of 
the test is using GLSL 1.30.

Verified on:

Ubuntu 12.04.3
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 650/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 304.116
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler

Thanks,
Matthew

--- Begin Updated Patch ---

With this patch, we add a test that will stress the bound resource limits
as determined by the GL API getInteger values. The bound resources are
populated with floats given a table of primes. Each contribution is
multiplied into the final expression, and uniquely represents the successful
reference of the resource's memory.
---
 tests/all.py  |1 +
 tests/spec/gl-3.0/CMakeLists.gl.txt   |1 +
 tests/spec/gl-3.0/bound-resource-limits.c | 1262 +
 3 files changed, 1264 insertions(+)
 create mode 100644 tests/spec/gl-3.0/bound-resource-limits.c

diff --git a/tests/all.py b/tests/all.py
index 7ce90d8..27d620e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -927,6 +927,7 @@ gl30['attribs'] = concurrent_test('attribs GL3')
 add_concurrent_test(gl30, 'bindfragdata-invalid-parameters')
 add_concurrent_test(gl30, 'bindfragdata-link-error')
 add_concurrent_test(gl30, 'bindfragdata-nonexistent-variable')
+gl30['bound-resource-limits'] = concurrent_test('gl-3.0-bound-resource-limits')
 add_concurrent_test(gl30, 'clearbuffer-depth')
 add_concurrent_test(gl30, 'clearbuffer-depth-stencil')
 add_plain_test(gl30, 'clearbuffer-display-lists')
diff --git a/tests/spec/gl-3.0/CMakeLists.gl.txt 
b/tests/spec/gl-3.0/CMakeLists.gl.txt
index 29c59ee..a802da3 100644
--- a/tests/spec/gl-3.0/CMakeLists.gl.txt
+++ b/tests/spec/gl-3.0/CMakeLists.gl.txt
@@ -9,6 +9,7 @@ link_libraries (
${OPENGL_glu_LIBRARY}
 )
 
+piglit_add_executable (gl-3.0-bound-resource-limits bound-resource-limits.c)
 piglit_add_executable (gl-3.0-minmax minmax.c)
 piglit_add_executable (gl-3.0-render-integer render-integer.c)
 piglit_add_executable (gl-3.0-required-sized-texture-formats 
required-sized-texture-formats.c)
diff --git a/tests/spec/gl-3.0/bound-resource-limits.c 
b/tests/spec/gl-3.0/bound-resource-limits.c
new file mode 100644
index 000..94cfe30
--- /dev/null
+++ b/tests/spec/gl-3.0/bound-resource-limits.c
@@ -0,0 +1,1262 @@
+/*
+ * Copyright 2014 VMware, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the Software),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * Test resource limits given the maximum supported by the implementation.
+ *
+ * Each component of the fragment output is derived using the following
+ * expression (indexed at the scalar level):
+ *
+ *   result[i] = texture[i] * texture[i] * ... * attrib[i + l * numOutputs]
+ *
+ * Depending on the limits for vertex/fragment image units, the texture
+ * contribution will vary. See the generation of g_expected at the end of
+ * piglit_init.
+ *
+ * Since the scalar inputs are primes, multiplication will yield a unique
+ * result. Results can be diagnosed by evaluating for their missing factor(s).
+ *
+ * Matthew McClure
+ * 7 July 2014
+ */
+
+#include piglit-util-gl-common.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+  config.supports_gl_compat_version = 30;
+  config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+
+/*
+ * Definitions for the runtime behavior.
+ */
+#define GLSL_VERSION  #version 130
+#define BUFFER_WIDTH  32
+#define BUFFER_HEIGHT 32
+#define MAX_SHADER_LINE_CHARS 256
+#define MAX_SHADER_TEXT_CHARS 16*1024
+#define MAX_COMPONENTS4
+#define MAX_EXPRESSION_OUTPUTS1
+#define MAX_EXPRESSION_ARGUMENTS  2
+#define MAX_EXPRESSION_TEMPS  1
+#define TEMP_TEXT_SIZE(MAX_EXPRESSION_OUTPUTS +  \
+ 

Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-08 Thread Brian Paul

On 07/08/2014 04:49 PM, Matthew McClure wrote:

Update to reflect feedback from Brian Paul. The update includes documentation for each 
function and removal of the flat qualifier, since this version of the test is 
using GLSL 1.30.

Verified on:

Ubuntu 12.04.3
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 650/PCIe/SSE2
OpenGL version string: 4.2.0 NVIDIA 304.116
OpenGL shading language version string: 4.20 NVIDIA via Cg compiler



Still seeing a failure here w/ nvidia:

$ bin/gl-3.0-bound-resource-limits -auto
GL_MAX_VARYING_FLOATS: 124
GL_MAX_VERTEX_ATTRIBS: 16
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: 192
GL_AUX_BUFFERS: 4
GL_MAX_DRAW_BUFFERS: 8
GL_MAX_COLOR_ATTACHMENTS: 8
Failed to link: Fragment info
-
0(8) : warning C7533: global variable gl_FragData is deprecated after 
version 120
0(2) : error C5041: cannot locate suitable resource to bind variable 
Variable. Possibly large array.


PIGLIT: {result: fail }


-Brian

___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource limits

2014-07-08 Thread Matthew McClure
I will try to reproduce locally with a later build of their drivers. However, I 
believe this is NVIDIA's bug. If they report that they can support 124 varying 
floats (the Variable array), they should not have this issue. The 304.116 
drivers did not show this issue on a GeForce GTX 650.

Would it be possible to set the DEBUG_SHADERS define to 1, just to make sure 
the shader is sane? I forced several combinations of varying values and image 
units, post glGetInteger and the shaders constructed fine.

Matthew

- Original Message -
From: Brian Paul bri...@vmware.com
To: Matthew McClure mcclu...@vmware.com, piglit@lists.freedesktop.org
Sent: Tuesday, July 8, 2014 4:09:18 PM
Subject: Re: [Piglit] [PATCH] gl-3.0: add a test to stress the bound resource 
limits

On 07/08/2014 04:49 PM, Matthew McClure wrote:
 Update to reflect feedback from Brian Paul. The update includes documentation 
 for each function and removal of the flat qualifier, since this version of 
 the test is using GLSL 1.30.

 Verified on:

 Ubuntu 12.04.3
 OpenGL vendor string: NVIDIA Corporation
 OpenGL renderer string: GeForce GTX 650/PCIe/SSE2
 OpenGL version string: 4.2.0 NVIDIA 304.116
 OpenGL shading language version string: 4.20 NVIDIA via Cg compiler


Still seeing a failure here w/ nvidia:

$ bin/gl-3.0-bound-resource-limits -auto
GL_MAX_VARYING_FLOATS: 124
GL_MAX_VERTEX_ATTRIBS: 16
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_TEXTURE_IMAGE_UNITS: 32
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: 192
GL_AUX_BUFFERS: 4
GL_MAX_DRAW_BUFFERS: 8
GL_MAX_COLOR_ATTACHMENTS: 8
Failed to link: Fragment info
-
0(8) : warning C7533: global variable gl_FragData is deprecated after 
version 120
0(2) : error C5041: cannot locate suitable resource to bind variable 
Variable. Possibly large array.

PIGLIT: {result: fail }


-Brian
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit