Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Jose Fonseca

On 14/12/14 15:48, Emil Velikov wrote:

On 12/12/14 15:00, Jose Fonseca wrote:

On 23/11/14 15:09, Emil Velikov wrote:

On 23/11/14 09:38, Jose Fonseca wrote:

On 21/11/14 19:52, Emil Velikov wrote:

[snip]

--- /dev/null
+++ b/tests/util/piglit-framework-gl/piglit_wgl_framework.c

[snip]

+static void
+enter_event_loop(struct piglit_winsys_framework *winsys_fw)
+{
+
+/* FINISHME: Write event loop for Windows.
+ *
+ * Until we have proper Windows/WGL support, give the user enough
+ * time to view the window by sleeping.
+ */
+Sleep(8000);


Instead of Sleep for 8 secs, you could do

fprintf(stderr, Press any key when done.\n);
getchar().

It would be more practical, and self-documenting.


Makes sense. Unless there are other comments I'll amend before pushing.
The latter of which will happen after waffle 1.5.0 is rolled out.

Thanks
Emil



Emil,

Feel free to push this series.  Or let me know if you rather I do it.

I actually have a couple of follow-on patches to get this working with
Mingw better:

   
https://urldefense.proofpoint.com/v2/url?u=http-3A__cgit.freedesktop.org_-7Ejrfonseca_piglit_log_-3Fh-3Dwgl-2Dwaffled=AAIDaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=hlGMP0n52wcvFoFYI11nH3-NtL0Uk3qmcS61N4EhoEks=9J-DdsZQet3WgtN_0vzQm8mbICcb8wcnZRUSyTflXMUe=


Will push it out in a second. I wanted to have a few days between the
waffle 1.5.0 release and bumping the minimum requirement in piglit :)

I'm not too trilled with the Mingw fix - things should work like a charm
without it. What are the problems that you're facing without it ?


They are totally broken for me:

- pkg-config doesn't work for cross compiling: it will find the host's 
waffle, instead of the target's waffle (and refuse to build unless the 
host's waffle is not found or has an older version)


- I haven't tried to build with MinGW on Windows natively, but 
pkg-config doesn't exist on Windows AFAIK, so I doubt it works at all there


Besides that the patch also made things easier for those building this 
on Windows.


I splitted that patch into smaller changes, and provided better 
explanations.  I hope it makes more sense now.



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


[Piglit] [PATCH 3/4] cmake: Don't check WAFFLE_VERSION on Windows.

2014-12-15 Thread Jose Fonseca
From: José Fonseca jfons...@vmware.com

The version number must be manually on command line, hence this
version check is just an hindrance for Windows.
---
 CMakeLists.txt | 28 ++--
 README |  1 -
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7be1bc4..2da7aae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,21 +51,21 @@ if(PIGLIT_USE_WAFFLE)
it at http://www.waffle-gl.org.;
)
endif()
-   endif ()
 
-   # Check the installed waffle version.
-   #
-   # We cannot reliably check the version with pkg_check_modules(), but
-   # instead must check the version manually as below. The problem is that,
-   # if one passes a required version to pkg_check_modules(), CMake
-   # validates the required version at most once for the lifetime of the
-   # source tree.  If someone changes the required version by editing the
-   # CMakeLists, CMake fails to detect the new requirement.
-   set(WAFFLE_REQUIRED_VERSION 1.5.0)
-   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
-   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
-   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
-   endif()
+   # Check the installed waffle version.
+   #
+   # We cannot reliably check the version with 
pkg_check_modules(), but
+   # instead must check the version manually as below. The problem 
is that,
+   # if one passes a required version to pkg_check_modules(), CMake
+   # validates the required version at most once for the lifetime 
of the
+   # source tree.  If someone changes the required version by 
editing the
+   # CMakeLists, CMake fails to detect the new requirement.
+   set(WAFFLE_REQUIRED_VERSION 1.5.0)
+   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
+   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, 
but 
+   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
+   endif()
+   endif ()
 
add_definitions(-DPIGLIT_USE_WAFFLE)
add_definitions(-DWAFFLE_API_VERSION=0x0103)
diff --git a/README b/README
index b894db7..0bdf697 100644
--- a/README
+++ b/README
@@ -194,7 +194,6 @@ Configure
 Set these variables in the Advanced view.
 Note that the values provided are for reference purposed and may differ on 
your system.
   - PIGLIT_USE_WAFFLE, BOOL, TRUE
-  - WAFFLE_VERSION, STRING, 1.5.0
   - WAFFLE_INCLUDE_DIRS, PATH, ${waffle_root}\include\waffle
   - WAFFLE_LDFLAGS, FILEPATH, ${waffle_root}\lib\waffle-1.lib
   - GLEXT_INCLUDE_DIR, PATH, C:\Program Files\Microsoft Visual Studio 
12.0\VC\include\GL
-- 
2.1.0

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


[Piglit] [PATCH 4/4] cmake: Better .

2014-12-15 Thread Jose Fonseca
From: José Fonseca jfons...@vmware.com

- Use find_path/find_library so one can see the variables on cmake-gui

- Provide better error message.
---
 CMakeLists.txt | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2da7aae..6fb6c8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,17 @@ if(PIGLIT_USE_WAFFLE)
message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, 
but 
piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
endif()
+   else ()
+   find_path(WAFFLE_INCLUDE_DIRS waffle.h)
+   find_library(WAFFLE_LDFLAGS waffle-1)
+   if(WAFFLE_INCLUDE_DIRS AND WAFFLE_LDFLAGS)
+   set(WAFFLE_FOUND TRUE)
+   else()
+   message(FATAL_ERROR Failed to find Waffle. Get and 
build Waffle from 
+   http://www.waffle-gl.org and set 
WAFFLE_INCLUDE_DIRS and 
+   WAFFLE_LDFLAGS variables accordingly.
+   )
+   endif()
endif ()
 
add_definitions(-DPIGLIT_USE_WAFFLE)
-- 
2.1.0

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


[Piglit] [PATCH 1/4] framework: Use WGL by default on Windows.

2014-12-15 Thread Jose Fonseca
From: José Fonseca jfons...@vmware.com

Like done with GLX on Linux.
---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 75fbacf..5d0f569 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -60,8 +60,10 @@ piglit_wfl_framework_choose_platform(const struct 
piglit_gl_test_config *test_co
return WAFFLE_PLATFORM_X11_EGL;
}
 #endif
-#ifdef PIGLIT_HAS_GLX
+#if defined(PIGLIT_HAS_GLX)
return WAFFLE_PLATFORM_GLX;
+#elif defined(PIGLIT_HAS_WGL)
+   return WAFFLE_PLATFORM_WGL;
 #else
fprintf(stderr, environment var PIGLIT_PLATFORM must be set 
when piglit is built without GLX support\n);
-- 
2.1.0

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


[Piglit] [PATCH 2/4] cmake: Don't rely on pkg-config for all Windows builds.

2014-12-15 Thread Jose Fonseca
From: José Fonseca jfons...@vmware.com

Instead of just MSVC builds.

Because pkg-config is not commonly available when compiling natively on
Windows, and gives the wrong results (the host package instead of target
package) when cross-compiling to Windows.
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ba6df8..7be1bc4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,7 +42,7 @@ else()
 endif()
 
 if(PIGLIT_USE_WAFFLE)
-   if (NOT MSVC)
+   if (NOT WIN32)
pkg_check_modules(WAFFLE REQUIRED waffle-1)
 
if(NOT WAFFLE_FOUND)
-- 
2.1.0

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


Re: [Piglit] [PATCH 4/4] cmake: Better .

2014-12-15 Thread Jose Fonseca

Oops. Forgot some words on the subject.  It should have been:

  cmake: Improve experience detecting waffle on Windows

Jose

On 15/12/14 12:19, Jose Fonseca wrote:

From: José Fonseca jfons...@vmware.com

- Use find_path/find_library so one can see the variables on cmake-gui

- Provide better error message.
---
  CMakeLists.txt | 11 +++
  1 file changed, 11 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2da7aae..6fb6c8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,6 +65,17 @@ if(PIGLIT_USE_WAFFLE)
message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 

piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
endif()
+   else ()
+   find_path(WAFFLE_INCLUDE_DIRS waffle.h)
+   find_library(WAFFLE_LDFLAGS waffle-1)
+   if(WAFFLE_INCLUDE_DIRS AND WAFFLE_LDFLAGS)
+   set(WAFFLE_FOUND TRUE)
+   else()
+   message(FATAL_ERROR Failed to find Waffle. Get and build 
Waffle from 
+   http://www.waffle-gl.org and set 
WAFFLE_INCLUDE_DIRS and 
+   WAFFLE_LDFLAGS variables accordingly.
+   )
+   endif()
endif ()

add_definitions(-DPIGLIT_USE_WAFFLE)



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


Re: [Piglit] [PATCH 1/4] framework: Use WGL by default on Windows.

2014-12-15 Thread Brian Paul

On 12/15/2014 05:19 AM, Jose Fonseca wrote:

From: José Fonseca jfons...@vmware.com

Like done with GLX on Linux.
---
  tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 75fbacf..5d0f569 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -60,8 +60,10 @@ piglit_wfl_framework_choose_platform(const struct 
piglit_gl_test_config *test_co
return WAFFLE_PLATFORM_X11_EGL;
}
  #endif
-#ifdef PIGLIT_HAS_GLX
+#if defined(PIGLIT_HAS_GLX)
return WAFFLE_PLATFORM_GLX;
+#elif defined(PIGLIT_HAS_WGL)
+   return WAFFLE_PLATFORM_WGL;
  #else
fprintf(stderr, environment var PIGLIT_PLATFORM must be set 
when piglit is built without GLX support\n);



These changes look OK to me, though I don't have too much experience in 
this area.


Reviewed-by: Brian Paul bri...@vmware.com


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


Re: [Piglit] [PATCH 1/4] framework: Use WGL by default on Windows.

2014-12-15 Thread Dylan Baker
On Monday, December 15, 2014 12:19:15 PM Jose Fonseca wrote:
 From: José Fonseca jfons...@vmware.com
 
 Like done with GLX on Linux.
 ---
  tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
 b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
 index 75fbacf..5d0f569 100644
 --- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
 +++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
 @@ -60,8 +60,10 @@ piglit_wfl_framework_choose_platform(const struct 
 piglit_gl_test_config *test_co
   return WAFFLE_PLATFORM_X11_EGL;
   }
  #endif
 -#ifdef PIGLIT_HAS_GLX
 +#if defined(PIGLIT_HAS_GLX)
   return WAFFLE_PLATFORM_GLX;
 +#elif defined(PIGLIT_HAS_WGL)
 + return WAFFLE_PLATFORM_WGL;
  #else
   fprintf(stderr, environment var PIGLIT_PLATFORM must be set 
   when piglit is built without GLX support\n);

You should probably update the comment here as well.

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


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [Patch v2 2/3] cmake: Simplify finding python modules

2014-12-15 Thread Dylan Baker
This patch adds 3 files, PythonModule.cmake, FindPythonMako.cmake and
FindPythonNumpy.cmake.

PythonModule provides a simple function for running python and parsing
the version strings, each FindPython*.cmake then just calls that
function, and then calls the find_package_handle_standard_args macro for
simple, standard finding. This is much more in line with how the core
cmake modules work, and makes is trivial to add additional python
modules with all of the standard cmake awesomeness like version
checking.

v2: - add copyright notice
- don't set a few variables that don't need to be set
---
 CMakeLists.txt  | 18 ++-
 cmake/Modules/FindPythonMako.cmake  | 30 
 cmake/Modules/FindPythonNumpy.cmake | 30 
 cmake/Modules/PiglitFindMako.cmake  | 93 -
 cmake/Modules/PythonModule.cmake| 28 +++
 5 files changed, 93 insertions(+), 106 deletions(-)
 create mode 100644 cmake/Modules/FindPythonMako.cmake
 create mode 100644 cmake/Modules/FindPythonNumpy.cmake
 delete mode 100644 cmake/Modules/PiglitFindMako.cmake
 create mode 100644 cmake/Modules/PythonModule.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ba48ea7..e85bb37 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,19 +171,11 @@ IF(PIGLIT_BUILD_GLX_TESTS)
pkg_check_modules(GLPROTO REQUIRED glproto)
 ENDIF()
 
-# Check for presence of Python 2.7 or greater.
-FIND_PACKAGE(PythonInterp 2.7 REQUIRED)
-include(PiglitFindMako)
-
-# Require numpy
-execute_process(
-   COMMAND ${PYTHON_EXECUTABLE} -c import numpy
-   OUTPUT_QUIET
-   ERROR_QUIET
-   RESULT_VARIABLE import_numpy_error_code)
-if(NOT import_numpy_error_code EQUAL 0)
-   message(FATAL_ERROR numpy python module not found)
-endif(NOT import_numpy_error_code EQUAL 0)
+# Check for presence of Python 2.7.x
+find_package(PythonInterp 2.7 REQUIRED)
+
+find_package(PythonNumpy REQUIRED)
+find_package(PythonMako 0.7.3 REQUIRED)
 
 # Default to compiling with debug information (`gcc -g`):
 if(NOT CMAKE_BUILD_TYPE)
diff --git a/cmake/Modules/FindPythonMako.cmake 
b/cmake/Modules/FindPythonMako.cmake
new file mode 100644
index 000..4194dac
--- /dev/null
+++ b/cmake/Modules/FindPythonMako.cmake
@@ -0,0 +1,30 @@
+# Copyright (C) 2014 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 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.
+
+# Find mako
+
+include(PythonModule)
+find_python_module(mako PythonMako)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+   REQUIRED_VARS PythonMako_STATUS
+VERSION_VAR PythonMako_VERSION_STRING
+)
diff --git a/cmake/Modules/FindPythonNumpy.cmake 
b/cmake/Modules/FindPythonNumpy.cmake
new file mode 100644
index 000..d3fd5aa
--- /dev/null
+++ b/cmake/Modules/FindPythonNumpy.cmake
@@ -0,0 +1,30 @@
+# Copyright (C) 2014 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 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.
+
+# Find numpy
+
+include(PythonModule)

[Piglit] [Patch v2 1/3] CMake: use cmake builtin python module

2014-12-15 Thread Dylan Baker
This removes a bunch of code that we rolled for finding python
interpreters, and uses the cmake builtins.

Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
---
 CMakeLists.txt | 23 ---
 cmake/Modules/PiglitFindMako.cmake |  2 +-
 cmake/piglit_dispatch.cmake|  2 +-
 generated_tests/CMakeLists.txt |  2 +-
 4 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f15971..ba48ea7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,28 +171,13 @@ IF(PIGLIT_BUILD_GLX_TESTS)
pkg_check_modules(GLPROTO REQUIRED glproto)
 ENDIF()
 
-# Check for presence of Python 2.6 or greater.
-foreach(python_cmd python2 python)
-   execute_process(
-   COMMAND ${python_cmd} -c import sys; assert '2.7' = 
sys.version  '3'
-   OUTPUT_QUIET
-   ERROR_QUIET
-   RESULT_VARIABLE python_version_check_error_code)
-   if(python_version_check_error_code EQUAL 0)
-   set(python ${python_cmd})
-   break()
-   endif(python_version_check_error_code EQUAL 0)
-endforeach(python_cmd)
-
-if(NOT DEFINED python)
-   message(FATAL_ERROR python version 2.x (where x = 6) required)
-endif(NOT DEFINED python)
-
+# Check for presence of Python 2.7 or greater.
+FIND_PACKAGE(PythonInterp 2.7 REQUIRED)
 include(PiglitFindMako)
 
 # Require numpy
 execute_process(
-   COMMAND ${python} -c import numpy
+   COMMAND ${PYTHON_EXECUTABLE} -c import numpy
OUTPUT_QUIET
ERROR_QUIET
RESULT_VARIABLE import_numpy_error_code)
@@ -491,7 +476,7 @@ set (CPACK_PACKAGE_VERSION_MINOR 0)
 
 # Use current date in MMDD format as patch number
 execute_process (
-   COMMAND ${python} -c import time, sys; 
sys.stdout.write(time.strftime('%Y%m%d'))
+   COMMAND ${PYTHON_EXECUTABLE} -c import time, sys; 
sys.stdout.write(time.strftime('%Y%m%d'))
OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
 )
 
diff --git a/cmake/Modules/PiglitFindMako.cmake 
b/cmake/Modules/PiglitFindMako.cmake
index eaca601..0637d30 100644
--- a/cmake/Modules/PiglitFindMako.cmake
+++ b/cmake/Modules/PiglitFindMako.cmake
@@ -57,7 +57,7 @@ if(MAKO_VERSION VERSION_LESS MAKO_REQUIRED_VERSION)
set(MAKO_VERSION MAKO_VERSION-NOTFOUND)
 
execute_process(
-   COMMAND ${python} -c ${__MAKO_CHECK_VERSION_PY}
+   COMMAND ${PYTHON_EXECUTABLE} -c ${__MAKO_CHECK_VERSION_PY}
OUTPUT_VARIABLE __MAKO_ACTUAL_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE __MAKO_STDERR
diff --git a/cmake/piglit_dispatch.cmake b/cmake/piglit_dispatch.cmake
index 93d6a3a..f685900 100644
--- a/cmake/piglit_dispatch.cmake
+++ b/cmake/piglit_dispatch.cmake
@@ -43,7 +43,7 @@ set(piglit_dispatch_gen_depends
 add_custom_command(
OUTPUT ${piglit_dispatch_gen_outputs}
DEPENDS ${piglit_dispatch_gen_depends}
-   COMMAND ${python} ${piglit_dispatch_gen_script} --out-dir 
${piglit_dispatch_gen_output_dir}
+   COMMAND ${PYTHON_EXECUTABLE} ${piglit_dispatch_gen_script} --out-dir 
${piglit_dispatch_gen_output_dir}
)
 
 add_custom_target(piglit_dispatch_gen
diff --git a/generated_tests/CMakeLists.txt b/generated_tests/CMakeLists.txt
index 6c8eaf9..8e7b02a 100644
--- a/generated_tests/CMakeLists.txt
+++ b/generated_tests/CMakeLists.txt
@@ -13,7 +13,7 @@ function(piglit_make_generated_tests file_list 
generator_script)
# during the build.
add_custom_command(
OUTPUT ${file_list}
-   COMMAND ${python} 
${CMAKE_CURRENT_SOURCE_DIR}/${generator_script}  ${file_list}
+   COMMAND ${PYTHON_EXECUTABLE} 
${CMAKE_CURRENT_SOURCE_DIR}/${generator_script}  ${file_list}
DEPENDS ${generator_script} ${ARGN}
VERBATIM)
 endfunction(piglit_make_generated_tests custom_target generator_script)
-- 
2.2.0

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


[Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

2014-12-15 Thread Dylan Baker
This is nice because it should work on both windows and on linux, since
FindWaffle is provided by waffle itself.

This is tested on Linux, but not on Windows.

NOTE: There is a bug in FindWaffle.cmake that causes it to never check
that the requested version is present. There is a patch on the waffle
list for this problem.

Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
---
 CMakeLists.txt | 26 +-
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e85bb37..200dbbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,31 +42,7 @@ else()
 endif()
 
 if(PIGLIT_USE_WAFFLE)
-   if (NOT MSVC)
-   pkg_check_modules(WAFFLE REQUIRED waffle-1)
-
-   if(NOT WAFFLE_FOUND)
-   message(FATAL_ERROR Failed to find Waffle. If Waffle
-   is not packaged for your distribution, you can get 
-   it at http://www.waffle-gl.org.;
-   )
-   endif()
-   endif ()
-
-   # Check the installed waffle version.
-   #
-   # We cannot reliably check the version with pkg_check_modules(), but
-   # instead must check the version manually as below. The problem is that,
-   # if one passes a required version to pkg_check_modules(), CMake
-   # validates the required version at most once for the lifetime of the
-   # source tree.  If someone changes the required version by editing the
-   # CMakeLists, CMake fails to detect the new requirement.
-   set(WAFFLE_REQUIRED_VERSION 1.3.0)
-   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
-   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
-   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
-   endif()
-
+   find_package(Waffle, 1.3.0 REQUIRED)
add_definitions(-DPIGLIT_USE_WAFFLE)
add_definitions(-DWAFFLE_API_VERSION=0x0103)
 else()
-- 
2.2.0

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


Re: [Piglit] [PATCH] glsl-deriv-varyings: Added checks for derivatives on parameters with negative or abs modifiers

2014-12-15 Thread Matt Turner
Reviewed-by: Matt Turner matts...@gmail.com
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] framework: Use WGL by default on Windows.

2014-12-15 Thread Emil Velikov
On 15/12/14 12:19, Jose Fonseca wrote:
 From: José Fonseca jfons...@vmware.com
 
 Like done with GLX on Linux.
Yes please. With or without pimping out the error message, this is

Reviewed-by: Emil Velikov emil.l.veli...@gmail.com

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


Re: [Piglit] [PATCH] Correct typos in README

2014-12-15 Thread Dylan Baker
I've pushed this upstream.

Thanks.

On Sunday, December 14, 2014 07:20:46 AM Dylan Baker wrote:
 Reviewed-by: Dylan Baker baker.dyla...@gmail.com
 On Dec 14, 2014 1:01 AM, Pavol Klačanský pa...@klacansky.com wrote:
 
  ---
   README | 16 
   1 file changed, 8 insertions(+), 8 deletions(-)
 
  diff --git a/README b/README
  index 2917c3a..1010342 100644
  --- a/README
  +++ b/README
  @@ -317,8 +317,8 @@ python framework:
  output, and then reading any trailing characters as well formed json
  returning the test result.
 
  -   This is a base clas and shouldn't be used directly, but provides an
  -   explination of the bahvior of the following classes
  +   This is a base class and should not be used directly, but provides an
  +   explanation of the behavior of the following classes.
 
PiglitGLTest
  A test class for native piglit OpenGL tests.
  @@ -330,16 +330,16 @@ python framework:
PiglitCLTest
  A test class for native piglit OpenCL tests.
 
  -   It currently provides no specail features
  +   It currently provides no special features.
 
GLSLParserTest
  A class for testing a glsl parser.
 
  -   It is generally unecissary to call this class directly as it uses a
  helper
  -   function to search directories for tests
  +   It is generally unnecessary to call this class directly as it uses a
  helper
  +   function to search directories for tests.
 
ShaderTest
  -   A class for testing using OpenGL shaders
  +   A class for testing using OpenGL shaders.
 
  -   It is generally unecissary to call this class directly as it uses a
  helper
  -   function to search directories for tests
  +   It is generally unnecessary to call this class directly as it uses a
  helper
  +   function to search directories for tests.
  --
  2.1.3
 
  ___
  Piglit mailing list
  Piglit@lists.freedesktop.org
  http://lists.freedesktop.org/mailman/listinfo/piglit
 


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/4] framework: Use WGL by default on Windows.

2014-12-15 Thread Jose Fonseca

On 15/12/14 17:24, Dylan Baker wrote:

On Monday, December 15, 2014 12:19:15 PM Jose Fonseca wrote:

From: José Fonseca jfons...@vmware.com

Like done with GLX on Linux.
---
  tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 75fbacf..5d0f569 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -60,8 +60,10 @@ piglit_wfl_framework_choose_platform(const struct 
piglit_gl_test_config *test_co
return WAFFLE_PLATFORM_X11_EGL;
}
  #endif
-#ifdef PIGLIT_HAS_GLX
+#if defined(PIGLIT_HAS_GLX)
return WAFFLE_PLATFORM_GLX;
+#elif defined(PIGLIT_HAS_WGL)
+   return WAFFLE_PLATFORM_WGL;
  #else
fprintf(stderr, environment var PIGLIT_PLATFORM must be set 
when piglit is built without GLX support\n);


You should probably update the comment here as well.


Sure.  Though the odds of this error is ever seen on Windows is 
virtually nil (as on Windows Waffle supports nothing but WGL).  That is, 
most readers of this message will be people building piglit on Unices 
without X.


Jose

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


Re: [Piglit] [PATCH 1/4] framework: Use WGL by default on Windows.

2014-12-15 Thread Dylan Baker
On Monday, December 15, 2014 07:12:45 PM Jose Fonseca wrote:
 On 15/12/14 17:24, Dylan Baker wrote:
  On Monday, December 15, 2014 12:19:15 PM Jose Fonseca wrote:
  From: José Fonseca jfons...@vmware.com
 
  Like done with GLX on Linux.
  ---
tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
 
  diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
  b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
  index 75fbacf..5d0f569 100644
  --- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
  +++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
  @@ -60,8 +60,10 @@ piglit_wfl_framework_choose_platform(const struct 
  piglit_gl_test_config *test_co
 return WAFFLE_PLATFORM_X11_EGL;
 }
#endif
  -#ifdef PIGLIT_HAS_GLX
  +#if defined(PIGLIT_HAS_GLX)
 return WAFFLE_PLATFORM_GLX;
  +#elif defined(PIGLIT_HAS_WGL)
  +  return WAFFLE_PLATFORM_WGL;
#else
 fprintf(stderr, environment var PIGLIT_PLATFORM must be set 
 when piglit is built without GLX support\n);
 
  You should probably update the comment here as well.

Either way then.

 
 Sure.  Though the odds of this error is ever seen on Windows is 
 virtually nil (as on Windows Waffle supports nothing but WGL).  That is, 
 most readers of this message will be people building piglit on Unices 
 without X.
 
 Jose
 


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

2014-12-15 Thread Jose Fonseca



On 15/12/14 18:56, Dylan Baker wrote:

This is nice because it should work on both windows and on linux, since
FindWaffle is provided by waffle itself.

This is tested on Linux, but not on Windows.

NOTE: There is a bug in FindWaffle.cmake that causes it to never check
that the requested version is present. There is a patch on the waffle
list for this problem.

Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
---
  CMakeLists.txt | 26 +-
  1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e85bb37..200dbbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,31 +42,7 @@ else()
  endif()

  if(PIGLIT_USE_WAFFLE)
-   if (NOT MSVC)
-   pkg_check_modules(WAFFLE REQUIRED waffle-1)
-
-   if(NOT WAFFLE_FOUND)
-   message(FATAL_ERROR Failed to find Waffle. If Waffle
-   is not packaged for your distribution, you can get 
-   it at 
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.waffle-2Dgl.org_d=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=SFYpmK_kSJY6st6hV0UPqYb0RyGi0hmhIs-w1r41SnAs=igTNwzIfRoh2YlND544S4c0lbruOUka8htnMKhjGMcEe=
 .
-   )
-   endif()
-   endif ()
-
-   # Check the installed waffle version.
-   #
-   # We cannot reliably check the version with pkg_check_modules(), but
-   # instead must check the version manually as below. The problem is that,
-   # if one passes a required version to pkg_check_modules(), CMake
-   # validates the required version at most once for the lifetime of the
-   # source tree.  If someone changes the required version by editing the
-   # CMakeLists, CMake fails to detect the new requirement.
-   set(WAFFLE_REQUIRED_VERSION 1.3.0)
-   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
-   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
-   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
-   endif()
-
+   find_package(Waffle, 1.3.0 REQUIRED)
add_definitions(-DPIGLIT_USE_WAFFLE)
add_definitions(-DWAFFLE_API_VERSION=0x0103)
  else()



`pkg_check_modules(WAFFLE)` defines  WAFFLE_INCLUDE_DIRS and WAFFLE_LDFLAGS

But FindWaffle.cmake defines WAFFLE_INCLUDE_DIR  WAFFLE_LIBRARIES

I'm surprised this works at all without renaming the variables everywhere.


The Windows instructions will need to be updated, mentining that 
-DCMAKE_MODULE_PATH=/path/to/where/FindWaffle.cmake/can/be/found should 
be passed on command line.



But otherwise I think it might be a good idea.


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


Re: [Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

2014-12-15 Thread Dylan Baker
On Monday, December 15, 2014 07:23:10 PM Jose Fonseca wrote:
 
 On 15/12/14 18:56, Dylan Baker wrote:
  This is nice because it should work on both windows and on linux, since
  FindWaffle is provided by waffle itself.
 
  This is tested on Linux, but not on Windows.
 
  NOTE: There is a bug in FindWaffle.cmake that causes it to never check
  that the requested version is present. There is a patch on the waffle
  list for this problem.
 
  Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
  ---
CMakeLists.txt | 26 +-
1 file changed, 1 insertion(+), 25 deletions(-)
 
  diff --git a/CMakeLists.txt b/CMakeLists.txt
  index e85bb37..200dbbf 100644
  --- a/CMakeLists.txt
  +++ b/CMakeLists.txt
  @@ -42,31 +42,7 @@ else()
endif()
 
if(PIGLIT_USE_WAFFLE)
  -   if (NOT MSVC)
  -   pkg_check_modules(WAFFLE REQUIRED waffle-1)
  -
  -   if(NOT WAFFLE_FOUND)
  -   message(FATAL_ERROR Failed to find Waffle. If Waffle
  -   is not packaged for your distribution, you can get 
  -   it at 
  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.waffle-2Dgl.org_d=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=SFYpmK_kSJY6st6hV0UPqYb0RyGi0hmhIs-w1r41SnAs=igTNwzIfRoh2YlND544S4c0lbruOUka8htnMKhjGMcEe=
   .
  -   )
  -   endif()
  -   endif ()
  -
  -   # Check the installed waffle version.
  -   #
  -   # We cannot reliably check the version with pkg_check_modules(), but
  -   # instead must check the version manually as below. The problem is that,
  -   # if one passes a required version to pkg_check_modules(), CMake
  -   # validates the required version at most once for the lifetime of the
  -   # source tree.  If someone changes the required version by editing the
  -   # CMakeLists, CMake fails to detect the new requirement.
  -   set(WAFFLE_REQUIRED_VERSION 1.3.0)
  -   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
  -   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
  -   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
  -   endif()
  -
  +   find_package(Waffle, 1.3.0 REQUIRED)
  add_definitions(-DPIGLIT_USE_WAFFLE)
  add_definitions(-DWAFFLE_API_VERSION=0x0103)
else()
 
 
 `pkg_check_modules(WAFFLE)` defines  WAFFLE_INCLUDE_DIRS and WAFFLE_LDFLAGS
 
 But FindWaffle.cmake defines WAFFLE_INCLUDE_DIR  WAFFLE_LIBRARIES
 
 I'm surprised this works at all without renaming the variables everywhere.
 
 
 The Windows instructions will need to be updated, mentining that 
 -DCMAKE_MODULE_PATH=/path/to/where/FindWaffle.cmake/can/be/found should 
 be passed on command line.
 
 
 But otherwise I think it might be a good idea.
 
 
 Jose

Is there a system standard place to put cmake find modules on windows?
On linux this is installed in /usr/share/cmake/Modules which is in the
cmake search path and is found automatically.


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

2014-12-15 Thread Jose Fonseca

On 15/12/14 19:36, Dylan Baker wrote:

On Monday, December 15, 2014 07:23:10 PM Jose Fonseca wrote:


On 15/12/14 18:56, Dylan Baker wrote:

This is nice because it should work on both windows and on linux, since
FindWaffle is provided by waffle itself.

This is tested on Linux, but not on Windows.

NOTE: There is a bug in FindWaffle.cmake that causes it to never check
that the requested version is present. There is a patch on the waffle
list for this problem.

Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
---
   CMakeLists.txt | 26 +-
   1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e85bb37..200dbbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,31 +42,7 @@ else()
   endif()

   if(PIGLIT_USE_WAFFLE)
-   if (NOT MSVC)
-   pkg_check_modules(WAFFLE REQUIRED waffle-1)
-
-   if(NOT WAFFLE_FOUND)
-   message(FATAL_ERROR Failed to find Waffle. If Waffle
-   is not packaged for your distribution, you can get 
-   it at 
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.waffle-2Dgl.org_d=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=SFYpmK_kSJY6st6hV0UPqYb0RyGi0hmhIs-w1r41SnAs=igTNwzIfRoh2YlND544S4c0lbruOUka8htnMKhjGMcEe=
 .
-   )
-   endif()
-   endif ()
-
-   # Check the installed waffle version.
-   #
-   # We cannot reliably check the version with pkg_check_modules(), but
-   # instead must check the version manually as below. The problem is that,
-   # if one passes a required version to pkg_check_modules(), CMake
-   # validates the required version at most once for the lifetime of the
-   # source tree.  If someone changes the required version by editing the
-   # CMakeLists, CMake fails to detect the new requirement.
-   set(WAFFLE_REQUIRED_VERSION 1.3.0)
-   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
-   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
-   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
-   endif()
-
+   find_package(Waffle, 1.3.0 REQUIRED)
add_definitions(-DPIGLIT_USE_WAFFLE)
add_definitions(-DWAFFLE_API_VERSION=0x0103)
   else()



`pkg_check_modules(WAFFLE)` defines  WAFFLE_INCLUDE_DIRS and WAFFLE_LDFLAGS

But FindWaffle.cmake defines WAFFLE_INCLUDE_DIR  WAFFLE_LIBRARIES

I'm surprised this works at all without renaming the variables everywhere.


The Windows instructions will need to be updated, mentining that
-DCMAKE_MODULE_PATH=/path/to/where/FindWaffle.cmake/can/be/found should
be passed on command line.


But otherwise I think it might be a good idea.


Jose


Is there a system standard place to put cmake find modules on windows?


Not really.  But don't worry. I'll propose a readme change after this 
goes in.




On linux this is installed in /usr/share/cmake/Modules which is in the
cmake search path and is found automatically.



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


Re: [Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

2014-12-15 Thread Emil Velikov
On 15/12/14 18:56, Dylan Baker wrote:
 This is nice because it should work on both windows and on linux, since
 FindWaffle is provided by waffle itself.
 
 This is tested on Linux, but not on Windows.
 
 NOTE: There is a bug in FindWaffle.cmake that causes it to never check
 that the requested version is present. There is a patch on the waffle
 list for this problem.
 
 Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
 ---
  CMakeLists.txt | 26 +-
  1 file changed, 1 insertion(+), 25 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index e85bb37..200dbbf 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -42,31 +42,7 @@ else()
  endif()
  
  if(PIGLIT_USE_WAFFLE)
 - if (NOT MSVC)
 - pkg_check_modules(WAFFLE REQUIRED waffle-1)
 -
 - if(NOT WAFFLE_FOUND)
 - message(FATAL_ERROR Failed to find Waffle. If Waffle
 - is not packaged for your distribution, you can get 
 - it at http://www.waffle-gl.org.;
 - )
 - endif()
 - endif ()
 -
 - # Check the installed waffle version.
 - #
 - # We cannot reliably check the version with pkg_check_modules(), but
 - # instead must check the version manually as below. The problem is that,
 - # if one passes a required version to pkg_check_modules(), CMake
 - # validates the required version at most once for the lifetime of the
 - # source tree.  If someone changes the required version by editing the
 - # CMakeLists, CMake fails to detect the new requirement.
 - set(WAFFLE_REQUIRED_VERSION 1.3.0)
 - if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
 - message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
 - piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
 - endif()
 -
 + find_package(Waffle, 1.3.0 REQUIRED)
You'll need to rebase your tree - the version should read 1.5.0.

Wrt linux testing I would recommend removing your local (system wide)
waffle and building/installing it in a custom prefix.

With the help of waffle/pkg/archlinux/mingw-w64-waffle/PKGBUILD you can
get a mingw version of waffle to cross-compile it. Glancing inside will
guide you how to run/do the piglit cross build.

-Emil

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


Re: [Piglit] [PATCH 2/4] cmake: Don't rely on pkg-config for all Windows builds.

2014-12-15 Thread Emil Velikov
On 15/12/14 12:19, Jose Fonseca wrote:
 From: José Fonseca jfons...@vmware.com
 
 Instead of just MSVC builds.
 
 Because pkg-config is not commonly available when compiling natively on
 Windows, and gives the wrong results (the host package instead of target
 package) when cross-compiling to Windows.
Short version:
Also might be worth checking Dylan's fixes (touching both waffle and
piglit). And then build on top if needed.


Longer version:
Don't know about native non-msvc builds, but cygwin had pkg-config which
was working fine. I've not tried waffle or piglit with cygwin.

The cross-compiling issue is likely to be caused by
something/miss-configured in your toolchain file. Take a look/install
the mingw-w64-cmake [1].


Cheers,
Emil

[1] https://aur.archlinux.org/packages/mingw-w64-cmake/

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


Re: [Piglit] [PATCH 2/4] cmake: Don't rely on pkg-config for all Windows builds.

2014-12-15 Thread Jose Fonseca

On 15/12/14 19:47, Emil Velikov wrote:

On 15/12/14 12:19, Jose Fonseca wrote:

From: José Fonseca jfons...@vmware.com

Instead of just MSVC builds.

Because pkg-config is not commonly available when compiling natively on
Windows, and gives the wrong results (the host package instead of target
package) when cross-compiling to Windows.

Short version:
Also might be worth checking Dylan's fixes (touching both waffle and
piglit). And then build on top if needed.


Longer version:
Don't know about native non-msvc builds, but cygwin had pkg-config which
was working fine. I've not tried waffle or piglit with cygwin.

The cross-compiling issue is likely to be caused by
something/miss-configured in your toolchain file. Take a look/install
the mingw-w64-cmake [1].


Cheers,
Emil

[1] 
https://urldefense.proofpoint.com/v2/url?u=https-3A__aur.archlinux.org_packages_mingw-2Dw64-2Dcmake_d=AAIDaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=jZIn8FKasi0habXCHbsoRS823LO0ZFGCba4GIDrlUBws=uISto3_loppZ5FFgWi7vZfrdad1Vlw1IiRXRCruxjMoe=




I did but it couldn't make it work for me.  pkg-config insists on 
picking the system's waffle-1.pc somehow.


Does this actually work for you?

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


Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Jason Ekstrand
On Fri, Nov 21, 2014 at 11:52 AM, Emil Velikov emil.l.veli...@gmail.com
wrote:

 This will allow us to use waffle with its upcoming WGL support for
 Windows. With that done, the final step to removing glut is to convert
 piglit to use waffle for MacOS.

 Current implementation does not have input handling/event loop, and as
 such one needs to pass -auto when running individual tests, otherwise
 the test will abort after being displayed for 8 seconds.

 Waffle 1.5.0 is the first version that has WGL support.


Do we need anything from 1.5.0 besides WGL?  If not, can we only require
1.5.0 if we're on windows and continue only requiring 1.3.0 on linux?  I
ask because I very much enjoy just using the fedora packages for waffle
which are at 1.3 (fedora 21) and 1.4 (rawhide).
--Jason



 TODO:
  - Bump the WAFFLE_API_VERSION ?
  - Add input handling (event_loop).

 v2: Updated the instructions in the README.
 v3: Update against upstream Waffle (no API breakage)

 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
 Reviewed-by: Brian Paul bri...@vmware.com (v1)
 Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
 ---
  CMakeLists.txt |  7 +-
  README | 38 +-
  tests/util/CMakeLists.txt  |  5 ++
  .../piglit-framework-gl/piglit_wfl_framework.c | 10 +++
  .../piglit-framework-gl/piglit_wgl_framework.c | 85
 ++
  .../piglit-framework-gl/piglit_wgl_framework.h | 29 
  .../piglit-framework-gl/piglit_winsys_framework.c  |  7 ++
  7 files changed, 177 insertions(+), 4 deletions(-)
  create mode 100644 tests/util/piglit-framework-gl/piglit_wgl_framework.c
  create mode 100644 tests/util/piglit-framework-gl/piglit_wgl_framework.h

 diff --git a/CMakeLists.txt b/CMakeLists.txt
 index 2f15971..6ba6df8 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -61,7 +61,7 @@ if(PIGLIT_USE_WAFFLE)
 # validates the required version at most once for the lifetime of
 the
 # source tree.  If someone changes the required version by editing
 the
 # CMakeLists, CMake fails to detect the new requirement.
 -   set(WAFFLE_REQUIRED_VERSION 1.3.0)
 +   set(WAFFLE_REQUIRED_VERSION 1.5.0)
 if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
 message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
 piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
 @@ -128,6 +128,11 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES Linux)
 pkg_check_modules(LIBDRM_INTEL QUIET libdrm_intel)
 pkg_check_modules(XCB_DRI2 QUIET xcb-dri2)
 pkg_check_modules(GLPROTO QUIET glproto)
 +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES Windows)
 +   if (PIGLIT_USE_WAFFLE)
 +   set(PIGLIT_HAS_WGL True)
 +   add_definitions(-DPIGLIT_HAS_WGL)
 +   endif()
  ENDIF()

  IF(PIGLIT_HAS_GLX)
 diff --git a/README b/README
 index 2917c3a..b894db7 100644
 --- a/README
 +++ b/README
 @@ -144,15 +144,19 @@ http://www.opengl.org/registry/#headers
  Copy header files to MSVC.
  C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL

 -Download freeglut for MSVC.
 -http://www.transmissionzero.co.uk/software/freeglut-devel
 -
  Install pip.
  http://www.pip-installer.org/en/latest/installing.html

  Install python mako.
 c:\Python27\Scripts\pip.exe install mako

 +
 +2.5.1 GLUT
 +--
 +
 +Download freeglut for MSVC.
 +http://www.transmissionzero.co.uk/software/freeglut-devel
 +
  Open Visual Studio Command Prompt.
  Start Menu-All Programs-Visual Studio 2013-Visual Studio Tools-VS2013
 x86 Native Tools Command Prompt
  CD to piglit directory.
 @@ -172,6 +176,34 @@ File-Exit
  Build from the Visual Studio Command Prompt.
 nmake

 +2.5.2 Waffle
 +
 +
 +Download waffle for MSVC.
 +http://www.waffle-gl.org/
 +
 +Open the Command Prompt.
 +CD to piglit directory.
 +
 +Run CMake GUI.
 +   C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
 +Configure
 +  - 'Visual Studio 12 2013', or
 +  - 'Visual Studio 12 2013 Win64'
 +  - Use default native compilers
 +Set these variables in the Advanced view.
 +Note that the values provided are for reference purposed and may differ
 on your system.
 +  - PIGLIT_USE_WAFFLE, BOOL, TRUE
 +  - WAFFLE_VERSION, STRING, 1.5.0
 +  - WAFFLE_INCLUDE_DIRS, PATH, ${waffle_root}\include\waffle
 +  - WAFFLE_LDFLAGS, FILEPATH, ${waffle_root}\lib\waffle-1.lib
 +  - GLEXT_INCLUDE_DIR, PATH, C:\Program Files\Microsoft Visual Studio
 12.0\VC\include\GL
 +Configure
 +Generate
 +File-Exit
 +
 +Build from the Command Prompt.
 +   cmake --build .

  3. How to run tests
  ---
 diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
 index 98eedd0..edc8469 100644
 --- a/tests/util/CMakeLists.txt
 +++ b/tests/util/CMakeLists.txt
 @@ -64,6 +64,11 @@ if(PIGLIT_USE_WAFFLE)
 piglit-util-waffle.c
 )

 +   if(PIGLIT_HAS_WGL)
 +   

Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Dylan Baker
On Monday, December 15, 2014 12:56:43 PM Jason Ekstrand wrote:
 On Fri, Nov 21, 2014 at 11:52 AM, Emil Velikov emil.l.veli...@gmail.com
 wrote:
 
  This will allow us to use waffle with its upcoming WGL support for
  Windows. With that done, the final step to removing glut is to convert
  piglit to use waffle for MacOS.
 
  Current implementation does not have input handling/event loop, and as
  such one needs to pass -auto when running individual tests, otherwise
  the test will abort after being displayed for 8 seconds.
 
  Waffle 1.5.0 is the first version that has WGL support.
 
 
 Do we need anything from 1.5.0 besides WGL?  If not, can we only require
 1.5.0 if we're on windows and continue only requiring 1.3.0 on linux?  I
 ask because I very much enjoy just using the fedora packages for waffle
 which are at 1.3 (fedora 21) and 1.4 (rawhide).
 --Jason
 

I believe that we can set 1.5 for windows only. Although I have patches
that will need 1.5 on Linux that I hope to send to the list before too
much longer.

 
 
  TODO:
   - Bump the WAFFLE_API_VERSION ?
   - Add input handling (event_loop).
 
  v2: Updated the instructions in the README.
  v3: Update against upstream Waffle (no API breakage)
 
  Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
  Reviewed-by: Brian Paul bri...@vmware.com (v1)
  Signed-off-by: Emil Velikov emil.l.veli...@gmail.com
  ---
   CMakeLists.txt |  7 +-
   README | 38 +-
   tests/util/CMakeLists.txt  |  5 ++
   .../piglit-framework-gl/piglit_wfl_framework.c | 10 +++
   .../piglit-framework-gl/piglit_wgl_framework.c | 85
  ++
   .../piglit-framework-gl/piglit_wgl_framework.h | 29 
   .../piglit-framework-gl/piglit_winsys_framework.c  |  7 ++
   7 files changed, 177 insertions(+), 4 deletions(-)
   create mode 100644 tests/util/piglit-framework-gl/piglit_wgl_framework.c
   create mode 100644 tests/util/piglit-framework-gl/piglit_wgl_framework.h
 
  diff --git a/CMakeLists.txt b/CMakeLists.txt
  index 2f15971..6ba6df8 100644
  --- a/CMakeLists.txt
  +++ b/CMakeLists.txt
  @@ -61,7 +61,7 @@ if(PIGLIT_USE_WAFFLE)
  # validates the required version at most once for the lifetime of
  the
  # source tree.  If someone changes the required version by editing
  the
  # CMakeLists, CMake fails to detect the new requirement.
  -   set(WAFFLE_REQUIRED_VERSION 1.3.0)
  +   set(WAFFLE_REQUIRED_VERSION 1.5.0)
  if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
  message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
  piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
  @@ -128,6 +128,11 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES Linux)
  pkg_check_modules(LIBDRM_INTEL QUIET libdrm_intel)
  pkg_check_modules(XCB_DRI2 QUIET xcb-dri2)
  pkg_check_modules(GLPROTO QUIET glproto)
  +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES Windows)
  +   if (PIGLIT_USE_WAFFLE)
  +   set(PIGLIT_HAS_WGL True)
  +   add_definitions(-DPIGLIT_HAS_WGL)
  +   endif()
   ENDIF()
 
   IF(PIGLIT_HAS_GLX)
  diff --git a/README b/README
  index 2917c3a..b894db7 100644
  --- a/README
  +++ b/README
  @@ -144,15 +144,19 @@ http://www.opengl.org/registry/#headers
   Copy header files to MSVC.
   C:\Program Files\Microsoft Visual Studio 12.0\VC\include\GL
 
  -Download freeglut for MSVC.
  -http://www.transmissionzero.co.uk/software/freeglut-devel
  -
   Install pip.
   http://www.pip-installer.org/en/latest/installing.html
 
   Install python mako.
  c:\Python27\Scripts\pip.exe install mako
 
  +
  +2.5.1 GLUT
  +--
  +
  +Download freeglut for MSVC.
  +http://www.transmissionzero.co.uk/software/freeglut-devel
  +
   Open Visual Studio Command Prompt.
   Start Menu-All Programs-Visual Studio 2013-Visual Studio Tools-VS2013
  x86 Native Tools Command Prompt
   CD to piglit directory.
  @@ -172,6 +176,34 @@ File-Exit
   Build from the Visual Studio Command Prompt.
  nmake
 
  +2.5.2 Waffle
  +
  +
  +Download waffle for MSVC.
  +http://www.waffle-gl.org/
  +
  +Open the Command Prompt.
  +CD to piglit directory.
  +
  +Run CMake GUI.
  +   C:\Program Files\CMake 2.8\bin\cmake-gui.exe .
  +Configure
  +  - 'Visual Studio 12 2013', or
  +  - 'Visual Studio 12 2013 Win64'
  +  - Use default native compilers
  +Set these variables in the Advanced view.
  +Note that the values provided are for reference purposed and may differ
  on your system.
  +  - PIGLIT_USE_WAFFLE, BOOL, TRUE
  +  - WAFFLE_VERSION, STRING, 1.5.0
  +  - WAFFLE_INCLUDE_DIRS, PATH, ${waffle_root}\include\waffle
  +  - WAFFLE_LDFLAGS, FILEPATH, ${waffle_root}\lib\waffle-1.lib
  +  - GLEXT_INCLUDE_DIR, PATH, C:\Program Files\Microsoft Visual Studio
  12.0\VC\include\GL
  +Configure
  +Generate
  +File-Exit
  +
  +Build from the Command Prompt.
  +   cmake --build .
 

Re: [Piglit] [Patch v2 3/3] CMakeLists.txt: Use FindWaffle.cmake instead of pkg-find

2014-12-15 Thread Dylan Baker
On Monday, December 15, 2014 07:23:10 PM Jose Fonseca wrote:
 
 On 15/12/14 18:56, Dylan Baker wrote:
  This is nice because it should work on both windows and on linux, since
  FindWaffle is provided by waffle itself.
 
  This is tested on Linux, but not on Windows.
 
  NOTE: There is a bug in FindWaffle.cmake that causes it to never check
  that the requested version is present. There is a patch on the waffle
  list for this problem.
 
  Signed-off-by: Dylan Baker dylanx.c.ba...@intel.com
  ---
CMakeLists.txt | 26 +-
1 file changed, 1 insertion(+), 25 deletions(-)
 
  diff --git a/CMakeLists.txt b/CMakeLists.txt
  index e85bb37..200dbbf 100644
  --- a/CMakeLists.txt
  +++ b/CMakeLists.txt
  @@ -42,31 +42,7 @@ else()
endif()
 
if(PIGLIT_USE_WAFFLE)
  -   if (NOT MSVC)
  -   pkg_check_modules(WAFFLE REQUIRED waffle-1)
  -
  -   if(NOT WAFFLE_FOUND)
  -   message(FATAL_ERROR Failed to find Waffle. If Waffle
  -   is not packaged for your distribution, you can get 
  -   it at 
  https://urldefense.proofpoint.com/v2/url?u=http-3A__www.waffle-2Dgl.org_d=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=SFYpmK_kSJY6st6hV0UPqYb0RyGi0hmhIs-w1r41SnAs=igTNwzIfRoh2YlND544S4c0lbruOUka8htnMKhjGMcEe=
   .
  -   )
  -   endif()
  -   endif ()
  -
  -   # Check the installed waffle version.
  -   #
  -   # We cannot reliably check the version with pkg_check_modules(), but
  -   # instead must check the version manually as below. The problem is that,
  -   # if one passes a required version to pkg_check_modules(), CMake
  -   # validates the required version at most once for the lifetime of the
  -   # source tree.  If someone changes the required version by editing the
  -   # CMakeLists, CMake fails to detect the new requirement.
  -   set(WAFFLE_REQUIRED_VERSION 1.3.0)
  -   if(WAFFLE_VERSION VERSION_LESS WAFFLE_REQUIRED_VERSION)
  -   message(FATAL_ERROR Found waffle-${WAFFLE_VERSION}, but 
  -   piglit requires waffle-${WAFFLE_REQUIRED_VERSION})
  -   endif()
  -
  +   find_package(Waffle, 1.3.0 REQUIRED)
  add_definitions(-DPIGLIT_USE_WAFFLE)
  add_definitions(-DWAFFLE_API_VERSION=0x0103)
else()
 
 
 `pkg_check_modules(WAFFLE)` defines  WAFFLE_INCLUDE_DIRS and WAFFLE_LDFLAGS
 
 But FindWaffle.cmake defines WAFFLE_INCLUDE_DIR  WAFFLE_LIBRARIES

Now that I've done a fully clean build it's not working for that reason.
I'll fix and send a v3

 
 I'm surprised this works at all without renaming the variables everywhere.
 
 
 The Windows instructions will need to be updated, mentining that 
 -DCMAKE_MODULE_PATH=/path/to/where/FindWaffle.cmake/can/be/found should 
 be passed on command line.
 
 
 But otherwise I think it might be a good idea.
 
 
 Jose


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/4] cmake: Don't rely on pkg-config for all Windows builds.

2014-12-15 Thread Emil Velikov
On 15/12/14 20:09, Jose Fonseca wrote:
 On 15/12/14 19:47, Emil Velikov wrote:
 On 15/12/14 12:19, Jose Fonseca wrote:
 From: José Fonseca jfons...@vmware.com

 Instead of just MSVC builds.

 Because pkg-config is not commonly available when compiling natively on
 Windows, and gives the wrong results (the host package instead of target
 package) when cross-compiling to Windows.
 Short version:
 Also might be worth checking Dylan's fixes (touching both waffle and
 piglit). And then build on top if needed.


 Longer version:
 Don't know about native non-msvc builds, but cygwin had pkg-config which
 was working fine. I've not tried waffle or piglit with cygwin.

 The cross-compiling issue is likely to be caused by
 something/miss-configured in your toolchain file. Take a look/install
 the mingw-w64-cmake [1].


 Cheers,
 Emil

 [1]
 https://urldefense.proofpoint.com/v2/url?u=https-3A__aur.archlinux.org_packages_mingw-2Dw64-2Dcmake_d=AAIDaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=jZIn8FKasi0habXCHbsoRS823LO0ZFGCba4GIDrlUBws=uISto3_loppZ5FFgWi7vZfrdad1Vlw1IiRXRCruxjMoe=


 
 
 I did but it couldn't make it work for me.  pkg-config insists on
 picking the system's waffle-1.pc somehow.
 
 Does this actually work for you?
 
Yes it did. I recall having two successful cross-builds of the whole of
piglit around the time of the GSoC midterm. One with glut and another
one with waffle.

Things may have changed since then, but I'll check within the next
couple of days.


-Emil

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


Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Emil Velikov
On 15/12/14 20:56, Jason Ekstrand wrote:
 
 
 On Fri, Nov 21, 2014 at 11:52 AM, Emil Velikov emil.l.veli...@gmail.com
 mailto:emil.l.veli...@gmail.com wrote:
 
 This will allow us to use waffle with its upcoming WGL support for
 Windows. With that done, the final step to removing glut is to convert
 piglit to use waffle for MacOS.
 
 Current implementation does not have input handling/event loop, and as
 such one needs to pass -auto when running individual tests, otherwise
 the test will abort after being displayed for 8 seconds.
 
 Waffle 1.5.0 is the first version that has WGL support.
 
 
 Do we need anything from 1.5.0 besides WGL?  If not, can we only require
 1.5.0 if we're on windows and continue only requiring 1.3.0 on linux?  I
 ask because I very much enjoy just using the fedora packages for waffle
 which are at 1.3 (fedora 21) and 1.4 (rawhide).
Either way I would highly encourage you to get away from 1.3.x and move
to 1.4.x or 1.5.x. Installing it in a custom prefix should work, yet
I've not tried it personally.

I'll be ok with dropping the version requirement but I'd rather do that
as Dylan's latest patch hits the ML/master.


-Emil

P.S. Is it me or does GMail adds some very odd formatting to the text
you quote ?
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Dave Airlie
On 16 December 2014 at 07:57, Emil Velikov emil.l.veli...@gmail.com wrote:
 On 15/12/14 20:56, Jason Ekstrand wrote:


 On Fri, Nov 21, 2014 at 11:52 AM, Emil Velikov emil.l.veli...@gmail.com
 mailto:emil.l.veli...@gmail.com wrote:

 This will allow us to use waffle with its upcoming WGL support for
 Windows. With that done, the final step to removing glut is to convert
 piglit to use waffle for MacOS.

 Current implementation does not have input handling/event loop, and as
 such one needs to pass -auto when running individual tests, otherwise
 the test will abort after being displayed for 8 seconds.

 Waffle 1.5.0 is the first version that has WGL support.


 Do we need anything from 1.5.0 besides WGL?  If not, can we only require
 1.5.0 if we're on windows and continue only requiring 1.3.0 on linux?  I
 ask because I very much enjoy just using the fedora packages for waffle
 which are at 1.3 (fedora 21) and 1.4 (rawhide).
 Either way I would highly encourage you to get away from 1.3.x and move
 to 1.4.x or 1.5.x. Installing it in a custom prefix should work, yet
 I've not tried it personally.

 I'll be ok with dropping the version requirement but I'd rather do that
 as Dylan's latest patch hits the ML/master.

Can we get a stable 1.5.0 release tarball somewhere?

Using github for tarballs isn't useful for distros since they move
stuff around every month or so.

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


Re: [Piglit] [PATCH] glsl-deriv-varyings: Added checks for derivatives on parameters with negative or abs modifiers

2014-12-15 Thread Vinson Lee
On Mon, Dec 15, 2014 at 11:05 AM, Matt Turner matts...@gmail.com wrote:
 Reviewed-by: Matt Turner matts...@gmail.com
 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit


This patch introduced two GCC warnings.

glsl-deriv-varyings.c:108:20: warning: ‘fragShaderText4’ defined but
not used [-Wunused-variable]
 static const char *fragShaderText4 =
^
glsl-deriv-varyings.c:118:20: warning: ‘fragShaderText5’ defined but
not used [-Wunused-variable]
 static const char *fragShaderText5 =
^
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] fbo-blit-scaled-linear: Use const reference.

2014-12-15 Thread Vinson Lee
Fix Coverity big parameter passed by value defect.

Signed-off-by: Vinson Lee v...@freedesktop.org
---
 tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp 
b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
index c972586..336a962 100644
--- a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
+++ b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
@@ -203,7 +203,7 @@ piglit_init(int argc, char **argv)
}
 }
 
-bool test_blit_scaled_linear(Fbo fbo_test)
+bool test_blit_scaled_linear(const Fbo fbo_test)
 {
GLfloat scale;
GLint samples;
-- 
1.9.1

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


[Piglit] [PATCH 00/24] ARB_direct_state_access texture tests

2014-12-15 Thread Laura Ekstrand
These tests test ARB_direct_state_access texture functions.  Since DSA 
functions and traditional functions typically share the same backend 
implementation, some of the simpler or more obscure functions (such as 
glCompressedTextureSubImage1D) are only tested trivially.  Moreover, many of 
the more sophisticated tests were adapted from tests of similar non-DSA 
functions.  During the adaptation process, I tried where it was possible and 
sensible to leave behind a mix of traditional and DSA function calls in order 
to test interactions between them.  In cases of brand-new GL API functions, 
such as glCreateTextures, I wrote new tests.

Some of these tests check whether or not the DSA function calls throw the 
correct errors.  In the process of checking errors for glTextureParameter*, 
Dylan Baker and I discovered that some errors changed beginning in the OpenGL 
4.3 core spec.  For this reason, I updated some of the previously existing 
Piglit tests to conform to the OpenGL 4.5 core spec;  the new error style is 
more uniform with the OpenGL ES 3.1 spec.

Dylan Baker (3):
  arb_direct_state_access: Add tests for non-generated texture object
names passed to glTextureParameter.
  arb_direct_state_access: Add additional error checking for
*TextureParameter
  arb_direct_state_access: Most error checking for TextureParameter
functions

Laura Ekstrand (21):
  arb_direct_state_access: DSA 2D Textures hello world test.
  arb_direct_state_access: glTextureSubImage*D test.
  arb_direct_state_access: Testing glBindTextureUnit.
  arb_direct_state_access: Added glCreateTextures test.
  arb_direct_state_access: Added glTextureStorage*D test.
  arb_direct_state_access: DSA texunits test (adapted from
tests/general)
  arb_direct_state_access: Added test for TextureParameter* and
GetTextureParameter*.
  arb_direct_state_access: Added tests for glGetTexLevelParameterfv to
texture-storage.c
  arb_direct_state_access: Added tests for CopyTextureSubImage*D.
  arb_direct_state_access: Tests for glGetTextureImage.
  arb_direct_state_access: Added tests for glGetCompressedTextureImage.
  arb_direct_state_access: Modified gettexture-image-formats.c to test
glGenerateTextureMipmap.
  arb_direct_state_access: Added a test for
glTextureStorage2DMultisample.
  arb_direct_state_access: Using glTextureStorage2DMultisample for
something not completely trivial.
  arb_direct_state_access: Testing glTextureStorage3DMultisample.
  arb_direct_state_access: Added test for glCompressedTextureSubImage1D.
  arb_direct_state_access: Added test for glTextureBuffer.
  general: Testing really basic texture errors.
  arb_texture_rectangle: Updated error conditions to match the OpenGL
4.5 and ES 3.1 core specs.
  arb_texture_storage_multisample: Updated error conditions to match the
OpenGL 4.5 and ES 3.1 core specs.
  ext_packed_float: Refactored the
getteximage-invalid-format-for-packed-type.c test.

 tests/all.py   |  21 +
 tests/general/CMakeLists.gl.txt|   1 +
 tests/general/tex-errors.c |  74 +++
 tests/spec/CMakeLists.txt  |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |  30 +
 tests/spec/arb_direct_state_access/CMakeLists.txt  |   1 +
 .../arb_direct_state_access/bind-texture-unit.c|  78 +++
 .../compressedtextureimage.c   | 288 ++
 .../arb_direct_state_access/copytexturesubimage.c  | 293 ++
 .../spec/arb_direct_state_access/create-textures.c |  80 +++
 tests/spec/arb_direct_state_access/dsa-textures.c  | 123 
 tests/spec/arb_direct_state_access/dsa-utils.c |  79 +++
 tests/spec/arb_direct_state_access/dsa-utils.h |  51 ++
 tests/spec/arb_direct_state_access/get-textures.c  | 114 
 .../getcompressedtextureimage.c| 433 ++
 .../gettextureimage-formats.c  | 558 ++
 .../gettextureimage-luminance.c| 260 +
 .../gettextureimage-simple.c   |  86 +++
 .../gettextureimage-targets.c  | 305 ++
 .../spec/arb_direct_state_access/texture-buffer.c  | 106 
 .../spec/arb_direct_state_access/texture-errors.c  | 475 
 .../spec/arb_direct_state_access/texture-params.c  | 204 +++
 .../texture-storage-multisample.c  | 481 
 .../spec/arb_direct_state_access/texture-storage.c | 624 +
 .../spec/arb_direct_state_access/texturesubimage.c | 415 ++
 tests/spec/arb_direct_state_access/texunits.c  | 383 +
 .../texture-base-level-error.c |  35 +-
 .../arb_texture_storage_multisample/tex-param.c|  86 ++-
 .../getteximage-invalid-format-for-packed-type.c   | 105 ++--
 tests/util/piglit-util-gl.c|   2 +-
 tests/util/piglit-util-gl.h|   1 +
 31 

[Piglit] [PATCH 02/24] arb_direct_state_access: glTextureSubImage*D test.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
 .../spec/arb_direct_state_access/texturesubimage.c | 415 +
 3 files changed, 417 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/texturesubimage.c

diff --git a/tests/all.py b/tests/all.py
index 84639c2..5ed0444 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4308,6 +4308,7 @@ import_glsl_parser_tests(arb_derivative_control,
 
 spec['ARB_direct_state_access'] = {}
 spec['ARB_direct_state_access']['dsa-textures'] = 
PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)
+spec['ARB_direct_state_access']['texturesubimage'] = 
PiglitGLTest('arb_direct_state_access-texturesubimage', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index cb0f7da..102579c 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -10,4 +10,5 @@ link_libraries (
 )
 
 piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
+piglit_add_executable (arb_direct_state_access-dsa-texturesubimage 
texturesubimage.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/texturesubimage.c 
b/tests/spec/arb_direct_state_access/texturesubimage.c
new file mode 100644
index 000..b3a09e6
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/texturesubimage.c
@@ -0,0 +1,415 @@
+/*
+ * Copyright © 2011 VMware, Inc.
+ * Copyright © 2014 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 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.
+ *
+ */
+
+
+/**
+ * This should expose any errors in texel addressing within a texture image
+ * when calling glTextureSubImage1D/2D/3D().
+ *
+ * Brian Paul
+ * October 2011
+ *
+ * Adapted for testing ARB_direct_state_access by
+ * Laura Ekstrand
+ * October 2014
+ */
+
+
+#include piglit-util-gl.h
+#include ../fbo/fbo-formats.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+/**
+ * This is a subset of the formats in fbo-formats.h
+ * We don't test non-color, float, or int/uint textures at this time.
+ */
+static const struct test_desc texsubimage_test_sets[] = {
+   {
+   core,
+   ARRAY_SIZE(core),
+   Core formats,
+   GL_UNSIGNED_NORMALIZED,
+   },
+   {
+   tdfx_texture_compression_fxt1,
+   ARRAY_SIZE(tdfx_texture_compression_fxt1),
+   GL_3DFX_texture_compression_FXT1,
+   GL_UNSIGNED_NORMALIZED,
+   {GL_ARB_texture_compression,
+GL_3DFX_texture_compression_FXT1},
+   },
+   {
+   ext_texture_compression_s3tc,
+   ARRAY_SIZE(ext_texture_compression_s3tc),
+   GL_EXT_texture_compression_s3tc,
+   GL_UNSIGNED_NORMALIZED,
+   {GL_ARB_texture_compression,
+GL_EXT_texture_compression_s3tc},
+   },
+   {
+   ext_texture_compression_rgtc,
+   ARRAY_SIZE(ext_texture_compression_rgtc),
+   GL_EXT_texture_compression_rgtc,
+   GL_UNSIGNED_NORMALIZED,
+   {GL_EXT_texture_compression_rgtc}
+   },
+   {
+   ext_texture_compression_latc,
+   ARRAY_SIZE(ext_texture_compression_latc),
+   GL_EXT_texture_compression_latc,
+   GL_UNSIGNED_NORMALIZED,
+   {GL_EXT_texture_compression_latc}
+   }
+};
+
+
+/**
+ * XXX add this to piglit-util if useful elsewhere.
+ */
+static GLvoid
+piglit_draw_rect_tex3d(float x, float y, float w, 

[Piglit] [PATCH 03/24] arb_direct_state_access: Testing glBindTextureUnit.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |  1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |  1 +
 .../arb_direct_state_access/bind-texture-unit.c| 78 ++
 3 files changed, 80 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/bind-texture-unit.c

diff --git a/tests/all.py b/tests/all.py
index 5ed0444..e371c2b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4309,6 +4309,7 @@ import_glsl_parser_tests(arb_derivative_control,
 spec['ARB_direct_state_access'] = {}
 spec['ARB_direct_state_access']['dsa-textures'] = 
PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)
 spec['ARB_direct_state_access']['texturesubimage'] = 
PiglitGLTest('arb_direct_state_access-texturesubimage', run_concurrent=True)
+spec['ARB_direct_state_access']['bind-texture-unit'] = 
PiglitGLTest('arb_direct_state_access-bind-texture-unit', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 102579c..f45269f 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -11,4 +11,5 @@ link_libraries (
 
 piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-dsa-texturesubimage 
texturesubimage.c)
+piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/bind-texture-unit.c 
b/tests/spec/arb_direct_state_access/bind-texture-unit.c
new file mode 100644
index 000..b6a98a9
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/bind-texture-unit.c
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2014 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 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.
+ */
+
+/** @file bind-texture-unit.c
+ *
+ * Tests glBindTextureUnit to see if it behaves in the expected way,
+ * throwing the correct errors, etc.
+ */
+
+#include piglit-util-gl.h
+#include dsa-utils.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension(GL_ARB_direct_state_access);
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   GLuint name = 3;
+   GLint nunits;
+
+   /* Throw some invalid inputs at BindTextureUnit. */
+   /* Non-gen-d texture name */
+   glBindTextureUnit(0, name);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+
+   /* No target */
+   glGenTextures(1, name);
+   glBindTextureUnit(0, name);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   /* Texture unit doesn't exist */
+   glDeleteTextures(1, name);
+   glCreateTextures(GL_TEXTURE_2D, 1, name);
+   glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, nunits);
+   glBindTextureUnit(nunits, name); /* Too High */
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+
+   /* Trivial, but should work. */
+   glBindTextureUnit(1, name);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
-- 
2.1.0

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


[Piglit] [PATCH 01/24] arb_direct_state_access: DSA 2D Textures hello world test.

2014-12-15 Thread Laura Ekstrand
Dylan Baker: all.py: Add dsa tests.
---
 tests/all.py   |   2 +
 tests/spec/CMakeLists.txt  |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |  13 +++
 tests/spec/arb_direct_state_access/CMakeLists.txt  |   1 +
 tests/spec/arb_direct_state_access/dsa-textures.c  | 123 +
 tests/spec/arb_direct_state_access/dsa-utils.c |  79 +
 tests/spec/arb_direct_state_access/dsa-utils.h |  51 +
 7 files changed, 270 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.txt
 create mode 100644 tests/spec/arb_direct_state_access/dsa-textures.c
 create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.c
 create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.h

diff --git a/tests/all.py b/tests/all.py
index cfbe529..84639c2 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4306,6 +4306,8 @@ add_shader_test_dir(arb_derivative_control,
 import_glsl_parser_tests(arb_derivative_control,
  testsDir + '/spec/arb_derivative_control', [''])
 
+spec['ARB_direct_state_access'] = {}
+spec['ARB_direct_state_access']['dsa-textures'] = 
PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index dfd822b..697b00d 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -114,3 +114,4 @@ add_subdirectory (arb_blend_func_extended)
 add_subdirectory (ext_unpack_subimage)
 add_subdirectory (arb_vertex_array_object)
 add_subdirectory (oes_texture_float)
+add_subdirectory (arb_direct_state_access)
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
new file mode 100644
index 000..cb0f7da
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -0,0 +1,13 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+   ${OPENGL_glu_LIBRARY}
+)
+
+piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
+# vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c 
b/tests/spec/arb_direct_state_access/dsa-textures.c
new file mode 100644
index 000..468d23e
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/dsa-textures.c
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2014 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 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.
+ */
+
+/** @file dsa-textures.c
+ *
+ * Tests the direct state access functionality for creating, initializing, and
+ * rendering texture objects.
+ */
+#include piglit-util-gl.h
+#include dsa-utils.h
+
+#include stdlib.h
+
+static const char* glversion;
+static bool nv340_23; /* Are we using the NVIDIA 340.23 driver? */
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+GLfloat*
+random_image_data(void)
+{
+   int i;
+   GLfloat *img = malloc(4*piglit_width*piglit_height*sizeof(GLfloat));
+   for (i = 0; i  4*piglit_width*piglit_height; ++i) {
+   img[i] = (float) rand() / RAND_MAX;
+   }
+   return img;
+} /* random_image_data */
+
+void
+piglit_init(int argc, char **argv)
+{
+   

[Piglit] [PATCH 05/24] arb_direct_state_access: Added glTextureStorage*D test.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
 .../spec/arb_direct_state_access/texture-storage.c | 602 +
 3 files changed, 604 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/texture-storage.c

diff --git a/tests/all.py b/tests/all.py
index 838bf2d..ee74ffc 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4311,6 +4311,7 @@ spec['ARB_direct_state_access']['dsa-textures'] = 
PiglitGLTest('arb_direct_state
 spec['ARB_direct_state_access']['texturesubimage'] = 
PiglitGLTest('arb_direct_state_access-texturesubimage', run_concurrent=True)
 spec['ARB_direct_state_access']['bind-texture-unit'] = 
PiglitGLTest('arb_direct_state_access-bind-texture-unit', run_concurrent=True)
 spec['ARB_direct_state_access']['create-textures'] = 
PiglitGLTest('arb_direct_state_access-create-textures', run_concurrent=True)
+spec['ARB_direct_state_access']['texture-storage'] = 
PiglitGLTest('arb_direct_state_access-texture-storage', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 6f50230..4b79b90 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -13,4 +13,5 @@ piglit_add_executable (arb_direct_state_access-dsa-textures 
dsa-textures.c dsa-u
 piglit_add_executable (arb_direct_state_access-dsa-texturesubimage 
texturesubimage.c)
 piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
 piglit_add_executable (arb_direct_state_access-create-textures 
create-textures.c)
+piglit_add_executable (arb_direct_state_access-texture-storage 
texture-storage.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/texture-storage.c 
b/tests/spec/arb_direct_state_access/texture-storage.c
new file mode 100644
index 000..5838146
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/texture-storage.c
@@ -0,0 +1,602 @@
+/*
+ * Copyright (c) 2011 VMware, Inc.
+ * Copyright (c) 2014 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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
+ * NON-INFRINGEMENT.  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.
+ */
+
+/**
+ * Note: only the glTextureStorage2D() function is tested with actual 
+ * rendering.
+ * 
+ * Original author:  Brian Paul
+ * Adapted for testing ARB_direct_state_access by
+ * Laura Ekstrand
+ * November 2014
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 12;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char *TestName = texture-storage;
+
+static GLubyte Colors[][4] = {
+   {255,   0,  0, 255},
+   {  0, 255,  0, 255},
+   {  0,   0, 255, 255},
+   {  0, 255, 255, 255},
+   {255,   0, 255, 255},
+   {255, 255,  0, 255},
+   {255, 255, 255, 255},
+   {128,   0,  0, 255},
+   {  0, 128,  0, 255},
+   {  0,   0, 128, 255}
+};
+
+
+/**
+ * Do error-check tests for a non-mipmapped texture.
+ */
+static bool
+test_one_level_errors(GLenum target)
+{
+   const GLint width = 64, height = 4, depth = 8;
+   GLuint tex;
+   GLint v;
+
+   assert(target == GL_TEXTURE_1D ||
+  target == GL_TEXTURE_2D ||
+  target == GL_TEXTURE_3D);
+
+   glCreateTextures(target, 1, tex);
+   glBindTextureUnit(0, tex);
+
+   if (target == GL_TEXTURE_1D) {
+   glTextureStorage1D(tex, 1, GL_RGBA8, width);
+   }
+   else if (target == GL_TEXTURE_2D) {
+   glTextureStorage2D(tex, 1, GL_RGBA8, width, height);
+   }
+   else if (target == GL_TEXTURE_3D) {
+   glTextureStorage3D(tex, 1, GL_RGBA8, width, height, depth);
+   }
+
+   

[Piglit] [PATCH 07/24] arb_direct_state_access: Added test for TextureParameter* and GetTextureParameter*.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
 .../spec/arb_direct_state_access/texture-params.c  | 204 +
 3 files changed, 206 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/texture-params.c

diff --git a/tests/all.py b/tests/all.py
index 9276186..3804cb6 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4313,6 +4313,7 @@ spec['ARB_direct_state_access']['bind-texture-unit'] = 
PiglitGLTest('arb_direct_
 spec['ARB_direct_state_access']['create-textures'] = 
PiglitGLTest('arb_direct_state_access-create-textures', run_concurrent=True)
 spec['ARB_direct_state_access']['texture-storage'] = 
PiglitGLTest('arb_direct_state_access-texture-storage', run_concurrent=True)
 spec['ARB_direct_state_access']['texunits'] = 
PiglitGLTest('arb_direct_state_access-texunits', run_concurrent=True)
+spec['ARB_direct_state_access']['texture-params'] = 
PiglitGLTest('arb_direct_state_access-texture-params', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index d347f60..1b24701 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -15,4 +15,5 @@ piglit_add_executable 
(arb_direct_state_access-bind-texture-unit bind-texture-un
 piglit_add_executable (arb_direct_state_access-create-textures 
create-textures.c)
 piglit_add_executable (arb_direct_state_access-texture-storage 
texture-storage.c)
 piglit_add_executable (arb_direct_state_access-texunits texunits.c)
+piglit_add_executable (arb_direct_state_access-texture-params texture-params.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/texture-params.c 
b/tests/spec/arb_direct_state_access/texture-params.c
new file mode 100644
index 000..66fb9db
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/texture-params.c
@@ -0,0 +1,204 @@
+/*
+ * Copyright 2014 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 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.
+ */
+
+/** @file texture-params.c
+ *
+ * Trivially validates all the TextureParameter and GetTextureParameter entry
+ * points by setting something, then getting it.
+ */
+
+#include piglit-util-gl.h
+#include math.h
+
+/* Copied from Mesa. TODO: How do other drivers do this? */
+/* a close approximation: */
+#define FLOAT_TO_INT(X) ( (GLint) (2147483647.0 * (X)) )
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension(GL_ARB_direct_state_access);
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   int i;
+   GLuint name;
+   GLfloat scalarf = -100.0f;
+   GLfloat paramf;
+   GLfloat colorfv[4] = { 1.0f, 0.2f, 0.3f, 0.4f };
+   GLfloat paramfv[4];
+   GLint scalari = 5;
+   GLint parami;
+   GLenum scalare = GL_NEAREST;
+   GLenum parame;
+   GLint coloriv[4];
+   GLint colorIiv[4] = {256, 50, -75, 100};
+   GLint paramIiv[4];
+   GLuint colorIuiv[4] = {256, 50, 75, 100};
+   GLuint paramIuiv[4];
+   GLenum swizzle[4] = {GL_RED, GL_BLUE, GL_RED, GL_BLUE};
+   GLenum paramse[4];
+
+   glCreateTextures(GL_TEXTURE_2D, 1, name);
+
+   /* f case */
+   glTextureParameterf(name, GL_TEXTURE_MIN_LOD, scalarf);
+   glGetTextureParameterfv(name, GL_TEXTURE_MIN_LOD, paramf);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+   if (paramf != scalarf) {
+   printf(glTextureParameterf did not correctly set 
+  GL_TEXTURE_MIN_LOD.\n\tValue returned by 

[Piglit] [PATCH 10/24] arb_direct_state_access: Tests for glGetTextureImage.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   6 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   5 +
 tests/spec/arb_direct_state_access/get-textures.c  | 114 +
 .../gettextureimage-formats.c  | 559 +
 .../gettextureimage-luminance.c| 260 ++
 .../gettextureimage-simple.c   |  86 
 .../gettextureimage-targets.c  | 305 +++
 7 files changed, 1335 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/get-textures.c
 create mode 100644 tests/spec/arb_direct_state_access/gettextureimage-formats.c
 create mode 100644 
tests/spec/arb_direct_state_access/gettextureimage-luminance.c
 create mode 100644 tests/spec/arb_direct_state_access/gettextureimage-simple.c
 create mode 100644 tests/spec/arb_direct_state_access/gettextureimage-targets.c

diff --git a/tests/all.py b/tests/all.py
index 48ec09f..8dfb5ac 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4316,6 +4316,12 @@ spec['ARB_direct_state_access']['texunits'] = 
PiglitGLTest('arb_direct_state_acc
 spec['ARB_direct_state_access']['texture-params'] = 
PiglitGLTest('arb_direct_state_access-texture-params', run_concurrent=True)
 spec['ARB_direct_state_access']['copytexturesubimage'] = 
PiglitGLTest('arb_direct_state_access-copytexturesubimage', run_concurrent=True)
 spec['ARB_direct_state_access']['texture-errors'] = 
PiglitGLTest('arb_direct_state_access-texture-errors', run_concurrent=True)
+spec['ARB_direct_state_access']['get-textures'] = 
PiglitGLTest('arb_direct_state_access-get-textures', run_concurrent=True)
+spec['ARB_direct_state_access']['gettextureimage-formats'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-formats', 
run_concurrent=True)
+spec['ARB_direct_state_access']['gettextureimage-luminance'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-luminance', 
run_concurrent=True)
+spec['ARB_direct_state_access']['gettextureimage-simple'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-simple', 
run_concurrent=True)
+spec['ARB_direct_state_access']['gettextureimage-targets'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-targets', 
run_concurrent=True)
+
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 4f8f49f..d5a496e 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -18,4 +18,9 @@ piglit_add_executable (arb_direct_state_access-texunits 
texunits.c)
 piglit_add_executable (arb_direct_state_access-texture-params texture-params.c)
 piglit_add_executable (arb_direct_state_access-copytexturesubimage 
copytexturesubimage.c)
 piglit_add_executable (arb_direct_state_access-texture-errors texture-errors.c)
+piglit_add_executable (arb_direct_state_access-get-textures get-textures.c)
+piglit_add_executable (arb_direct_state_access-gettextureimage-formats 
gettextureimage-formats.c)
+piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
gettextureimage-luminance.c)
+piglit_add_executable (arb_direct_state_access-gettextureimage-simple 
gettextureimage-simple.c)
+piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
gettextureimage-targets.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/get-textures.c 
b/tests/spec/arb_direct_state_access/get-textures.c
new file mode 100644
index 000..95d5bc4
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/get-textures.c
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2014 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 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.
+ */
+
+/** @file get-textures.c
+ *
+ * Tests glGetTextureImage to see if it behaves in the expected way,
+ * throwing the correct errors, etc.
+ 

[Piglit] [PATCH 20/24] arb_direct_state_access: Added test for glTextureBuffer.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
 .../spec/arb_direct_state_access/texture-buffer.c  | 106 +
 3 files changed, 108 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/texture-buffer.c

diff --git a/tests/all.py b/tests/all.py
index 0ec4f5f..aa7ffd8 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4325,6 +4325,7 @@ 
spec['ARB_direct_state_access']['gettextureimage-targets'] = PiglitGLTest('arb_d
 spec['ARB_direct_state_access']['compressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-compressedtextureimage 
GL_COMPRESSED_RGBA_FXT1_3DFX', run_concurrent=True)
 spec['ARB_direct_state_access']['getcompressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-getcompressedtextureimage', 
run_concurrent=True)
 spec['ARB_direct_state_access']['texture-storage-multisample'] = 
PiglitGLTest('arb_direct_state_access-texture-storage-multisample', 
run_concurrent=True)
+spec['ARB_direct_state_access']['texture-buffer'] = 
PiglitGLTest('arb_direct_state_access-texture-buffer', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index e7ca144..2af268b 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -26,4 +26,5 @@ piglit_add_executable 
(arb_direct_state_access-gettextureimage-targets gettextur
 piglit_add_executable (arb_direct_state_access-compressedtextureimage 
compressedtextureimage.c)
 piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c)
 piglit_add_executable (arb_direct_state_access-texture-storage-multisample 
texture-storage-multisample.c)
+piglit_add_executable (arb_direct_state_access-texture-buffer texture-buffer.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/texture-buffer.c 
b/tests/spec/arb_direct_state_access/texture-buffer.c
new file mode 100644
index 000..1246071
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/texture-buffer.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright © 2013, 2014 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 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.
+ */
+
+/** @file texture-buffer.c
+ *
+ * Tests that glBufferData() synchronizes correctly with TBO rendering.
+ *
+ * Caught a bug in the i965 driver after a core Mesa refactor.
+ *
+ * Adapted to test glTextureBuffer by Laura Ekstrand (December 2014).
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+   config.supports_gl_compat_version = 10;
+   config.supports_gl_core_version = 31;
+
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE |
+  PIGLIT_GL_VISUAL_RGBA;
+PIGLIT_GL_TEST_CONFIG_END
+
+enum piglit_result
+piglit_display(void)
+{
+   static const char *vs_source =
+   #version 140\n
+   in vec4 piglit_vertex;\n
+   void main()\n
+   {\n
+  gl_Position = piglit_vertex;\n
+   }\n;
+
+   static const char *fs_source =
+   #version 140\n
+   uniform samplerBuffer s;\n
+   void main()\n
+   {\n
+  gl_FragColor = texelFetch(s, 0);\n
+   }\n;
+
+   bool pass = true;
+   GLuint tex, bo;
+   GLuint prog;
+   float green[] = {0, 1, 0, 0};
+   float blue[] =  {0, 0, 1, 0};
+   uint8_t g_rgba8[] = {0x00, 0xff, 0x00, 0x00};
+   uint8_t b_rgba8[] = {0x00, 0x00, 0xff, 0x00};
+
+   prog = piglit_build_simple_program(vs_source, fs_source);
+   glUseProgram(prog);
+
+   glGenBuffers(1, bo);
+   glBindBuffer(GL_TEXTURE_BUFFER, bo);
+   glBufferData(GL_TEXTURE_BUFFER, 

[Piglit] [PATCH 23/24] arb_texture_storage_multisample: Updated error conditions to match the OpenGL 4.5 and ES 3.1 core specs.

2014-12-15 Thread Laura Ekstrand
---
 .../arb_texture_storage_multisample/tex-param.c| 86 ++
 1 file changed, 55 insertions(+), 31 deletions(-)

diff --git a/tests/spec/arb_texture_storage_multisample/tex-param.c 
b/tests/spec/arb_texture_storage_multisample/tex-param.c
index 06f1783..9b52fb5 100644
--- a/tests/spec/arb_texture_storage_multisample/tex-param.c
+++ b/tests/spec/arb_texture_storage_multisample/tex-param.c
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2013 Chris Forbes
+ * Copyright 2014 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the Software),
@@ -26,17 +27,34 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
config.supports_gl_compat_version = 30;
 
-   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+  PIGLIT_GL_VISUAL_DOUBLE;
 
 PIGLIT_GL_TEST_CONFIG_END
 
 /* Exercises GetTexParameter/TexParameter with multisample textures */
 
-enum piglit_result
-piglit_display(void)
-{
-   return PIGLIT_FAIL;
-}
+/* In Section 8.11 Texture Queries, the OpenGL 4.5 core spec (30.10.2014)
+ * says:
+ * An INVALID_ENUM error is generated if the effective target is either
+ * TEXTURE_2D_MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY, and pname is
+ * any sampler state from table 23.18.
+ *
+ * An INVALID_OPERATION error is generated if the effective target is
+ * either TEXTURE_2D_MULTISAMPLE or TEXTURE_2D_MULTISAMPLE_ARRAY, and
+ * pname TEXTURE_BASE_LEVEL is set to a value other than zero.
+ *
+ * Likewise, Section 8.10 Texture Queries of the OpenGL ES 3.1 spec
+ * (29.10.2014) says:
+ *
+ * An INVALID_ENUM error is generated if target is
+ * TEXTURE_2D_MULTISAMPLE, and pname is any sampler state from table
+ * 20.11.
+ *
+ * An INVALID_OPERATION error is generated if target is
+ * TEXTURE_2D_MULTISAMPLE, and pname TEXTURE_BASE_LEVEL is set to a
+ * value other than zero.
+ */
 
 struct subtest
 {
@@ -50,29 +68,23 @@ struct subtest
/* readonly */
{ GL_TEXTURE_IMMUTABLE_FORMAT, GL_FALSE, GL_TRUE, GL_INVALID_ENUM },
 
-   /* sampler state from GL4.2 core spec, table 6.18 -- readonly, and 
generate
-* INVALID_OPERATION
-*/
-   { GL_TEXTURE_MAG_FILTER, GL_NEAREST, GL_LINEAR, GL_INVALID_OPERATION },
-   { GL_TEXTURE_MIN_FILTER, GL_NEAREST, GL_LINEAR, GL_INVALID_OPERATION },
-   { GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_INVALID_OPERATION 
},
-   { GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_INVALID_OPERATION 
},
-   { GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_INVALID_OPERATION 
},
-   { GL_TEXTURE_COMPARE_MODE, GL_NONE, GL_COMPARE_REF_TO_TEXTURE, 
GL_INVALID_OPERATION },
-   { GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL, GL_ALWAYS, GL_INVALID_OPERATION },
-   { GL_TEXTURE_MIN_LOD, -1000, 0, GL_INVALID_OPERATION },
-   { GL_TEXTURE_MAX_LOD, 1000, 0, GL_INVALID_OPERATION },
-
-   /* setting TEXTURE_BASE_LEVEL to a nonzero value produces 
INVALID_OPERATION;
-* setting to a zero value is allowed
-*/
+   { GL_TEXTURE_MAG_FILTER, GL_NEAREST, GL_LINEAR, GL_INVALID_ENUM },
+   { GL_TEXTURE_MIN_FILTER, GL_NEAREST, GL_LINEAR, GL_INVALID_ENUM },
+   { GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_INVALID_ENUM },
+   { GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_INVALID_ENUM },
+   { GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_INVALID_ENUM },
+   { GL_TEXTURE_COMPARE_MODE, GL_NONE, GL_COMPARE_REF_TO_TEXTURE, 
GL_INVALID_ENUM },
+   { GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL, GL_ALWAYS, GL_INVALID_ENUM },
+   { GL_TEXTURE_MIN_LOD, -1000, 0, GL_INVALID_ENUM },
+   { GL_TEXTURE_MAX_LOD, 1000, 0, GL_INVALID_ENUM },
+
{ GL_TEXTURE_BASE_LEVEL, 0, 0, GL_NO_ERROR, GL_TEXTURE_BASE_LEVEL 
zero },
{ GL_TEXTURE_BASE_LEVEL, 0, 1, GL_INVALID_OPERATION, 
GL_TEXTURE_BASE_LEVEL nonzero },
 
{ 0 } /* sentinel */
 };
 
-void
+enum piglit_result
 check_subtest(struct subtest *t)
 {
GLint val;
@@ -84,7 +96,7 @@ check_subtest(struct subtest *t)
if (!piglit_check_gl_error(GL_NO_ERROR)) {
printf(GetTexParameteriv failed\n);
piglit_report_subtest_result(PIGLIT_FAIL, %s, test_name);
-   return;
+   return PIGLIT_FAIL;
}
 
if (t-initial_value != val) {
@@ -93,7 +105,7 @@ check_subtest(struct subtest *t)
   t-initial_value,
   val);
piglit_report_subtest_result(PIGLIT_FAIL, %s, test_name);
-   return;
+   return PIGLIT_FAIL;
}
 
glTexParameteri(GL_TEXTURE_2D_MULTISAMPLE, t-param, t-value);
@@ -102,7 +114,7 @@ check_subtest(struct subtest *t)
printf(error setting parameter %s\n,
   

[Piglit] [PATCH 15/24] arb_direct_state_access: Most error checking for TextureParameter functions

2014-12-15 Thread Laura Ekstrand
From: Dylan Baker dylanx.c.ba...@intel.com

This covers all cases except the:
GL_INVALID_ENUM is generated if params should have a defined constant
value (based on the value of pname) and does not.
case.

arb_direct_state_access: Fixed minor nits in texture-errors.c.
---
 .../spec/arb_direct_state_access/texture-errors.c  | 235 -
 1 file changed, 231 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texture-errors.c 
b/tests/spec/arb_direct_state_access/texture-errors.c
index 78bccac..6bbf9c7 100644
--- a/tests/spec/arb_direct_state_access/texture-errors.c
+++ b/tests/spec/arb_direct_state_access/texture-errors.c
@@ -27,7 +27,7 @@
  * @file
  * Adapted from teximage-errors.c to test ARB_direct_state_access by
  * Laura Ekstrand la...@jlekstrand.net.
- * Tests glTextureSubImage functions for invalid values, error reporting.
+ * Tests gl*Texture* functions for error reporting.
  */
 
 #include piglit-util-gl.h
@@ -103,7 +103,7 @@ test_pos_and_sizes(void)
return pass;
 }
 
-/* 
+/*
  * The texture parameter must be an existing texture object as returned
  * by glCreateTextures
  */
@@ -226,16 +226,243 @@ test_pname(void)
return pass;
 }
 
+/* GL_INVALID_ENUM is generated if glTextureParamter{if} is called for a
+ * non-scalar parameter
+ */
+static bool
+test_scalar_vector(void)
+{
+   bool pass = true;
+   const static GLfloat f = 1.0;
+   const static GLint i = -1;
+   static GLuint name;
+
+   /* Setup dsa. */
+   glCreateTextures(GL_TEXTURE_2D, 1, name);
+   glBindTextureUnit(0, name); /* Since next command isn't bindless. */
+
+   glTextureParameteri(name, GL_TEXTURE_BORDER_COLOR, i);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterf(name, GL_TEXTURE_BORDER_COLOR, f);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
+   glTextureParameter{if}: GL_INVALID_ENUM for non-scalars);
+   return pass;
+}
+
+/* GL_INVALID_ENUM is generated if the effective target is either
+ * GL_TEXTURE_2D_MULTISAMPLE or GL_TEXTURE_2D_MULTISAMPLE_ARRAY, and pname is
+ * any of the sampler states.
+ */
+/* XXX: Is this actually a valid implementation? */
+static bool
+test_multisample(void)
+{
+   bool pass = true;
+   static GLfloat f = 1.0;
+   static GLint i = -1;
+   static const GLfloat fvec[2] = { 1.0, -1.0 };
+   static const GLint ivec[2] = { 1, -1 };
+   static const GLuint uvec[2] = { 1, 4 };
+   static GLuint name;
+
+   /* GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
+   glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, name);
+   glBindTextureUnit(0, name); /* Since next command isn't bindless. */
+
+   glTextureParameteri(name, GL_TEXTURE_WRAP_R, i);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterf(name, GL_TEXTURE_WRAP_R, f);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterfv(name, GL_TEXTURE_WRAP_R, fvec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameteriv(name, GL_TEXTURE_WRAP_R, ivec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterIiv(name, GL_TEXTURE_WRAP_R, ivec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterIuiv(name, GL_TEXTURE_WRAP_R, uvec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   /* GL_TEXTURE_2D_MULTISAMPLE */
+   glDeleteTextures(1, name);
+   glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, name);
+   glBindTextureUnit(0, name); /* Since next command isn't bindless. */
+
+   glTextureParameteri(name, GL_TEXTURE_WRAP_R, i);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterf(name, GL_TEXTURE_WRAP_R, f);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterfv(name, GL_TEXTURE_WRAP_R, fvec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameteriv(name, GL_TEXTURE_WRAP_R, ivec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterIiv(name, GL_TEXTURE_WRAP_R, ivec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glTextureParameterIuiv(name, GL_TEXTURE_WRAP_R, uvec);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
+   glTextureParameter: GL_INVALID_ENUM if multisample+sampler 
state);
+   return pass;
+}
+
+/* GL_INVALID_ENUM is generated if the effective target is GL_TEXTURE_RECTANGLE
+ * and either of pnames GL_TEXTURE_WRAP_S or GL_TEXTURE_WRAP_T is set to either
+ * GL_MIRROR_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT or GL_REPEAT.
+ */
+static bool
+test_texture_rec(void)
+{
+   bool pass = true;
+   static GLuint name;
+
+   /* GL_TEXTURE_2D_MULTISAMPLE_ARRAY */
+   

[Piglit] [PATCH 17/24] arb_direct_state_access: Using glTextureStorage2DMultisample for something not completely trivial.

2014-12-15 Thread Laura Ekstrand
---
 .../texture-storage-multisample.c  | 98 --
 1 file changed, 93 insertions(+), 5 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texture-storage-multisample.c 
b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
index 4840c02..f069245 100644
--- a/tests/spec/arb_direct_state_access/texture-storage-multisample.c
+++ b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
@@ -34,13 +34,14 @@
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.supports_gl_compat_version = 30;
+   config.supports_gl_compat_version = 13;
 
config.window_visual = PIGLIT_GL_VISUAL_RGBA |
   PIGLIT_GL_VISUAL_DOUBLE;
 
 PIGLIT_GL_TEST_CONFIG_END
 
+/* This has the modelview matrix built in. */
 static const char multisample_texture_vs_source[] =
 #version 130\n
 in vec2 vertex;\n
@@ -67,10 +68,11 @@ static const char multisample_texture_fs_source[] =
 
 /**
  * Uploads an arbitrary multisample texture.
+ * TODO: Make this part of Mesa meta?
  *
  * This function acts like glTexSub*Image for multisample textures.
  * For the texture given, it assumes that glTexImage[23]DMultisample or
- * glTex*Storage[23]DMultisample has already been called to establish the 
+ * glTex*Storage[23]DMultisample has already been called to establish the
  * storage.
  *
  * When this function returns, multisample texture will be bound to the
@@ -89,6 +91,8 @@ static const char multisample_texture_fs_source[] =
  * \param format format of the pixel data
  * \param type   type of the pixel data
  * \param data   pixel data with which to fill the texture
+ *  You need data for each sample.  The samples should be
+ *  specified in depth.
  *
  */
 void
@@ -101,7 +105,7 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
static GLuint prog = 0;
static GLint tex_loc, tex_depth_loc, z_loc;
static GLuint fbo, array_tex;
-   static const float verts[] = {
+   static const float verts[] = { /* Two triangles for the texture */
0.0, 0.0,
0.0, 1.0,
1.0, 1.0,
@@ -126,8 +130,10 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
 
if (target == GL_TEXTURE_2D_MULTISAMPLE) {
assert(depth == 1);
-   } else if (target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
-   } else {
+   }
+   else if (target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
+   }
+   else {
assert(!Invalid texture target);
return;
}
@@ -161,15 +167,19 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
glGetBooleanv(GL_SAMPLE_SHADING_ARB, backup.arb_sample_shading);
glGetFloatv(GL_MIN_SAMPLE_SHADING_VALUE_ARB, 
backup.min_sample_shading);
 
+   /* This ensures that copying is done on a per-sample basis rather than
+* the default per-pixel basis. */
glEnable(GL_SAMPLE_SHADING_ARB);
glMinSampleShadingARB(1.0f);
 
+   /* Load the data into a texture for drawing. */
glBindTexture(GL_TEXTURE_2D_ARRAY, array_tex);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, internalFormat, width, height,
 depth * samples, 0, format, type, data);
 
+   /* Bind the special FBO and attach our texture to it. */
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo);
glViewport(0, 0, width, height);
 
@@ -182,6 +192,9 @@ texture_sub_image_multisample(GLenum tex, GLenum target,
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, verts);
 
+   /* When we call draw arrays, the data (in array_tex) will get drawn
+* into our texture (in tex) because it's attached to
+* the framebuffer. */
if (target == GL_TEXTURE_2D_MULTISAMPLE) {
glUniform1i(z_loc, 0);
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER,
@@ -311,12 +324,85 @@ check_immutable(void)
return pass;
 }
 
+static bool
+draw_multisampled(void)
+{
+   bool pass = true;
+   GLuint texture, fbo;
+   int x, y, z, idx;
+   int samples = 2;
+   float sample_mult;
+
+   /* Make a texture of size piglit_width x piglit_height that is divided
+* into two triangles by a diagonal (\) line. (Use \ rather than /
+* because texture_sub_image_multisample uses /.) */
+   /* TODO: Do spatial anti-aliasing rather than blending. */
+   GLubyte* data = malloc(4 * samples * piglit_width * piglit_height *
+  sizeof(GLubyte));
+   float m = ((float) piglit_height / piglit_width);
+   for (z = 0; z  samples; ++z) {
+   for (y = 0; y  piglit_height; ++y) {
+   for (x = 0; x  piglit_width; 

[Piglit] [PATCH 08/24] arb_direct_state_access: Added tests for glGetTexLevelParameterfv to texture-storage.c

2014-12-15 Thread Laura Ekstrand
---
 .../spec/arb_direct_state_access/texture-storage.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/tests/spec/arb_direct_state_access/texture-storage.c 
b/tests/spec/arb_direct_state_access/texture-storage.c
index 5838146..16bd39d 100644
--- a/tests/spec/arb_direct_state_access/texture-storage.c
+++ b/tests/spec/arb_direct_state_access/texture-storage.c
@@ -325,6 +325,7 @@ test_2d_mipmap_rendering(void)
GLuint tex;
GLint width = 128, height = 64, levels = 8;
GLint v, l;
+   GLfloat vfloat;
 
glCreateTextures(GL_TEXTURE_2D, 1, tex);
glBindTextureUnit(0, tex);
@@ -358,6 +359,27 @@ test_2d_mipmap_rendering(void)
return false;
}
 
+
+   /* Added to test glGetTextureLevelParameterfv */
+   glGetTextureLevelParameterfv(tex, l, GL_TEXTURE_WIDTH,
+vfloat);
+   if (vfloat != (GLfloat) width) {
+   printf(%s: level %d: bad width: %.2f, 
+  should be %.2f\n,
+   TestName, l, vfloat, (GLfloat) width);
+   return false;
+   }
+
+   glGetTextureLevelParameterfv(tex, l, GL_TEXTURE_HEIGHT,
+vfloat);
+   if (vfloat != (GLfloat) height) {
+   printf(%s: level %d: bad height: %.2f, 
+  should be %.2f\n,
+   TestName, l, vfloat, (GLfloat) height);
+   return false;
+   }
+
+
if (width  1)
width /= 2;
if (height  1)
-- 
2.1.0

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


[Piglit] [PATCH 18/24] arb_direct_state_access: Testing glTextureStorage3DMultisample.

2014-12-15 Thread Laura Ekstrand
---
 .../texture-storage-multisample.c  | 59 ++
 1 file changed, 59 insertions(+)

diff --git a/tests/spec/arb_direct_state_access/texture-storage-multisample.c 
b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
index f069245..f0437d4 100644
--- a/tests/spec/arb_direct_state_access/texture-storage-multisample.c
+++ b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
@@ -246,6 +246,8 @@ check_non_generated_texture(void)
 */
glTextureStorage2DMultisample(250, 4, GL_RGBA8, 64, 64, GL_TRUE);
pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+   glTextureStorage3DMultisample(250, 4, GL_RGBA8, 64, 64, 3, GL_TRUE);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
 
piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
non-generated texture name);
@@ -383,6 +385,7 @@ draw_multisampled(void)
  0, 0, piglit_width, piglit_height,
  GL_COLOR_BUFFER_BIT, GL_LINEAR);
pass = piglit_check_gl_error(GL_NO_ERROR);
+   /* TODO: Add a Piglit probe call to check the output */
if (!piglit_automatic) {
piglit_present_results();
}
@@ -395,6 +398,58 @@ draw_multisampled(void)
return pass;
 }
 
+static bool
+trivial_but_should_work(void)
+{
+   bool pass = true;
+   GLuint texture;
+
+   /* 2D case */
+   glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, texture);
+   glTextureStorage2DMultisample(texture, 4, GL_RGBA8, 64, 64, GL_TRUE);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+
+   /* 3D case */
+   glDeleteTextures(1, texture);
+   glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, texture);
+   glTextureStorage3DMultisample(texture, 4, GL_RGBA8, 64, 64, 3,
+ GL_TRUE);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+
+   piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
+trivial, but should work);
+   return pass;
+}
+
+static bool
+check_improper_effective_target(void)
+{
+   bool pass = true;
+   GLuint texture;
+
+   /* 3D case with 2D target */
+   glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, texture);
+   glTextureStorage3DMultisample(texture, 4, GL_RGBA8, 64, 64, 3,
+ GL_TRUE);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+
+   /* 2D case with 3D target */
+   glDeleteTextures(1, texture);
+   glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 1, texture);
+   glTextureStorage2DMultisample(texture, 4, GL_RGBA8, 64, 64, GL_TRUE);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+
+   /* 2D case with non-multisampled target */
+   glDeleteTextures(1, texture);
+   glCreateTextures(GL_TEXTURE_2D, 1, texture);
+   glTextureStorage2DMultisample(texture, 4, GL_RGBA8, 64, 64, GL_TRUE);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+
+   piglit_report_subtest_result(pass ? PIGLIT_PASS : PIGLIT_FAIL,
+improper effective target);
+   return pass;
+}
+
 void
 piglit_init(int argc, char **argv)
 {
@@ -415,6 +470,10 @@ piglit_display(void)
result = PIGLIT_FAIL;
if (!check_unsized_format())
result = PIGLIT_FAIL;
+   if (!check_improper_effective_target())
+   result = PIGLIT_FAIL;
+   if (!trivial_but_should_work())
+   result = PIGLIT_FAIL;
if (!draw_multisampled())
result = PIGLIT_FAIL;
 
-- 
2.1.0

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


[Piglit] [PATCH 04/24] arb_direct_state_access: Added glCreateTextures test.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |  1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |  1 +
 .../spec/arb_direct_state_access/create-textures.c | 80 ++
 3 files changed, 82 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/create-textures.c

diff --git a/tests/all.py b/tests/all.py
index e371c2b..838bf2d 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4310,6 +4310,7 @@ spec['ARB_direct_state_access'] = {}
 spec['ARB_direct_state_access']['dsa-textures'] = 
PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)
 spec['ARB_direct_state_access']['texturesubimage'] = 
PiglitGLTest('arb_direct_state_access-texturesubimage', run_concurrent=True)
 spec['ARB_direct_state_access']['bind-texture-unit'] = 
PiglitGLTest('arb_direct_state_access-bind-texture-unit', run_concurrent=True)
+spec['ARB_direct_state_access']['create-textures'] = 
PiglitGLTest('arb_direct_state_access-create-textures', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index f45269f..6f50230 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -12,4 +12,5 @@ link_libraries (
 piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
dsa-utils.c)
 piglit_add_executable (arb_direct_state_access-dsa-texturesubimage 
texturesubimage.c)
 piglit_add_executable (arb_direct_state_access-bind-texture-unit 
bind-texture-unit.c)
+piglit_add_executable (arb_direct_state_access-create-textures 
create-textures.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/create-textures.c 
b/tests/spec/arb_direct_state_access/create-textures.c
new file mode 100644
index 000..a01be79
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/create-textures.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2014 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 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.
+ */
+
+/** @file create_textures.c
+ *
+ * Tests glCreateTextures to see if it behaves in the expected way,
+ * throwing the correct errors, etc.
+ */
+
+#include piglit-util-gl.h
+#include dsa-utils.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension(GL_ARB_direct_state_access);
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   GLuint name;
+
+   /* Throw some invalid inputs at glCreateTextures. */
+
+   /* Invalid (not a target) */
+   glCreateTextures(GL_INVALID_ENUM, 1, name);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   /* Invalid (not supported) target */
+   glCreateTextures(GL_PROXY_TEXTURE_2D, 1, name);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   /* n is negative */
+   glCreateTextures(GL_TEXTURE_2D, -1, name);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
+
+   /* name is not a valid pointer */
+   glCreateTextures(GL_TEXTURE_2D, 1, 0);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+   glCreateTextures(GL_TEXTURE_2D, 1, NULL);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+
+   /* Trivial, but should work. */
+   glCreateTextures(GL_TEXTURE_2D, 1, name);
+   pass = piglit_check_gl_error(GL_NO_ERROR);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
-- 
2.1.0

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


[Piglit] [PATCH 19/24] arb_direct_state_access: Added test for glCompressedTextureSubImage1D.

2014-12-15 Thread Laura Ekstrand
---
 .../arb_direct_state_access/getcompressedtextureimage.c   | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c 
b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
index abbffcf..7d6aba8 100644
--- a/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
+++ b/tests/spec/arb_direct_state_access/getcompressedtextureimage.c
@@ -411,6 +411,21 @@ piglit_display(void)
result = PIGLIT_FAIL;
}
 
+   /* 1D targets can't be compressed in Mesa right now,
+* but here is a trivial test for the entry point. */
+   glCompressedTextureSubImage1D(250, 0, 0, 60,
+ internalformat, 60*4*8,
+ NULL);
+
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION)) /* Bad texture */
+   subtest = PIGLIT_FAIL;
+   else
+   subtest = PIGLIT_PASS;
+   piglit_report_subtest_result(subtest, Compressed Texture
+ Sub Image 1D);
+   if (subtest == PIGLIT_FAIL)
+   result = PIGLIT_FAIL;
+
free(data);
 
return result;
-- 
2.1.0

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


[Piglit] [PATCH 14/24] arb_direct_state_access: Add additional error checking for *TextureParameter

2014-12-15 Thread Laura Ekstrand
From: Dylan Baker dylanx.c.ba...@intel.com

This adds checking for additional types of errors.
---
 .../spec/arb_direct_state_access/texture-errors.c  | 244 ++---
 1 file changed, 159 insertions(+), 85 deletions(-)

diff --git a/tests/spec/arb_direct_state_access/texture-errors.c 
b/tests/spec/arb_direct_state_access/texture-errors.c
index db587ff..78bccac 100644
--- a/tests/spec/arb_direct_state_access/texture-errors.c
+++ b/tests/spec/arb_direct_state_access/texture-errors.c
@@ -41,129 +41,203 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 PIGLIT_GL_TEST_CONFIG_END
 
 /** Test texture size errors and subtexture position errors */
-static GLboolean
+static bool
 test_pos_and_sizes(void)
 {
-   GLuint name;
+   bool pass = true;
+   GLuint name;
 
-   /* all of these should generate GL_INVALID_VALUE */
+   /* all of these should generate GL_INVALID_VALUE */
+   glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, -16, 0, GL_RGBA, GL_FLOAT, 
NULL);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, -16, 0, GL_RGBA, GL_FLOAT, NULL);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, -6, -5, 0, GL_RGBA, GL_FLOAT, 
NULL);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, -6, -5, 0, GL_RGBA, GL_FLOAT, NULL);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   glTexImage2D(GL_TEXTURE_2D, -2, GL_RGBA, 16, 16, 0, GL_RGBA, GL_FLOAT, 
NULL);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glTexImage2D(GL_TEXTURE_2D, -2, GL_RGBA, 16, 16, 0, GL_RGBA, GL_FLOAT, 
NULL);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   glTexImage2D(GL_TEXTURE_2D, 2000, GL_RGBA, 16, 16, 0, GL_RGBA, 
GL_FLOAT, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glTexImage2D(GL_TEXTURE_2D, 2000, GL_RGBA, 16, 16, 0, GL_RGBA, GL_FLOAT, 
NULL);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   /* Setup dsa. */
+   glCreateTextures(GL_TEXTURE_2D, 1, name);
+   glBindTextureUnit(0, name); /* Since next command isn't bindless. */
 
-   /* Setup dsa. */
-   glCreateTextures(GL_TEXTURE_2D, 1, name);
-   glBindTextureUnit(0, name); /* Since next command isn't bindless. */
+   /* setup valid 2D texture for subsequent TexSubImage calls */
+   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_FLOAT, 
NULL);
 
-   /* setup valid 2D texture for subsequent TexSubImage calls */
-   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_FLOAT, NULL);
+   glTextureSubImage2D(name, 0, 6, 6, 100, 100, GL_RGBA, GL_FLOAT, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glTextureSubImage2D(name, 0, 6, 6, 100, 100, GL_RGBA, GL_FLOAT, NULL);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   glTextureSubImage2D(name, 0, -6, -6, 10, 10, GL_RGBA, GL_FLOAT, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glTextureSubImage2D(name, 0, -6, -6, 10, 10, GL_RGBA, GL_FLOAT, NULL);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   glCopyTextureSubImage2D(name, 0, -6, -6, 2, 2, 10, 10);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
+   glCopyTextureSubImage2D(name, 0, 6, 6, 2, 2, 200, 200);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
 
-   glCopyTextureSubImage2D(name, 0, -6, -6, 2, 2, 10, 10);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   /* mipmap level 1 doesn't exist */
+   glTextureSubImage2D(name, 1, 0, 0, 8, 8, GL_RGBA, GL_FLOAT, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
 
-   glCopyTextureSubImage2D(name, 0, 6, 6, 2, 2, 200, 200);
-   if (!piglit_check_gl_error(GL_INVALID_VALUE))
-  return GL_FALSE;
+   /* mipmap level 2 doesn't exist */
+   glCopyTextureSubImage2D(name, 2, 0, 0, 0, 0, 4, 4);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
 
-   /* mipmap level 1 doesn't exist */
-   glTextureSubImage2D(name, 1, 0, 0, 8, 8, GL_RGBA, GL_FLOAT, NULL);
-   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
-  return GL_FALSE;
+   /* To test 1D and 3D entry points, let's try using the wrong functions. 
*/
+   glTextureSubImage1D(name, 0, 0, 4, GL_RGBA, GL_FLOAT, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
 
-   /* mipmap level 2 doesn't exist */
-   glCopyTextureSubImage2D(name, 2, 0, 0, 0, 0, 4, 4);
-   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
-  return GL_FALSE;
+   glTextureSubImage3D(name, 0, 0, 0, 0, 4, 4, 4, GL_RGBA, GL_FLOAT, NULL);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
 
-   /* To test 1D and 3D entry points, let's try using the wrong functions. */
-   glTextureSubImage1D(name, 0, 0, 4, GL_RGBA, GL_FLOAT, NULL);
-   if 

[Piglit] [PATCH 09/24] arb_direct_state_access: Added tests for CopyTextureSubImage*D.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   2 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   2 +
 .../arb_direct_state_access/copytexturesubimage.c  | 293 +
 .../spec/arb_direct_state_access/texture-errors.c  | 134 ++
 4 files changed, 431 insertions(+)
 create mode 100644 tests/spec/arb_direct_state_access/copytexturesubimage.c
 create mode 100644 tests/spec/arb_direct_state_access/texture-errors.c

diff --git a/tests/all.py b/tests/all.py
index 3804cb6..48ec09f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4314,6 +4314,8 @@ spec['ARB_direct_state_access']['create-textures'] = 
PiglitGLTest('arb_direct_st
 spec['ARB_direct_state_access']['texture-storage'] = 
PiglitGLTest('arb_direct_state_access-texture-storage', run_concurrent=True)
 spec['ARB_direct_state_access']['texunits'] = 
PiglitGLTest('arb_direct_state_access-texunits', run_concurrent=True)
 spec['ARB_direct_state_access']['texture-params'] = 
PiglitGLTest('arb_direct_state_access-texture-params', run_concurrent=True)
+spec['ARB_direct_state_access']['copytexturesubimage'] = 
PiglitGLTest('arb_direct_state_access-copytexturesubimage', run_concurrent=True)
+spec['ARB_direct_state_access']['texture-errors'] = 
PiglitGLTest('arb_direct_state_access-texture-errors', run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 1b24701..4f8f49f 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -16,4 +16,6 @@ piglit_add_executable 
(arb_direct_state_access-create-textures create-textures.c
 piglit_add_executable (arb_direct_state_access-texture-storage 
texture-storage.c)
 piglit_add_executable (arb_direct_state_access-texunits texunits.c)
 piglit_add_executable (arb_direct_state_access-texture-params texture-params.c)
+piglit_add_executable (arb_direct_state_access-copytexturesubimage 
copytexturesubimage.c)
+piglit_add_executable (arb_direct_state_access-texture-errors texture-errors.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/copytexturesubimage.c 
b/tests/spec/arb_direct_state_access/copytexturesubimage.c
new file mode 100644
index 000..818257d
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/copytexturesubimage.c
@@ -0,0 +1,293 @@
+/*
+ * Copyright © 2008 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 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.
+ *
+ * Authors:
+ *Eric Anholt e...@anholt.net
+ *
+ *Laura Ekstrand la...@jlekstrand.net adapted this for testing
+ *CopyTextureSubImage* from ARB_direct_state_access.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_width = 200;
+   config.window_height = 200;
+   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+/** Should GL_TEXTURE_RECTANGLE_ARB be tested? */
+int have_rect = 0;
+
+/** Should non-power-of-two textures be tested? */
+int have_NPOT = 0;
+
+static void rect(int x1, int y1, int x2, int y2)
+{
+   glBegin(GL_POLYGON);
+   glVertex2f(x1, y1);
+   glVertex2f(x1, y2);
+   glVertex2f(x2, y2);
+   glVertex2f(x2, y1);
+   glEnd();
+}
+static GLboolean inrect(int x, int y, int x1, int y1, int x2, int y2)
+{
+   if (x = x1  x  x2  y = y1  y  y2)
+   return GL_TRUE;
+   else
+   return GL_FALSE;
+}
+
+static GLboolean
+check_results(int dstx, int dsty, int w, int h)
+{
+   GLfloat *results;
+   GLboolean pass = GL_TRUE;
+   int x, y;
+
+   results = malloc(w * h * 4 * sizeof(GLfloat));
+
+   /* Check the results */
+   glReadPixels(dstx, dsty, w, h, GL_RGBA, GL_FLOAT, results);
+   for 

[Piglit] [PATCH 12/24] arb_direct_state_access: Add tests for non-generated texture object names passed to glTextureParameter.

2014-12-15 Thread Laura Ekstrand
From: Dylan Baker dylanx.c.ba...@intel.com

glTextureParameter requires that the texture argument be an OpenGL-generated
texture name, such as one provided by glCreateTextures, or it should raise
an GL_INVALID_OPERATION error.
---
 .../spec/arb_direct_state_access/texture-errors.c  | 42 +-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_direct_state_access/texture-errors.c 
b/tests/spec/arb_direct_state_access/texture-errors.c
index bcaa6b2..db587ff 100644
--- a/tests/spec/arb_direct_state_access/texture-errors.c
+++ b/tests/spec/arb_direct_state_access/texture-errors.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2010 VMware, Inc.
+ * Copyright (c) 2014 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the Software),
@@ -117,11 +118,50 @@ test_pos_and_sizes(void)
return GL_TRUE;
 }
 
+/* 
+ * The texture parameter must be an existing texture object as returned
+ * by glCreateTextures
+ */
+static GLboolean
+test_sizes(void)
+{
+   const GLuint badname = 250;
+   const GLfloat fvec[] = {1.0, 1.0};
+   const GLint ivec[] = {-1, 1};
+   const GLuint uvec[] = {1, 1};
+
+   glTextureParameteri(badname, GL_TEXTURE_MAX_LEVEL, 4);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  return GL_FALSE;
+
+   glTextureParameterf(badname, GL_TEXTURE_MAX_LEVEL, 4.0);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  return GL_FALSE;
+
+   glTextureParameterfv(badname, GL_TEXTURE_MAX_LEVEL, fvec);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  return GL_FALSE;
+
+   glTextureParameteriv(badname, GL_TEXTURE_MAX_LEVEL, ivec);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  return GL_FALSE;
+
+   glTextureParameterIiv(badname, GL_TEXTURE_MAX_LEVEL, ivec);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  return GL_FALSE;
+
+   glTextureParameterIuiv(badname, GL_TEXTURE_MAX_LEVEL, uvec);
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+  return GL_FALSE;
+
+   return GL_TRUE;
+}
+
 enum piglit_result
 piglit_display(void)
 {
bool pass = true;
-   pass = test_pos_and_sizes()  pass;
+   pass = test_pos_and_sizes()  test_sizes()  pass;
 
return pass ? PIGLIT_PASS: PIGLIT_FAIL;
 }
-- 
2.1.0

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


[Piglit] [PATCH 13/24] arb_direct_state_access: Modified gettexture-image-formats.c to test glGenerateTextureMipmap.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py | 1 +
 tests/spec/arb_direct_state_access/gettextureimage-formats.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index b79ae8b..6d20035 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4318,6 +4318,7 @@ spec['ARB_direct_state_access']['copytexturesubimage'] = 
PiglitGLTest('arb_direc
 spec['ARB_direct_state_access']['texture-errors'] = 
PiglitGLTest('arb_direct_state_access-texture-errors', run_concurrent=True)
 spec['ARB_direct_state_access']['get-textures'] = 
PiglitGLTest('arb_direct_state_access-get-textures', run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-formats'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-formats', 
run_concurrent=True)
+spec['ARB_direct_state_access']['gettextureimage-formats'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-formats 
init-by-rendering', run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-luminance'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-luminance', 
run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-simple'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-simple', 
run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-targets'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-targets', 
run_concurrent=True)
diff --git a/tests/spec/arb_direct_state_access/gettextureimage-formats.c 
b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
index a22d235..e2d637c 100644
--- a/tests/spec/arb_direct_state_access/gettextureimage-formats.c
+++ b/tests/spec/arb_direct_state_access/gettextureimage-formats.c
@@ -110,7 +110,7 @@ make_texture_image(GLenum intFormat, GLubyte 
upperRightTexel[4])
 
glWindowPos2iARB(0, 0);
glDrawPixels(TEX_SIZE, TEX_SIZE, GL_RGBA, GL_UNSIGNED_BYTE, 
tex);
-   glGenerateMipmap(GL_TEXTURE_2D);
+   glGenerateTextureMipmap(texture_id);
 
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
glDeleteFramebuffers(1, fb);
@@ -139,7 +139,6 @@ ubyte_to_float(GLubyte b, GLint bits)
 }
 
 
-
 static GLfloat
 bits_to_tolerance(GLint bits, GLboolean compressed)
 {
-- 
2.1.0

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


[Piglit] [PATCH 11/24] arb_direct_state_access: Added tests for glGetCompressedTextureImage.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   3 +-
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   2 +
 .../compressedtextureimage.c   | 288 ++
 .../getcompressedtextureimage.c| 418 +
 tests/util/piglit-util-gl.c|   2 +-
 tests/util/piglit-util-gl.h|   1 +
 6 files changed, 712 insertions(+), 2 deletions(-)
 create mode 100644 tests/spec/arb_direct_state_access/compressedtextureimage.c
 create mode 100644 
tests/spec/arb_direct_state_access/getcompressedtextureimage.c

diff --git a/tests/all.py b/tests/all.py
index 8dfb5ac..b79ae8b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4321,7 +4321,8 @@ 
spec['ARB_direct_state_access']['gettextureimage-formats'] = PiglitGLTest('arb_d
 spec['ARB_direct_state_access']['gettextureimage-luminance'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-luminance', 
run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-simple'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-simple', 
run_concurrent=True)
 spec['ARB_direct_state_access']['gettextureimage-targets'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-targets', 
run_concurrent=True)
-
+spec['ARB_direct_state_access']['compressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-compressedtextureimage 
GL_COMPRESSED_RGBA_FXT1_3DFX', run_concurrent=True)
+spec['ARB_direct_state_access']['getcompressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-getcompressedtextureimage', 
run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index d5a496e..4e80a99 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -23,4 +23,6 @@ piglit_add_executable 
(arb_direct_state_access-gettextureimage-formats gettextur
 piglit_add_executable (arb_direct_state_access-gettextureimage-luminance 
gettextureimage-luminance.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-simple 
gettextureimage-simple.c)
 piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
gettextureimage-targets.c)
+piglit_add_executable (arb_direct_state_access-compressedtextureimage 
compressedtextureimage.c)
+piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/compressedtextureimage.c 
b/tests/spec/arb_direct_state_access/compressedtextureimage.c
new file mode 100644
index 000..d8875b6
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/compressedtextureimage.c
@@ -0,0 +1,288 @@
+/*
+ * Copyright © 2011 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 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.
+ */
+
+/** @file compressedtextureimage.c
+ *
+ * Tests that fetching and uploading compressed texture data works
+ * correctly.
+ *
+ * The other compressed texture tests are about decoding of data that
+ * was uploaded from uncompressed, while this tries a round-trip after
+ * the initial upload, testing glGetCompressedTexImage() and
+ * glCompressedTexImage2D().
+ *
+ * Adapted for testing glGetCompressedTextureImage in ARB_direct_state_access
+ * by Laura Ekstrand la...@jlekstrand.net, November 2014.
+ */
+
+#include piglit-util-gl.h
+
+#define SIZE 128
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 10;
+
+   config.window_width = (SIZE*2)+60;
+   config.window_height = SIZE+20;
+   config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+struct format {
+   const char *name;
+   GLenum token;
+   const char **extension;
+};
+
+static struct format 

[Piglit] [PATCH 24/24] ext_packed_float: Refactored the getteximage-invalid-format-for-packed-type.c test.

2014-12-15 Thread Laura Ekstrand
I added comments and refactored the test into a newer Piglit style.  This
helped me diagnose some difficulties with Mesa's glGetTextureImage
implementation.
---
 .../getteximage-invalid-format-for-packed-type.c   | 105 +
 1 file changed, 64 insertions(+), 41 deletions(-)

diff --git 
a/tests/spec/ext_packed_float/getteximage-invalid-format-for-packed-type.c 
b/tests/spec/ext_packed_float/getteximage-invalid-format-for-packed-type.c
index 05fa006..c030c1c 100644
--- a/tests/spec/ext_packed_float/getteximage-invalid-format-for-packed-type.c
+++ b/tests/spec/ext_packed_float/getteximage-invalid-format-for-packed-type.c
@@ -24,19 +24,22 @@
  */
 
 /**
- * file 
tests/spec/ext_packed_float/getteximage-invalid-format-for-packed-type.c
- * test with some invalid type when the format is not GL_RGB.
+ * @file ext_packed_float/getteximage-invalid-format-for-packed-type.c
  *
- * Page 262 (page 282 of the PDF) of the OpenGL 4.2 Compatibility
- * Profile spec says:
+ * Section 8.4.4.2 Special Interpretations in Section 8.4 Pixel Rectangles of
+ * the OpenGL 4.5 core spec (30.10.2014) says:
  *
- * The number of components per packed pixel is fixed by the
- * type, and must match the number of components per group
- * indicated by the format parameter, as listed in table 3.8.
- * The error INVALID_OPERATION is generated by any command
- * processing pixel rectangles if a mismatch occurs.
+ * A type matching one of the types in table 8.5 is a special case in
+ * which all the components of each group are packed into a single
+ * unsigned byte, unsigned short, or unsigned int, depending on the
+ * type
+ * The number of components per packed pixel is fixed by the type, and
+ * must match the number of components per group indicated by the format
+ * parameter, as listed in table 8.5.
+ * An INVALID_OPERATION error is generated by any command
+ * processing pixel rectangles if a mismatch occurs.
  *
- * Table 3.8 says:
+ * Table 8.5 Packed pixel formats:
  *
  *type Parameter Token Name  ...  Matching Pixel Formats
  * UNSIGNED_BYTE_3_3_2  RGB, RGB_INTEGER
@@ -60,8 +63,8 @@
  * UNSIGNED_INT_2_10_10_10_REV  RGBA, BGRA, RGBA_INTEGER,
  *  BGRA_INTEGER
  * UNSIGNED_INT_24_8DEPTH_STENCIL
- * UNSIGNED_INT_10F_11F_11F_REV RGB, RGB_INTEGER
- * UNSIGNED_INT_5_9_9_9_REV RGB, RGB_INTEGER
+ * UNSIGNED_INT_10F_11F_11F_REV RGB
+ * UNSIGNED_INT_5_9_9_9_REV RGB
  * FLOAT_32_UNSIGNED_INT_24_8_REV   DEPTH_STENCIL
  *
  *
@@ -77,6 +80,16 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
+/* For simplicity, we are only testing the following types: */
+static const GLenum testedTypes[] = {
+   GL_UNSIGNED_BYTE_3_3_2,
+   GL_UNSIGNED_BYTE_2_3_3_REV,
+   GL_UNSIGNED_SHORT_5_6_5,
+   GL_UNSIGNED_SHORT_5_6_5_REV,
+   GL_UNSIGNED_INT_10F_11F_11F_REV,
+};
+
+/* As Table 8.5 states, our testedTypes[] only work with GL_RGB below. */
 static const GLenum formatTypes[] = {
GL_RGBA,
GL_RGB,
@@ -88,44 +101,54 @@ static const GLenum formatTypes[] = {
GL_LUMINANCE_ALPHA,
 };
 
-static const GLenum testedTypes[] = {
-   GL_UNSIGNED_BYTE_3_3_2,
-   GL_UNSIGNED_BYTE_2_3_3_REV,
-   GL_UNSIGNED_SHORT_5_6_5,
-   GL_UNSIGNED_SHORT_5_6_5_REV,
-   GL_UNSIGNED_INT_10F_11F_11F_REV,
-};
-
+void
+piglit_init(int argc, char **argv)
+{
+   piglit_require_extension(GL_EXT_packed_float);
+}
 
 enum piglit_result
-piglit_display(void)
+subtest(GLenum format, GLenum type)
 {
-   return PIGLIT_FAIL;
-}
+   GLfloat pxBuffer[4];
+   enum piglit_result result;
 
+   glGetTexImage(GL_TEXTURE_2D, 0, format, type, pxBuffer);
+   if (format == GL_RGB) {
+   if (!piglit_check_gl_error(GL_NO_ERROR))
+   result = PIGLIT_FAIL;
+   else
+   result = PIGLIT_PASS;
+   }
+   else {
+   if (!piglit_check_gl_error(GL_INVALID_OPERATION))
+   result = PIGLIT_FAIL;
+   else
+   result = PIGLIT_PASS;
+   }
 
-void
-piglit_init(int argc, char **argv)
+   piglit_report_subtest_result(result, %s, %s,
+   piglit_get_gl_enum_name(type),
+   piglit_get_gl_enum_name(format));
+
+   return result;
+}
+
+enum piglit_result
+piglit_display(void)
 {
-   long rcvError, expError = GL_NO_ERROR;
-   GLfloat pxBuffer[4];
int i, j;
-
-   piglit_require_extension(GL_EXT_packed_float);
+   enum piglit_result result = PIGLIT_PASS;
+   enum piglit_result subtest_result;
 
for (j = 0; j  ARRAY_SIZE(testedTypes); j++) {
-   for (i = 0; i ARRAY_SIZE(formatTypes); i++) {
-   glGetTexImage(GL_TEXTURE_2D, 0, formatTypes[i],
- testedTypes[j], 

[Piglit] [PATCH 22/24] arb_texture_rectangle: Updated error conditions to match the OpenGL 4.5 and ES 3.1 core specs.

2014-12-15 Thread Laura Ekstrand
---
 .../texture-base-level-error.c | 35 +++---
 1 file changed, 31 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_texture_rectangle/texture-base-level-error.c 
b/tests/spec/arb_texture_rectangle/texture-base-level-error.c
index 7a20f93..6c8ba56 100644
--- a/tests/spec/arb_texture_rectangle/texture-base-level-error.c
+++ b/tests/spec/arb_texture_rectangle/texture-base-level-error.c
@@ -1,5 +1,5 @@
 /**
- * Copyright © 2013 Intel Corporation
+ * Copyright © 2014 Intel Corporation
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the Software),
@@ -25,6 +25,22 @@
  * Test that when target is TEXTURE_RECTANGLE, the correct error messages are
  * generated when certain texture parameter values are specified.
  *
+ * Section 8.10 (Texture Parameters) of the OpenGL 4.5 Core spec (30.10.2014)
+ * says:
+ * An INVALID_ENUM error is generated if the effective target is
+ * TEXTURE_RECTANGLE and either of pnames TEXTURE_WRAP_S or
+ * TEXTURE_WRAP_T is set to either MIRROR_CLAMP_TO_EDGE , MIRRORED_REPEAT
+ * or REPEAT.
+ *
+ * An INVALID_ENUM error is generated if the effective target is
+ * TEXTURE_RECTANGLE and pname TEXTURE_MIN_FILTER is set to a value other
+ * than NEAREST or LINEAR (no mipmap filtering is permitted).
+ *
+ * An INVALID_OPERATION error is generated if the effective target is
+ * TEXTURE_RECTANGLE and pname TEXTURE_BASE_LEVEL is set to any value
+ * other than zero.
+ *
+ * Note that the third error condition above directly conflicts with what
  * Section 3.8.8(Texture Parameters) of OpenGL 3.3 Core says:
  *
  * When target is TEXTURE_RECTANGLE, certain texture parameter values may
@@ -35,6 +51,17 @@
  * mipmap filtering is permitted). The error INVALID_VALUE is generated if
  * TEXTURE_BASE_LEVEL is set to any value other than zero.
  *
+ * This conflict is resolved in favor of the GL 4.5 spec because the OpenGL ES
+ * 3.1 spec (Section 8.10, Texture Queries, 29.10.2014) says:
+ *
+ * An INVALID_OPERATION error is generated if target is
+ * TEXTURE_2D_MULTISAMPLE, and pname TEXTURE_BASE_LEVEL is set to a
+ * value other than zero.
+ *
+ * Therefore, the change from INVALID_VALUE to INVALID_OPERATION moves OpenGL
+ * toward improved consistency.
+ *
+ *
  * The GL_ATI_texture_mirror_repeat_once spec is silent on the topic of
  * rectangle textures, but GL_ARB_texture_mirror_clamp_to_edge says:
  *
@@ -120,11 +147,11 @@ piglit_init(int argc, char **argv)
pass = piglit_check_gl_error(GL_INVALID_ENUM)  pass;
}
 
-   /* The error INVALID_VALUE is generated if TEXTURE_BASE_LEVEL is set
-* to any value other than zero.
+   /* The error INVALID_OPERATION is generated if TEXTURE_BASE_LEVEL is
+* set to any value other than zero.
 */
glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_BASE_LEVEL, 37);
-   pass = piglit_check_gl_error(GL_INVALID_VALUE)  pass;
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION)  pass;
 
piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
 }
-- 
2.1.0

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


[Piglit] [PATCH 16/24] arb_direct_state_access: Added a test for glTextureStorage2DMultisample.

2014-12-15 Thread Laura Ekstrand
---
 tests/all.py   |   1 +
 .../spec/arb_direct_state_access/CMakeLists.gl.txt |   1 +
 .../texture-storage-multisample.c  | 334 +
 3 files changed, 336 insertions(+)
 create mode 100644 
tests/spec/arb_direct_state_access/texture-storage-multisample.c

diff --git a/tests/all.py b/tests/all.py
index 6d20035..0ec4f5f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4324,6 +4324,7 @@ spec['ARB_direct_state_access']['gettextureimage-simple'] 
= PiglitGLTest('arb_di
 spec['ARB_direct_state_access']['gettextureimage-targets'] = 
PiglitGLTest('arb_direct_state_access-gettextureimage-targets', 
run_concurrent=True)
 spec['ARB_direct_state_access']['compressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-compressedtextureimage 
GL_COMPRESSED_RGBA_FXT1_3DFX', run_concurrent=True)
 spec['ARB_direct_state_access']['getcompressedtextureimage'] = 
PiglitGLTest('arb_direct_state_access-getcompressedtextureimage', 
run_concurrent=True)
+spec['ARB_direct_state_access']['texture-storage-multisample'] = 
PiglitGLTest('arb_direct_state_access-texture-storage-multisample', 
run_concurrent=True)
 
 profile.tests['hiz'] = hiz
 profile.tests['fast_color_clear'] = fast_color_clear
diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
index 4e80a99..e7ca144 100644
--- a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
+++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
@@ -25,4 +25,5 @@ piglit_add_executable 
(arb_direct_state_access-gettextureimage-simple gettexture
 piglit_add_executable (arb_direct_state_access-gettextureimage-targets 
gettextureimage-targets.c)
 piglit_add_executable (arb_direct_state_access-compressedtextureimage 
compressedtextureimage.c)
 piglit_add_executable (arb_direct_state_access-getcompressedtextureimage 
getcompressedtextureimage.c)
+piglit_add_executable (arb_direct_state_access-texture-storage-multisample 
texture-storage-multisample.c)
 # vim: ft=cmake:
diff --git a/tests/spec/arb_direct_state_access/texture-storage-multisample.c 
b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
new file mode 100644
index 000..4840c02
--- /dev/null
+++ b/tests/spec/arb_direct_state_access/texture-storage-multisample.c
@@ -0,0 +1,334 @@
+/*
+ * Copyright © 2013 Chris Forbes
+ * Copyright 2014 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 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.
+ */
+
+/** @file texture-storage-multisample.c
+ *
+ * Based on arb_texture_storage_multisample/tex-storage.c by Chris Forbes and
+ * piglit_multisample_texture in piglit_util_gl.c by Jason Ekstrand.
+ * Adapted to test glTextureStorage2DMultisample and
+ * glTextureStorage3DMultisample by Laura Ekstrand (la...@jlekstrand.net).
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 30;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+  PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char multisample_texture_vs_source[] =
+#version 130\n
+in vec2 vertex;\n
+out vec2 tex_coords;\n
+void main()\n
+{\n
+  tex_coords = vertex;\n
+  vec2 pos = (vertex.xy * 2) - vec2(1, 1);\n
+  gl_Position = vec4(pos, 0, 1);\n
+}\n;
+
+static const char multisample_texture_fs_source[] =
+#version 130\n
+#extension GL_ARB_sample_shading : enable\n
+in vec2 tex_coords;\n
+uniform sampler2DArray tex;\n
+uniform int tex_depth;\n
+uniform int z;\n
+void main()\n
+{\n
+  int layer = (gl_SampleID * tex_depth) + z;\n
+  gl_FragColor = texture(tex, vec3(tex_coords, layer));\n
+}\n;
+
+/**
+ * Uploads an arbitrary multisample texture.
+ *
+ * This function acts like glTexSub*Image for multisample textures.
+ * For the texture given, it assumes that glTexImage[23]DMultisample or
+ * glTex*Storage[23]DMultisample has already 

[Piglit] [PATCH 21/24] general: Testing really basic texture errors.

2014-12-15 Thread Laura Ekstrand
Tests errors thrown by glGenTextures, glBindTexture, and glDeleteTextures.
Oddly enough, these didn't seem to be tested elsewhere.
---
 tests/all.py|  1 +
 tests/general/CMakeLists.gl.txt |  1 +
 tests/general/tex-errors.c  | 74 +
 3 files changed, 76 insertions(+)
 create mode 100644 tests/general/tex-errors.c

diff --git a/tests/all.py b/tests/all.py
index aa7ffd8..94f4b82 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1020,6 +1020,7 @@ spec['!OpenGL 
4.2/required-renderbuffer-attachment-formats'] = PiglitGLTest('gl-
 spec['!OpenGL 4.2/required-sized-texture-formats'] = 
PiglitGLTest('gl-3.0-required-sized-texture-formats 42', run_concurrent=True)
 spec['!OpenGL 4.2/required-texture-attachment-formats'] = 
PiglitGLTest('gl-3.0-required-texture-attachment-formats 42', 
run_concurrent=True)
 spec['!OpenGL 4.4/gl-max-vertex-attrib-stride'] = 
PiglitGLTest('gl-4.4-max_vertex_attrib_stride', run_concurrent=True)
+spec['!OpenGL 4.4/tex-errors'] = PiglitGLTest('tex-errors', 
run_concurrent=True)
 
 # Group spec/glsl-es-1.00
 spec['glsl-es-1.00'] = {}
diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
index cf34097..4224c06 100644
--- a/tests/general/CMakeLists.gl.txt
+++ b/tests/general/CMakeLists.gl.txt
@@ -111,6 +111,7 @@ piglit_add_executable (stencil-drawpixels 
stencil-drawpixels.c)
 piglit_add_executable (stencil-twoside stencil-twoside.c)
 piglit_add_executable (stencil-wrap stencil-wrap.c)
 piglit_add_executable (sync_api sync_api.c)
+piglit_add_executable (tex-errors tex-errors.c)
 piglit_add_executable (texgen texgen.c)
 piglit_add_executable (texunits texunits.c)
 piglit_add_executable (timer_query timer_query.c)
diff --git a/tests/general/tex-errors.c b/tests/general/tex-errors.c
new file mode 100644
index 000..c63007a
--- /dev/null
+++ b/tests/general/tex-errors.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2014 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 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.
+ */
+
+/** @file tex-errors.c
+ *
+ * Checks to see if *Tex* functions throw the correct errors. This is not
+ * exhaustive since some *Tex* errors are covered elsewhere.
+ */
+
+#include piglit-util-gl.h
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 13;
+
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
+   PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+void
+piglit_init(int argc, char **argv)
+{
+
+}
+
+enum piglit_result
+piglit_display(void)
+{
+   bool pass = true;
+   GLuint name;
+
+   /* n is negative */
+   glGenTextures(-1, name);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
+
+   glGenTextures(1, name);
+   /* Not a valid target */
+   glBindTexture(GL_INVALID_ENUM, name);
+   pass = piglit_check_gl_error(GL_INVALID_ENUM);
+
+   glBindTexture(GL_TEXTURE_2D, name);
+   glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, 4, 5);
+   /* Wrong dimensionality. */
+   glBindTexture(GL_TEXTURE_1D, name);
+   pass = piglit_check_gl_error(GL_INVALID_OPERATION);
+
+   /* n is negative */
+   glDeleteTextures(-1, name);
+   pass = piglit_check_gl_error(GL_INVALID_VALUE);
+
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
+}
+
-- 
2.1.0

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


[Piglit] [PATCH] arb_copy_image-targets: Add comments to silence Coverity defects.

2014-12-15 Thread Vinson Lee
Silence Coverity missing break in switch defects.

Signed-off-by: Vinson Lee v...@freedesktop.org
---
 tests/spec/arb_copy_image/targets.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/arb_copy_image/targets.c 
b/tests/spec/arb_copy_image/targets.c
index 86edeca..333631c 100644
--- a/tests/spec/arb_copy_image/targets.c
+++ b/tests/spec/arb_copy_image/targets.c
@@ -65,12 +65,14 @@ image_init(struct image *image, GLenum target, int width, 
int height, int depth)
switch (target) {
case GL_TEXTURE_CUBE_MAP:
assert(depth == 6);
+   /* Fall through. */
case GL_TEXTURE_CUBE_MAP_ARRAY_ARB:
assert(width == height);
assert(depth % 6 == 0);
break;
case GL_TEXTURE_1D:
assert(height == 1);
+   /* Fall through. */
case GL_TEXTURE_2D:
case GL_TEXTURE_RECTANGLE:
assert(depth == 1);
-- 
1.9.1

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


Re: [Piglit] [PATCH 3/4] utils: add initial WAFFLE_WGL support

2014-12-15 Thread Emil Velikov
On 15 December 2014 at 23:24, Dave Airlie airl...@gmail.com wrote:
 On 16 December 2014 at 07:57, Emil Velikov emil.l.veli...@gmail.com wrote:
 On 15/12/14 20:56, Jason Ekstrand wrote:


 On Fri, Nov 21, 2014 at 11:52 AM, Emil Velikov emil.l.veli...@gmail.com
 mailto:emil.l.veli...@gmail.com wrote:

 This will allow us to use waffle with its upcoming WGL support for
 Windows. With that done, the final step to removing glut is to convert
 piglit to use waffle for MacOS.

 Current implementation does not have input handling/event loop, and as
 such one needs to pass -auto when running individual tests, otherwise
 the test will abort after being displayed for 8 seconds.

 Waffle 1.5.0 is the first version that has WGL support.


 Do we need anything from 1.5.0 besides WGL?  If not, can we only require
 1.5.0 if we're on windows and continue only requiring 1.3.0 on linux?  I
 ask because I very much enjoy just using the fedora packages for waffle
 which are at 1.3 (fedora 21) and 1.4 (rawhide).
 Either way I would highly encourage you to get away from 1.3.x and move
 to 1.4.x or 1.5.x. Installing it in a custom prefix should work, yet
 I've not tried it personally.

 I'll be ok with dropping the version requirement but I'd rather do that
 as Dylan's latest patch hits the ML/master.

 Can we get a stable 1.5.0 release tarball somewhere?

 Using github for tarballs isn't useful for distros since they move
 stuff around every month or so.

Seems like Chad missed Cc-ing the piglit ML this time in the Waffle
Announce email [1].

And here is the stable link as requested:
http://www.waffle-gl.org/files/release/waffle-1.5.0/waffle-1.5.0.tar.xz


Cheers,
Emil

[1] http://lists.freedesktop.org/archives/waffle/2014-December/000803.html
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl-deriv-varyings: Added checks for derivatives on parameters with negative or abs modifiers

2014-12-15 Thread Matt Turner
On Mon, Dec 15, 2014 at 5:01 PM, Vinson Lee v...@freedesktop.org wrote:
 On Mon, Dec 15, 2014 at 11:05 AM, Matt Turner matts...@gmail.com wrote:
 Reviewed-by: Matt Turner matts...@gmail.com
 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit


 This patch introduced two GCC warnings.

 glsl-deriv-varyings.c:108:20: warning: ‘fragShaderText4’ defined but
 not used [-Wunused-variable]
  static const char *fragShaderText4 =
 ^
 glsl-deriv-varyings.c:118:20: warning: ‘fragShaderText5’ defined but
 not used [-Wunused-variable]
  static const char *fragShaderText5 =
 ^

Whoops, thanks Vinson. That's a pretty bad oops :)

I'll take care of it.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 01/24] arb_direct_state_access: DSA 2D Textures hello world test.

2014-12-15 Thread Chris Forbes
Did you mean to leave the non-DSA nvidia workaround in here? I
understand this might have been useful for getting it working
initially, but... if their driver is broken, it's broken.

On Tue, Dec 16, 2014 at 2:24 PM, Laura Ekstrand la...@jlekstrand.net wrote:
 Dylan Baker: all.py: Add dsa tests.
 ---
  tests/all.py   |   2 +
  tests/spec/CMakeLists.txt  |   1 +
  .../spec/arb_direct_state_access/CMakeLists.gl.txt |  13 +++
  tests/spec/arb_direct_state_access/CMakeLists.txt  |   1 +
  tests/spec/arb_direct_state_access/dsa-textures.c  | 123 
 +
  tests/spec/arb_direct_state_access/dsa-utils.c |  79 +
  tests/spec/arb_direct_state_access/dsa-utils.h |  51 +
  7 files changed, 270 insertions(+)
  create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.gl.txt
  create mode 100644 tests/spec/arb_direct_state_access/CMakeLists.txt
  create mode 100644 tests/spec/arb_direct_state_access/dsa-textures.c
  create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.c
  create mode 100644 tests/spec/arb_direct_state_access/dsa-utils.h

 diff --git a/tests/all.py b/tests/all.py
 index cfbe529..84639c2 100644
 --- a/tests/all.py
 +++ b/tests/all.py
 @@ -4306,6 +4306,8 @@ add_shader_test_dir(arb_derivative_control,
  import_glsl_parser_tests(arb_derivative_control,
   testsDir + '/spec/arb_derivative_control', [''])

 +spec['ARB_direct_state_access'] = {}
 +spec['ARB_direct_state_access']['dsa-textures'] = 
 PiglitGLTest('arb_direct_state_access-dsa-textures', run_concurrent=True)

  profile.tests['hiz'] = hiz
  profile.tests['fast_color_clear'] = fast_color_clear
 diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
 index dfd822b..697b00d 100644
 --- a/tests/spec/CMakeLists.txt
 +++ b/tests/spec/CMakeLists.txt
 @@ -114,3 +114,4 @@ add_subdirectory (arb_blend_func_extended)
  add_subdirectory (ext_unpack_subimage)
  add_subdirectory (arb_vertex_array_object)
  add_subdirectory (oes_texture_float)
 +add_subdirectory (arb_direct_state_access)
 diff --git a/tests/spec/arb_direct_state_access/CMakeLists.gl.txt 
 b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 new file mode 100644
 index 000..cb0f7da
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/CMakeLists.gl.txt
 @@ -0,0 +1,13 @@
 +include_directories(
 +   ${GLEXT_INCLUDE_DIR}
 +   ${OPENGL_INCLUDE_PATH}
 +)
 +
 +link_libraries (
 +   piglitutil_${piglit_target_api}
 +   ${OPENGL_gl_LIBRARY}
 +   ${OPENGL_glu_LIBRARY}
 +)
 +
 +piglit_add_executable (arb_direct_state_access-dsa-textures dsa-textures.c 
 dsa-utils.c)
 +# vim: ft=cmake:
 diff --git a/tests/spec/arb_direct_state_access/CMakeLists.txt 
 b/tests/spec/arb_direct_state_access/CMakeLists.txt
 new file mode 100644
 index 000..144a306
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/CMakeLists.txt
 @@ -0,0 +1 @@
 +piglit_include_target_api()
 diff --git a/tests/spec/arb_direct_state_access/dsa-textures.c 
 b/tests/spec/arb_direct_state_access/dsa-textures.c
 new file mode 100644
 index 000..468d23e
 --- /dev/null
 +++ b/tests/spec/arb_direct_state_access/dsa-textures.c
 @@ -0,0 +1,123 @@
 +/*
 + * Copyright 2014 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 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.
 + */
 +
 +/** @file dsa-textures.c
 + *
 + * Tests the direct state access functionality for creating, initializing, 
 and
 + * rendering texture objects.
 + */
 +#include piglit-util-gl.h
 +#include dsa-utils.h
 +
 +#include stdlib.h
 +
 +static const char* glversion;
 +static bool nv340_23; /* Are we using the NVIDIA 340.23 driver? */
 +
 +PIGLIT_GL_TEST_CONFIG_BEGIN
 +
 +   config.supports_gl_compat_version = 13;
 +
 +   config.window_visual = PIGLIT_GL_VISUAL_RGBA |
 +   PIGLIT_GL_VISUAL_DOUBLE;
 +
 +PIGLIT_GL_TEST_CONFIG_END
 +

Re: [Piglit] [PATCH] glsl-deriv-varyings: Added checks for derivatives on parameters with negative or abs modifiers

2014-12-15 Thread Matt Turner
On Mon, Dec 15, 2014 at 7:11 PM, Matt Turner matts...@gmail.com wrote:
 On Mon, Dec 15, 2014 at 5:01 PM, Vinson Lee v...@freedesktop.org wrote:
 On Mon, Dec 15, 2014 at 11:05 AM, Matt Turner matts...@gmail.com wrote:
 Reviewed-by: Matt Turner matts...@gmail.com
 ___
 Piglit mailing list
 Piglit@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/piglit


 This patch introduced two GCC warnings.

 glsl-deriv-varyings.c:108:20: warning: ‘fragShaderText4’ defined but
 not used [-Wunused-variable]
  static const char *fragShaderText4 =
 ^
 glsl-deriv-varyings.c:118:20: warning: ‘fragShaderText5’ defined but
 not used [-Wunused-variable]
  static const char *fragShaderText5 =
 ^

 Whoops, thanks Vinson. That's a pretty bad oops :)

 I'll take care of it.

I fixed the glShaderSource() calls and the missing ) in
fragShaderText5, but the fifth shader doesn't pass. From a quick
glance, it's not clear why. Andres?
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] fbo-blit-scaled-linear: Use const reference.

2014-12-15 Thread Jose Fonseca
Looks good.

From: Piglit piglit-boun...@lists.freedesktop.org on behalf of Vinson Lee 
v...@freedesktop.org
Sent: 16 December 2014 01:17
To: piglit@lists.freedesktop.org
Subject: [Piglit] [PATCH] fbo-blit-scaled-linear: Use const reference.

Fix Coverity big parameter passed by value defect.

Signed-off-by: Vinson Lee v...@freedesktop.org
---
 tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp 
b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
index c972586..336a962 100644
--- a/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
+++ b/tests/spec/arb_framebuffer_object/blit-scaled-linear.cpp
@@ -203,7 +203,7 @@ piglit_init(int argc, char **argv)
}
 }

-bool test_blit_scaled_linear(Fbo fbo_test)
+bool test_blit_scaled_linear(const Fbo fbo_test)
 {
GLfloat scale;
GLint samples;
--
1.9.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_piglitd=AAIGaQc=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEsr=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzEm=0Nnh8fdvZl_xZv4bQo4IoppmgSilhU_TATCX3NtkbW8s=UCHGVbwXhB0-mviJrCrX4Hfa4KlFWJ3TgiHiVOy3dZwe=
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit