[waffle] [PULL] WGL support

2014-11-09 Thread Emil Velikov
Hello Chad,

As mentioned earlier here is a rebase of all the wgl work so far on top 
of origin/master.

NOTE: The origin/master branch lacks the first patch in the series, yet 
it is present in origin/next. I would suspect that other patches may be
in such state but I haven't checked.

What's new:

- Patch 06/53: wgl: implement display management

Drop "we use the root GL context as a fallback context in 
waffle_get_proc_address..." from the commit message.

- Patch 08/53: wgl: wire-up waffle_get_proc_address()

No more ABI/API break. Infortunatelly this does not give us any
additional cleanups, as we still need to have a GL context in order to 
choose the config... lovely WGL.

- Patch 13/53: wgl: provide static GLES* symbols (dlsym) via opengl32.dll

The name says it all, this handles the second ABI/API break that I had 
initially and is now withdrawn.

- Patch 46/53: cmake: Set default location for all artifacts to top-level 
directories

Version 2 of your patch, updated to work under Windows. There is no 
rpath in there so one needs to put the dll (considered RUNTIME object) 
alongside the executables that use it.

- Patch 47/53: cmake: ensure waffle-static name differs from the shared one

Or there will be name collision with the shared waffle objects and 
all hell will break loose.


- Patch 48/53: wflinfo: call get_proc_address after make_current

- Patches 49-53/53 are some spelling/grammar fixes.


And a pull request below, considering there aren't any issues with 
the series

Thank
Emil

P.S. Handling multiple locations where the waffle version number is 
stored is going to be a pain in the a** when releasing waffle. Any 
ideas how to handle it ?


The following changes since commit 
f16fe1afaa0ecca217d5f90d9f2255ffd570f63a:

  Merge branch 'maint-1.4' (2014-11-08 11:50:52 -0800)

are available in the git repository at:

  https://github.com/evelikov/waffle.git for-chad/wgl-pull

for you to fetch changes up to 8afea079f19ce86e209b5e61158d8890ad187b03:

  man: spelling fix (2014-11-09 22:44:09 +)


Emil Velikov (53):
  cmake: include the CPACK module
  pkg/archlinux: add mingw-w64-waffle package
  README: Add notes when building Waffle for Windows.
  wgl: add skeleton implementation
  wgl: fill up the dl_* hooks
  wgl: implement display management
  wgl: wire-up wgl_window and wgl_config hooks
  wgl: wire-up waffle_get_proc_address()
  wgl: add context hooks
  wgl: check for various WGL extensions and fetch their funcptrs
  wgl: use wglChoosePixelFormatARB when available
  wgl: fully support ARB_create_context and EXT_create_context_es_profile.
  wgl: provide static GLES* symbols (dlsym) via opengl32.dll
  cmake: set most compiler flags/defines in a single location
  cmake: drop the waffle library prefix on Windows
  wgl: restrict exported symbols via module-definition file
  wgl: avoid using container_of and DEFINE_CONTAINER_CAST_FUNC macros
  tests: do not force gcc compiler flags onto msvc
  tests/gl_basic_test: don't include posix headers when building for win32
  core: wcore_error_unittest include c99_compat.h
  examples/gl_basic: use native sleep functions
  core: use compiler specific (noreturn) attribute
  examples/gl_basic: use compiler specific (noreturn) attribute
  utils/wflinfo: use compiler specific (noreturn) attribute
  examples/simple-x11-egl: properly annotate the function pointers
  examples/gl_basic: properly annotate the function pointers
  utils/wflinfo: properly annotate the function pointers
  tests/gl_basic_test: properly annotate the function pointers
  utils/wflinfo: use define to provide buffer length
  utils/wflinfo: wrap if (glHamSandwich() != GL_NO_ERROR ||...) in curly 
