[Piglit] [PATCH 08/21] arb_internalformat_query2: max dimensions related checks

2016-01-22 Thread Alejandro Piñeiro
Add a check for the following pnames (a subtest for each one)

* MAX_WIDTH. From spec:
   "The maximum supported width for the resource is returned in
. For resources with only one-dimension, this one
dimension is considered the width. If the resource is unsupported,
zero is returned."

It is only tested that returns zero if not supported. It makes
sense to include it on this test because it is related to the
other max dimension pnames.

* MAX_HEIGHT. From spec:
   "The maximum supported height for the resource is returned in
. For resources with two or more dimensions, the second
dimension is considered the height. If the resource does not have
at least two dimensions, or if the resource is unsupported, zero
is returned."

  So in addition to the usual zero-test if not supported, it is tested
  that if the target has less that two dimensions, it returns zero
  too, even if supported.

* MAX_DEPTH: From spec:
   "The maximum supported depth for the resource is returned in
. For resources with three or more dimensions, the third
dimension is considered the depth. If the resource does not have
at least three dimensions, or if the resource is unsupported, zero
is returned.

  So in addition to the usual zero-test if not supported, it is tested
  that if the target has less that three dimensions, it returns zero
  too, even if supported.

* MAX_LAYERS: From spec:
   "The maximum supported number of layers for the resource is
returned in . For 1D array targets, the value returned is
the same as the MAX_HEIGHT. For 2D and cube array targets, the
value returned is the same as the MAX_DEPTH. If the resource does
not support layers, or if the resource is unsupported, zero is
returned."

  In addition to the usual zero-test if not supported, it is tested
  that the value returned is the same that the one returned by
  MAX_HEIGHT or MAX_DEPTH for the array texture targets.

Tested on NVIDIA GeForce GTX 950 - NVIDIA 352.55: passes.

Tested on 4.5.13399 on AMD Radeon (TM) R9 380 Series: the tests
doesn't pass for this ATI proprietary drivers for any of the
subtests. It returns a non-zero value for unsupported combinations.
---
 tests/all.py   |   1 +
 .../arb_internalformat_query2/CMakeLists.gl.txt|   2 +-
 .../arb_internalformat_query2/max-dimensions.c | 355 +
 3 files changed, 357 insertions(+), 1 deletion(-)
 create mode 100644 tests/spec/arb_internalformat_query2/max-dimensions.c

diff --git a/tests/all.py b/tests/all.py
index 61983f5..bf45192 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3642,6 +3642,7 @@ with profile.group_manager(
 g(['arb_internalformat_query2-internalformat-size-checks'], 'All 
INTERNALFORMAT__SIZE pname checks')
 g(['arb_internalformat_query2-internalformat-type-checks'], 'All 
INTERNALFORMAT__TYPE pname checks')
 g(['arb_internalformat_query2-image-format-compatibility-type'], 
'IMAGE_FORMAT_COMPATIBILITY_TYPE pname checks')
+g(['arb_internalformat_query2-max-dimensions'], 'Max dimensions related 
pname checks')
 
 with profile.group_manager(
 PiglitGLTest, grouptools.join('spec', 'arb_map_buffer_range')) as g:
diff --git a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt 
b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
index 93a84ad..73e14f6 100644
--- a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
+++ b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
@@ -14,5 +14,5 @@ piglit_add_executable 
(arb_internalformat_query2-samples-pnames samples-pnames.c
 piglit_add_executable (arb_internalformat_query2-internalformat-size-checks 
internalformat-size-checks.c common.c)
 piglit_add_executable (arb_internalformat_query2-internalformat-type-checks 
internalformat-type-checks.c common.c)
 piglit_add_executable 
(arb_internalformat_query2-image-format-compatibility-type 
image-format-compatibility-type.c common.c)
-
+piglit_add_executable (arb_internalformat_query2-max-dimensions 
max-dimensions.c common.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_internalformat_query2/max-dimensions.c 
b/tests/spec/arb_internalformat_query2/max-dimensions.c
new file mode 100644
index 000..6b4f012
--- /dev/null
+++ b/tests/spec/arb_internalformat_query2/max-dimensions.c
@@ -0,0 +1,355 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * 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 

[Piglit] [PATCH 08/21] arb_internalformat_query2: max dimensions related checks

2016-01-19 Thread Alejandro Piñeiro
Add a check for the following pnames (a subtest for each one)

* MAX_WIDTH. From spec:
   "The maximum supported width for the resource is returned in
. For resources with only one-dimension, this one
dimension is considered the width. If the resource is unsupported,
zero is returned."

It is only tested that returns zero if not supported. It makes
sense to include it on this test because it is related to the
other max dimension pnames.

* MAX_HEIGHT. From spec:
   "The maximum supported height for the resource is returned in
. For resources with two or more dimensions, the second
dimension is considered the height. If the resource does not have
at least two dimensions, or if the resource is unsupported, zero
is returned."

  So in addition to the usual zero-test if not supported, it is tested
  that if the target has less that two dimensions, it returns zero
  too, even if supported.

* MAX_DEPTH: From spec:
   "The maximum supported depth for the resource is returned in
. For resources with three or more dimensions, the third
dimension is considered the depth. If the resource does not have
at least three dimensions, or if the resource is unsupported, zero
is returned.

  So in addition to the usual zero-test if not supported, it is tested
  that if the target has less that three dimensions, it returns zero
  too, even if supported.

* MAX_LAYERS: From spec:
   "The maximum supported number of layers for the resource is
returned in . For 1D array targets, the value returned is
the same as the MAX_HEIGHT. For 2D and cube array targets, the
value returned is the same as the MAX_DEPTH. If the resource does
not support layers, or if the resource is unsupported, zero is
returned."

  In addition to the usual zero-test if not supported, it is tested
  that the value returned is the same that the one returned by
  MAX_HEIGHT or MAX_DEPTH for the array texture targets.

Tested on NVIDIA GeForce GTX 950 - NVIDIA 352.55: passes.

Tested on 4.5.13399 on AMD Radeon (TM) R9 380 Series: the tests
doesn't pass for this ATI proprietary drivers for any of the
subtests. It returns a non-zero value for unsupported combinations.
---
 tests/all.py   |   1 +
 .../arb_internalformat_query2/CMakeLists.gl.txt|   2 +-
 .../arb_internalformat_query2/max-dimensions.c | 350 +
 3 files changed, 352 insertions(+), 1 deletion(-)
 create mode 100644 tests/spec/arb_internalformat_query2/max-dimensions.c

diff --git a/tests/all.py b/tests/all.py
index 9ebdeb1..7bcc892 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -3625,6 +3625,7 @@ with profile.group_manager(
 g(['arb_internalformat_query2-internalformat-size-checks'], 'All 
INTERNALFORMAT__SIZE pname checks')
 g(['arb_internalformat_query2-internalformat-type-checks'], 'All 
INTERNALFORMAT__TYPE pname checks')
 g(['arb_internalformat_query2-image-format-compatibility-type'], 
'IMAGE_FORMAT_COMPATIBILITY_TYPE pname checks')
+g(['arb_internalformat_query2-max-dimensions'], 'Max dimensions related 
pname checks')
 
 with profile.group_manager(
 PiglitGLTest, grouptools.join('spec', 'arb_map_buffer_range')) as g:
diff --git a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt 
b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
index 93a84ad..73e14f6 100644
--- a/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
+++ b/tests/spec/arb_internalformat_query2/CMakeLists.gl.txt
@@ -14,5 +14,5 @@ piglit_add_executable 
(arb_internalformat_query2-samples-pnames samples-pnames.c
 piglit_add_executable (arb_internalformat_query2-internalformat-size-checks 
internalformat-size-checks.c common.c)
 piglit_add_executable (arb_internalformat_query2-internalformat-type-checks 
internalformat-type-checks.c common.c)
 piglit_add_executable 
(arb_internalformat_query2-image-format-compatibility-type 
image-format-compatibility-type.c common.c)
-
+piglit_add_executable (arb_internalformat_query2-max-dimensions 
max-dimensions.c common.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_internalformat_query2/max-dimensions.c 
b/tests/spec/arb_internalformat_query2/max-dimensions.c
new file mode 100644
index 000..08ce651
--- /dev/null
+++ b/tests/spec/arb_internalformat_query2/max-dimensions.c
@@ -0,0 +1,350 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * 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