brackets
  examples/gl_basic: move variable declaration before code
  waffle_test: introduce TEST_RUN2 macro
  test/gl_basic_test: add all_gl_rgb(a) tests
  test/gl_basic_test: use all_gl_(10-21) tests for all platforms
  test/gl_basic_test: introduce linux_gl(30_core - 43_compat) tests
  test/gl_basic_test: introduce linux_gles* tests
  test/gl_basic_test: deduplicate gl_(debug,fwdcompat) tests
  test/gl_basic_test: add PLATFORM_WGL support/tests
  test/gl_basic_test: implement windows version for run_testsuite()
  cmake: misc fixes and cleanups
  wgl: strings.h does not exist in MSVC
  core: silence MSVC compiler warning
  wgl: use correct dtor in wgl_window_priv_create error path
  core/tests: correctly store the threads exit codes
  core/tests: silence the final MSVC warning
  cmake: Set default location for all artifacts to top-level directories
  cmake: ensure waffle-static name differs from the shared one
  wflinfo: call get_proc_address after make_current
  README: spelling fixes
  wgl: s/glX/wgl/ in error message
  README: 

[waffle] [PATCH 06/53] wgl: implement display management

2014-11-09 Thread Emil Velikov
Unlike GLX and EGL, WGL(Windows) does not have the concept of a display
in the sense used in waffle.

The 'root primitive' for WGL is a window with it's device context
which encapsulates the properties and capabilities of the device
doing the actual rendering (CPU or GPU).

As such we first need to create a unique window class that will be
used for all waffle windows, and then create the 'root' window.

The windows itself is disabled (cannot grab the input) and of zero
width and height.

While we're here make sure that we create a context, which will be
needed in a variety of cases - when we query the WGL extensions,
choose the config ...

v2: Bail out if we're using the GDI renderer.
v3: Zero-initialise pfd and explicitly set its required parameters.
v4: No not mention waffle_get_proc_address in commit msg.

Signed-off-by: Emil Velikov 
Reviewed-by: Chad Versace 
---
 src/waffle/wgl/wgl_display.c  | 112 +-
 src/waffle/wgl/wgl_display.h  |   5 ++
 src/waffle/wgl/wgl_platform.c |  41 
 src/waffle/wgl/wgl_platform.h |   3 ++
 4 files changed, 159 insertions(+), 2 deletions(-)

diff --git a/src/waffle/wgl/wgl_display.c b/src/waffle/wgl/wgl_display.c
index a51e538..c2cab1c 100644
--- a/src/waffle/wgl/wgl_display.c
+++ b/src/waffle/wgl/wgl_display.c
@@ -25,25 +25,117 @@
 
 
 #include 
+#include 
+#include 
 
 #include "wcore_error.h"
 
 #include "wgl_display.h"
+#include "wgl_dl.h"
+#include "wgl_platform.h"
 
 bool
 wgl_display_destroy(struct wcore_display *wc_self)
 {
 struct wgl_display *self = wgl_display(wc_self);
-bool ok;
+bool ok = true;
 
 if (!self)
 return true;
 
-ok = wcore_display_teardown(wc_self);
+if (self->hWnd) {
+if (self->hglrc) {
+ok &= wglDeleteContext(self->hglrc);
+}
+
+if (self->hDC)
+ok &= ReleaseDC(self->hWnd, self->hDC);
+
+ok &= DestroyWindow(self->hWnd);
+}
+
+ok &= wcore_display_teardown(wc_self);
 free(self);
 return ok;
 }
 
+static bool
+wgl_display_create_window(struct wgl_platform *plat, struct wgl_display *dpy)
+{
+dpy->hWnd = CreateWindow(plat->class_name, NULL,
+ WS_POPUPWINDOW|WS_DISABLED,
+ 0, 0, 0, 0, NULL, NULL, NULL, NULL);
+if (!dpy->hWnd)
+return false;
+
+dpy->hDC = GetDC(dpy->hWnd);
+if (!dpy->hDC)
+return false;
+
+return true;
+}
+
+static bool
+wgl_display_choose_config(struct wgl_display *dpy)
+{
+// XXX: Is there a move common/appropriate pixelformat ?
+PIXELFORMATDESCRIPTOR pfd = {0};
+bool ok;
+
+pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
+pfd.nVersion = 1;
+
+pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER;
+
+pfd.iPixelType = PFD_TYPE_RGBA;
+pfd.iLayerType = PFD_MAIN_PLANE;
+pfd.cColorBits = 32;
+pfd.cDepthBits = 16;
+
+dpy->pixel_format = ChoosePixelFormat(dpy->hDC, &pfd);
+if (!dpy->pixel_format)
+return false;
+
+ok = SetPixelFormat(dpy->hDC, dpy->pixel_format, &pfd);
+if (!ok)
+return false;
+
+return true;
+}
+
+static bool
+wgl_display_hardware_render(struct wgl_display *dpy)
+{
+#ifndef GL_RENDERER
+#define GL_RENDERER 0x1F01
+#endif
+typedef unsigned int GLenum;
+typedef unsigned char GLubyte;
+typedef const GLubyte * (__stdcall *PFNGLGETSTRINGPROC)(GLenum name);
+
+PFNGLGETSTRINGPROC glGetString_func;
+const GLubyte *gl_renderer;
+bool ok;
+
+glGetString_func = wgl_dl_sym(dpy->wcore.platform, WAFFLE_DL_OPENGL, 
"glGetString");
+if (!glGetString_func)
+return false;
+
+ok = wglMakeCurrent(dpy->hDC, dpy->hglrc);
+if (!ok)
+return false;
+
+gl_renderer = glGetString_func(GL_RENDERER);
+ok = wglMakeCurrent(NULL, NULL);
+if (!ok)
+return false;
+
+// Bail out if we cannot retrieve the renderer string or if we're using GDI
+if (!gl_renderer || strcasecmp((const char *)gl_renderer, "GDI Generic") 
== 0)
+return false;
+
+return true;
+}
 
 struct wcore_display*
 wgl_display_connect(struct wcore_platform *wc_plat,
@@ -60,6 +152,22 @@ wgl_display_connect(struct wcore_platform *wc_plat,
 if (!ok)
 goto error;
 
+ok = wgl_display_create_window(wgl_platform(wc_plat), self);
+if (!ok)
+goto error;
+
+ok = wgl_display_choose_config(self);
+if (!ok)
+goto error;
+
+self->hglrc = wglCreateContext(self->hDC);
+if (!self->hglrc)
+goto error;
+
+ok = wgl_display_hardware_render(self);
+if (!ok)
+goto error;
+
 return &self->wcore;
 
 error:
diff --git a/src/waffle/wgl/wgl_display.h b/src/waffle/wgl/wgl_display.h
index 262ab18..6a2b6c7 100644
--- a/src/waffle/wgl/wgl_display.h
+++ b/src/waffle/wgl/wgl_display.h
@@ -35,6 +35,11 @@ struct wcore_platform;
 
 struct wgl_display {
 struct wcore_display wcore;
+
+HWND hWnd;
+HDC hDC;
+i

[waffle] [PATCH 47/53] cmake: ensure waffle-static name differs from the shared one

2014-11-09 Thread Emil Velikov
In our current state 'make check/check-func' will succeed, but plain
'make all' will fail. This is due to naming colision when building for
Windows, as RUNTIME, LIBRARY and ARCHIVE have different meanings between
Windows and everyone else. Essentially the waffle.lib from the shared
library will clash with the one for static waffle.

Cc: Chad Versace 
Signed-off-by: Emil Velikov 
---
 src/waffle/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/waffle/CMakeLists.txt b/src/waffle/CMakeLists.txt
index b580960..c71fb2c 100644
--- a/src/waffle/CMakeLists.txt
+++ b/src/waffle/CMakeLists.txt
@@ -255,7 +255,7 @@ target_link_libraries(waffle_static ${waffle_libdeps})
 
 set_target_properties(waffle_static
 PROPERTIES
-OUTPUT_NAME "waffle-${waffle_major_version}"
+OUTPUT_NAME "waffle-static-${waffle_major_version}"
 )
 
 # 
-- 
2.1.3

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


[waffle] [PATCH 46/53] cmake: Set default location for all artifacts to top-level directories

2014-11-09 Thread Emil Velikov
By default, put executables into $CMAKE_BINARY_DIR/bin and libraries
into $CMAKE_BINARY_DIR/lib.  Test executables still go into
$CMAKE_BINARY_DIR/test.

This patch's main purpose is to consolidate repetitive code. It doesn't
actually move anything except 'libcmocka.a'.

v2: [Emil]
 - Move gl_basic_test (dynamic linked against waffle) to bin, or the
test will fail on Windows. Due to the DLL being in a different folder.

Cc: Emil Velikov 
Signed-off-by: Chad Versace 
---
 .gitignore  | 2 +-
 CMakeLists.txt  | 7 +++
 src/utils/CMakeLists.txt| 4 
 src/waffle/CMakeLists.txt   | 3 ---
 tests/functional/CMakeLists.txt | 7 ---
 5 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore
index 85a607f..7944c00 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@ Makefile
 *.a
 *.so
 
+/bin/gl_basic_test
 /bin/wflinfo
 /doc/html/man/waffle.7.html
 /doc/html/man/waffle_attrib_list.3.html
@@ -57,7 +58,6 @@ Makefile
 /lib/
 /libcmocka.a
 /src/waffle/libwaffle_static.a
-/tests/functional/gl_basic_test
 /tests/waffle_test/libwaffle_test.dylib
 /tests/unittests/waffle-unittest
 /tests/wcore_attrib_list_unittest
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d6c804b..bde8096 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,13 @@ cmake_minimum_required(VERSION 2.8.11)
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
 
+# Set the default location for all build artifacts to traditionally named
+# top-level directories.  CMake's default location for build artifacts varies
+# per artifact and is hard-to-guess.
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+
 include(WaffleDefineOS)
 include(WaffleFindDependencies)
 include(Options.cmake)
diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt
index 6744c78..9cb6cc7 100644
--- a/src/utils/CMakeLists.txt
+++ b/src/utils/CMakeLists.txt
@@ -4,10 +4,6 @@
 
 add_executable(wflinfo wflinfo.c)
 target_link_libraries(wflinfo ${waffle_libname} ${GETOPT_LIBRARIES})
-set_target_properties(wflinfo
-PROPERTIES
-RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
-)
 
 if(waffle_on_mac)
 set_target_properties(wflinfo
diff --git a/src/waffle/CMakeLists.txt b/src/waffle/CMakeLists.txt
index 891ff80..b580960 100644
--- a/src/waffle/CMakeLists.txt
+++ b/src/waffle/CMakeLists.txt
@@ -216,8 +216,6 @@ target_link_libraries(${waffle_libname} PRIVATE 
${waffle_libdeps})
 
 set_target_properties(${waffle_libname}
 PROPERTIES
-LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
-RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
 SOVERSION ${waffle_soversion}
 VERSION ${waffle_soversion}.${waffle_minor_version}.${waffle_patch_version}
 )
@@ -258,7 +256,6 @@ target_link_libraries(waffle_static ${waffle_libdeps})
 set_target_properties(waffle_static
 PROPERTIES
 OUTPUT_NAME "waffle-${waffle_major_version}"
-ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
 )
 
 # 
diff --git a/tests/functional/CMakeLists.txt b/tests/functional/CMakeLists.txt
index 0612829..f1388b2 100644
--- a/tests/functional/CMakeLists.txt
+++ b/tests/functional/CMakeLists.txt
@@ -29,13 +29,6 @@ add_executable(gl_basic_test
 ${gl_basic_test_sources}
 )
 
-# Ensure that the executable is in the same folder as the library it's linked
-# against. Otherwise Windows will fail to load the DLL, and the test will fail.
-set_target_properties(gl_basic_test
-PROPERTIES
-RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
-)
-
 target_link_libraries(gl_basic_test
 ${waffle_libname}
 waffle_test
-- 
2.1.3

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


[waffle] [PATCH 51/53] README: fix spelling typo

2014-11-09 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 README.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.txt b/README.txt
index bebc176..c9ffee2 100644
--- a/README.txt
+++ b/README.txt
@@ -300,7 +300,7 @@ but may work if the appropriate environment is setup via 
wine.
 
 3.3 Windows - native builds
 ---
-Once can manage the build/install/package process via Visual Studio's GUI
+One can manage the build/install/package process via Visual Studio's GUI
 or via the command line.
 
 When using the GUI open .\build\msvc*\waffle-VERSION.sln, where * can be
-- 
2.1.3

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


[waffle] [PATCH 48/53] wflinfo: call get_proc_address after make_current

2014-11-09 Thread Emil Velikov
WGL requires that an active context is available as wglGetProcAddress
is called otherwise the function pointer returned will be NULL.

v2: Rebase

Signed-off-by: Emil Velikov 
---
 src/utils/wflinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/utils/wflinfo.c b/src/utils/wflinfo.c
index 161e355..c2af4dc 100644
--- a/src/utils/wflinfo.c
+++ b/src/utils/wflinfo.c
@@ -1058,8 +1058,6 @@ main(int argc, char **argv)
 if (!glGetString)
 error_get_gl_symbol("glGetString");
 
-glGetStringi = waffle_get_proc_address("glGetStringi");
-
 const struct wflinfo_config_attrs config_attrs = {
 .api = opts.context_api,
 .profile = opts.context_profile,
@@ -1079,6 +1077,8 @@ main(int argc, char **argv)
 if (!ok)
 error_waffle();
 
+glGetStringi = waffle_get_proc_address("glGetStringi");
+
 ok = print_wflinfo(&opts);
 if (!ok)
 error_waffle();
-- 
2.1.3

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


[waffle] [PATCH 08/53] wgl: wire-up waffle_get_proc_address()

2014-11-09 Thread Emil Velikov
For WGL we need a current context otherwise wglGetProcAddress will
return NULL pointer. Notice this in the documentation and leave it
up-to the user to design/use waffle in such a way this will work.

Remove the mesa workaround from gl_basic_test. Suggested by Chad.

Cc: Chad Versace 
Signed-off-by: Emil Velikov 
---
 man/waffle_get_proc_address.3.xml | 15 ++-
 src/waffle/wgl/wgl_platform.c |  3 ++-
 tests/functional/gl_basic_test.c  |  9 -
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/man/waffle_get_proc_address.3.xml 
b/man/waffle_get_proc_address.3.xml
index 36b9ea2..fea2dff 100644
--- a/man/waffle_get_proc_address.3.xml
+++ b/man/waffle_get_proc_address.3.xml
@@ -66,6 +66,9 @@
 On CGL, this function returns NULL
 
 because there exists no CGLGetProcAdress().
+
+On WGL, this redirects to
+
wglGetProcAddress3.
   
 
   
@@ -89,6 +92,14 @@
   then waffle_get_proc_address() may 
return a NULL.
 
   
+
+  
+
+  Under Windows (WGL) a current context must be available 
before executing the function.
+
+  Otherwise waffle_get_proc_address() may 
return a NULL.
+
+  
 
   
 
@@ -99,7 +110,9 @@
 
 the http://www.opengl.org/registry/doc/glx1.4.pdf";>GLX 
1.4 Specification
 
-or the http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf";>EGL 
1.4 Specification.
+the http://www.khronos.org/registry/egl/specs/eglspec.1.4.20110406.pdf";>EGL 
1.4 Specification
+
+or the http://msdn.microsoft.com/en-gb/library/windows/desktop/dd374386(v=vs.85).aspx">MSDN
 article.
   
 
   
diff --git a/src/waffle/wgl/wgl_platform.c b/src/waffle/wgl/wgl_platform.c
index 2f88aff..573d5e6 100644
--- a/src/waffle/wgl/wgl_platform.c
+++ b/src/waffle/wgl/wgl_platform.c
@@ -24,6 +24,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #include 
+#include 
 
 #include "wcore_error.h"
 
@@ -128,7 +129,7 @@ wgl_make_current(struct wcore_platform *wc_self,
 static void*
 wgl_get_proc_address(struct wcore_platform *wc_self, const char *name)
 {
-return NULL;
+return wglGetProcAddress(name);
 }
 
 static const struct wcore_platform_vtbl wgl_platform_vtbl = {
diff --git a/tests/functional/gl_basic_test.c b/tests/functional/gl_basic_test.c
index 035b221..c73e1f9 100644
--- a/tests/functional/gl_basic_test.c
+++ b/tests/functional/gl_basic_test.c
@@ -235,15 +235,6 @@ gl_basic_draw__(struct gl_basic_draw_args__ args)
 config_attrib_list[i++] = alpha;
 config_attrib_list[i++] = 0;
 
-// Check that we've set the EGL_PLATFORM environment variable for Mesa.
-//
-// If Mesa's libEGL is built with support for multiple platforms, then the
-// environment variable EGL_PLATFORM must be set before the first EGL
-// call. Otherwise, libEGL may initialize itself with the incorrect
-// platform. In my experiments, first calling eglGetProcAddress will
-// produce a segfault in eglInitialize.
-waffle_get_proc_address("glClear");
-
 // Create objects.
 ASSERT_TRUE(dpy = waffle_display_connect(NULL));
 
-- 
2.1.3

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


[waffle] [PATCH 50/53] wgl: s/glX/wgl/ in error message

2014-11-09 Thread Emil Velikov
Spotted while running through piglits and the test required OGL 4.0
context on my OGL 3.3 card.

Signed-off-by: Emil Velikov 
Reviewed-by: Chad Versace 
---
 src/waffle/wgl/wgl_context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/waffle/wgl/wgl_context.c b/src/waffle/wgl/wgl_context.c
index da783ad..dd45f81 100644
--- a/src/waffle/wgl/wgl_context.c
+++ b/src/waffle/wgl/wgl_context.c
@@ -167,7 +167,7 @@ wgl_context_create_native(struct wgl_config *config,
 attrib_list);
 if (!hglrc) {
 wcore_errorf(WAFFLE_ERROR_UNKNOWN,
- "glXCreateContextAttribsARB failed");
+ "wglCreateContextAttribsARB failed");
 return NULL;
 }
 }
-- 
2.1.3

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


[waffle] [PATCH 49/53] README: spelling fixes

2014-11-09 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 README.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.txt b/README.txt
index e18da31..bebc176 100644
--- a/README.txt
+++ b/README.txt
@@ -257,7 +257,7 @@ The following commands build Waffle, run its tests, 
installs the project and
 creates a binary archive in a platform agnostic way.
 
 Note that not all steps may be required in your case and the configuration
-settings (cache) are localed in the current directory as indicated by ".".
+settings (cache) are located in the current directory as indicated by ".".
 
 cmake --build .
 cmake --build . --target check
@@ -295,7 +295,7 @@ can use an alternative version of the above commands:
 done
 
 Note: Running the tests (`make check` and/or `make check-func`) is not tested
-but may work if the approapriate environment is setup via wine.
+but may work if the appropriate environment is setup via wine.
 
 
 3.3 Windows - native builds
-- 
2.1.3

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


[waffle] [PATCH 13/53] wgl: provide static GLES* symbols (dlsym) via opengl32.dll

2014-11-09 Thread Emil Velikov
Under Windows there is a single library that provides the basic/core
symbols for OpenGL and OpenGL ES* alike. One should attempt to use the
latter only if WGL_EXT_create_context_es{2,}_profile is supported.

We check for the extension in waffle_display_supports_context_api()
and users are strongly recommended check the function's return value.

Signed-off-by: Emil Velikov 
---
 src/waffle/wgl/wgl_dl.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/waffle/wgl/wgl_dl.c b/src/waffle/wgl/wgl_dl.c
index eb9ef46..9d05cb9 100644
--- a/src/waffle/wgl/wgl_dl.c
+++ b/src/waffle/wgl/wgl_dl.c
@@ -39,19 +39,11 @@ wgl_dl_check_enum(int32_t waffle_dl)
 {
 switch (waffle_dl) {
 case WAFFLE_DL_OPENGL:
-return true;
 case WAFFLE_DL_OPENGL_ES1:
-wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "WGL does not support OpenGL ES1");
-return false;
 case WAFFLE_DL_OPENGL_ES2:
-wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "WGL does not support OpenGL ES2");
-return false;
 case WAFFLE_DL_OPENGL_ES3:
-wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
- "WGL does not support OpenGL ES3");
-return false;
+// OPENGL32.DLL provides GL and GLES* symbols.
+return true;
 default:
 assert(false);
 return false;
-- 
2.1.3

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


[waffle] [PATCH 52/53] man: spelling/grammar fix

2014-11-09 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 man/waffle_get_proc_address.3.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/waffle_get_proc_address.3.xml 
b/man/waffle_get_proc_address.3.xml
index fea2dff..333e127 100644
--- a/man/waffle_get_proc_address.3.xml
+++ b/man/waffle_get_proc_address.3.xml
@@ -72,7 +72,7 @@
   
 
   
-Some aspects of this function's behavior is platform-specific and 
non-intuitive.
+Some aspects of this function's behavior are platform-specific and 
non-intuitive.
 
 For example,
 
-- 
2.1.3

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


[waffle] [PATCH 53/53] man: spelling fix

2014-11-09 Thread Emil Velikov
Signed-off-by: Emil Velikov 
---
 man/waffle_dl.3.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/waffle_dl.3.xml b/man/waffle_dl.3.xml
index b089b93..463081f 100644
--- a/man/waffle_dl.3.xml
+++ b/man/waffle_dl.3.xml
@@ -74,7 +74,7 @@
   libGL.so.1,
   libGLESv1_CM.so,
   libGLESv2.so, and
-  libGLESv2.so, repectively.
+  libGLESv2.so, respectively.
 
 
 
-- 
2.1.3

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


Re: [waffle] [PATCH 47/53] cmake: ensure waffle-static name differs from the shared one

2014-11-09 Thread Emil Velikov
A lovely note which I've complete forgot.

Fwiw we can squash this patch with 'cmake: Set default location for all
artifacts to top-level directories' as it essentially introduces the
regression.

-Emil

On 09/11/14 22:58, Emil Velikov wrote:
> In our current state 'make check/check-func' will succeed, but plain
> 'make all' will fail. This is due to naming colision when building for
> Windows, as RUNTIME, LIBRARY and ARCHIVE have different meanings between
> Windows and everyone else. Essentially the waffle.lib from the shared
> library will clash with the one for static waffle.
> 
> Cc: Chad Versace 
> Signed-off-by: Emil Velikov 
> ---
>  src/waffle/CMakeLists.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/waffle/CMakeLists.txt b/src/waffle/CMakeLists.txt
> index b580960..c71fb2c 100644
> --- a/src/waffle/CMakeLists.txt
> +++ b/src/waffle/CMakeLists.txt
> @@ -255,7 +255,7 @@ target_link_libraries(waffle_static ${waffle_libdeps})
>  
>  set_target_properties(waffle_static
>  PROPERTIES
> -OUTPUT_NAME "waffle-${waffle_major_version}"
> +OUTPUT_NAME "waffle-static-${waffle_major_version}"
>  )
>  
>  # 
> 
> 

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


Re: [waffle] [PULL] WGL support

2014-11-09 Thread Chad Versace

On Sun 09 Nov 2014, Emil Velikov wrote:


As mentioned earlier here is a rebase of all the wgl work so far on top
of origin/master.


Merged to next! So... what does that mean??? That means I'll merge your 
branch to 'master' after it cooks for a little while and I'm certain 
Piglit doesn't complain.



To answer your branching query from Saturday... Here's a *very tiny* 
summary of the workflow I'm following in man:gitworkflow(7).


   - The 'master' branch should always be stable. At any time, it 
   should be safe to cut a release off of master.


   - The 'next' branch is an integration branch. That's where the 
   interesting action happens.


   - Topic branches are usually first merged to 'next', unless they are 
   obvious fixes. After baking on 'next' for enough time to reveal any 
   lurking bugs, the same topic branch is then merged to 'master'.


   - As explained in man:gitworkflow(7), merges between branches always 
   flow "upwards" and never "downwards". That is,


   maint -> master -> next

   and never

   master <- next

   - Merges are preferred over cherry-picks. As explained in 
   man:gitworkflow(7):



   Merges have many advantages, so we try to solve as many problems as
   possible with merges alone. Cherry-picking is still occasionally
   useful.

   Most importantly, merging works at the branch level, while
   cherry-picking works at the commit level. [...] Merges are also
   easier to understand because merge commit is a "promise" that all
   changes from all its parents are now included.

   There is a tradeoff of course: merges require a more careful branch
   management. [...]

   Always commit your fixes to the oldest supported branch that require
   them. Then (periodically) merge the integration branches upwards into 
   each other.


   [A "merging upwards" strategy"] gives a very controlled flow of
   fixes.  If you notice that you have applied a fix to
   e.g. master that is also required in maint, you will need to
   cherry-pick it (using git-cherry-pick(1)) downwards. This will
   happen a few times and is nothing to worry about unless you do it
   very frequently.
___
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle