[waffle] I'm back from paternity leave

2016-04-06 Thread Chad Versace
Hi everyone,

I abruptly left for paternity leave in early February, and now I'm a father!
My little boy is named Lucas, and he's incredible.

While on leave, I had little time to spare for non-baby activities, so it's 
been over two
months since I read any code-related mail. I returned from paternity leave 
yesterday,
and am now catching up on unread Waffle mail.
___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH] cmake: use the EGL CFLAGS in the waffle CFLAGS

2016-04-06 Thread Chad Versace
On 02/11/2016 03:21 PM, Mircea Gherzan wrote:
> Without them, the build will fail with a recent Mesa from the master
> branch on a system without the X headers:
> 
> include/EGL/eglplatform.h:119:22: fatal error: X11/Xlib.h: No such file
> or directory
> 
> Signed-off-by: Mircea Gherzan 

Yes, because egl_CFLAGS_OTHER contains -DMESA_EGL_NO_X11_HEADERS
when the system has no X headers.

Thanks. Patch is pushed to master.
___
waffle mailing list
waffle@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/waffle


Re: [waffle] [PATCH 6/6] nacl: Add an error when trying to use a robust access context.

2016-04-06 Thread Tapani Pälli

This looks correct to me;

Reviewed-by: Tapani Pälli 

Note that following patch is required to build waffle nacl support on 
any recent nacl sdk versions:


https://lists.freedesktop.org/archives/waffle/2015-October/001266.html


On 04/06/2016 06:59 PM, Bas Nieuwenhuizen wrote:

Signed-off-by: Bas Nieuwenhuizen 
---
  src/waffle/nacl/nacl_config.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/src/waffle/nacl/nacl_config.c b/src/waffle/nacl/nacl_config.c
index 9017775..668657b 100644
--- a/src/waffle/nacl/nacl_config.c
+++ b/src/waffle/nacl/nacl_config.c
@@ -63,6 +63,12 @@ nacl_config_choose(struct wcore_platform *wc_plat,
  goto error;
  }

+if (attrs->context_robust) {
+wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
+ "NaCl does not support robust contexts.");
+goto error;
+}
+
  unsigned attr = 0;

  // Max amount of attribs is hardcoded in nacl_config.h (64)


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


[waffle] [PATCH 2/6] glx: Add support for robust access contexts.

2016-04-06 Thread Bas Nieuwenhuizen
Signed-off-by: Bas Nieuwenhuizen 
---
 src/waffle/glx/glx_config.c  | 7 +++
 src/waffle/glx/glx_context.c | 4 
 src/waffle/glx/glx_display.c | 1 +
 src/waffle/glx/glx_display.h | 1 +
 4 files changed, 13 insertions(+)

diff --git a/src/waffle/glx/glx_config.c b/src/waffle/glx/glx_config.c
index 7792aa0..5561e28 100644
--- a/src/waffle/glx/glx_config.c
+++ b/src/waffle/glx/glx_config.c
@@ -68,6 +68,13 @@ glx_config_check_context_attrs(struct glx_display *dpy,
 return false;
 }
 
+if (attrs->context_robust && !dpy->ARB_create_context_robustness) {
+wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
+ "GLX_ARB_create_context_robustness is required in order 
to "
+ "request a robust access context");
+return false;
+}
+
 switch (attrs->context_api) {
 case WAFFLE_CONTEXT_OPENGL:
 if (!wcore_config_attrs_version_eq(attrs, 10) && 
!dpy->ARB_create_context) {
diff --git a/src/waffle/glx/glx_context.c b/src/waffle/glx/glx_context.c
index 1f9290b..c6cd813 100644
--- a/src/waffle/glx/glx_context.c
+++ b/src/waffle/glx/glx_context.c
@@ -151,6 +151,10 @@ glx_context_fill_attrib_list(struct glx_config *config,
 context_flags |= GLX_CONTEXT_DEBUG_BIT_ARB;
 }
 
+if (attrs->context_robust) {
+context_flags |= GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB;
+}
+
 if (context_flags != 0) {
 attrib_list[i++] = GLX_CONTEXT_FLAGS_ARB;
 attrib_list[i++] = context_flags;
diff --git a/src/waffle/glx/glx_display.c b/src/waffle/glx/glx_display.c
index 24e967c..0c6851d 100644
--- a/src/waffle/glx/glx_display.c
+++ b/src/waffle/glx/glx_display.c
@@ -63,6 +63,7 @@ glx_display_set_extensions(struct glx_display *self)
 
 self->ARB_create_context = 
waffle_is_extension_in_string(s, "GLX_ARB_create_context");
 self->ARB_create_context_profile = 
waffle_is_extension_in_string(s, "GLX_ARB_create_context_profile");
+self->ARB_create_context_robustness  = 
waffle_is_extension_in_string(s, "GLX_ARB_create_context_robustness");
 self->EXT_create_context_es_profile  = 
waffle_is_extension_in_string(s, "GLX_EXT_create_context_es_profile");
 
 // The GLX_EXT_create_context_es2_profile spec, version 4 2012/03/28,
diff --git a/src/waffle/glx/glx_display.h b/src/waffle/glx/glx_display.h
index 4b8f687..b8bb875 100644
--- a/src/waffle/glx/glx_display.h
+++ b/src/waffle/glx/glx_display.h
@@ -46,6 +46,7 @@ struct glx_display {
 
 bool ARB_create_context;
 bool ARB_create_context_profile;
+bool ARB_create_context_robustness;
 bool EXT_create_context_es_profile;
 bool EXT_create_context_es2_profile;
 };
-- 
2.8.0

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


[waffle] [PATCH 1/6] wcore: Add support for robust access contexts.

2016-04-06 Thread Bas Nieuwenhuizen
Signed-off-by: Bas Nieuwenhuizen 
---
 include/waffle/waffle.h  |  4 
 man/waffle_config.3.xml  | 24 
 src/waffle/core/wcore_config_attrs.c |  3 +++
 src/waffle/core/wcore_config_attrs.h |  1 +
 src/waffle/core/wcore_util.c |  1 +
 5 files changed, 33 insertions(+)

diff --git a/include/waffle/waffle.h b/include/waffle/waffle.h
index df0218e..b207f37 100644
--- a/include/waffle/waffle.h
+++ b/include/waffle/waffle.h
@@ -142,6 +142,10 @@ enum waffle_enum {
 WAFFLE_CONTEXT_DEBUG= 0x0216,
 #endif
 
+#if WAFFLE_API_VERSION >= 0x106
+WAFFLE_CONTEXT_ROBUST_ACCESS= 0x0217,
+#endif
+
 WAFFLE_RED_SIZE = 0x0201,
 WAFFLE_GREEN_SIZE   = 0x0202,
 WAFFLE_BLUE_SIZE= 0x0203,
diff --git a/man/waffle_config.3.xml b/man/waffle_config.3.xml
index a8cb98d..b8ae67a 100644
--- a/man/waffle_config.3.xml
+++ b/man/waffle_config.3.xml
@@ -412,6 +412,30 @@ struct waffle_config;
   
 
   
+WAFFLE_CONTEXT_ROBUST_ACCESS
+
+  
+Feature test macro: WAFFLE_API_VERSION >= 0x0106.
+(See 
waffle_feature_test_macros7).
+  
+  
+This attribute, if true, instructs
+
waffle_context_create3
+to create a robust access context.
+  
+  
+Robust access contexts can implement additional runtime checks, 
such as bounds checks for various
+operations.
+  
+  
+This attribute is optional and its default value is false(0).
+
+Valid values are true(1), false(0), and 
WAFFLE_DONT_CARE.
+  
+
+  
+
+  
 WAFFLE_RED_SIZE
 WAFFLE_GREEN_SIZE
 WAFFLE_BLUE_SIZE
diff --git a/src/waffle/core/wcore_config_attrs.c 
b/src/waffle/core/wcore_config_attrs.c
index 4a2cb5d..9caa0cc 100644
--- a/src/waffle/core/wcore_config_attrs.c
+++ b/src/waffle/core/wcore_config_attrs.c
@@ -54,6 +54,7 @@ check_keys(const int32_t attrib_list[])
 case WAFFLE_CONTEXT_PROFILE:
 case WAFFLE_CONTEXT_FORWARD_COMPATIBLE:
 case WAFFLE_CONTEXT_DEBUG:
+case WAFFLE_CONTEXT_ROBUST_ACCESS:
 case WAFFLE_RED_SIZE:
 case WAFFLE_GREEN_SIZE:
 case WAFFLE_BLUE_SIZE:
@@ -339,6 +340,7 @@ set_misc_defaults(struct wcore_config_attrs *attrs)
 // [2] EGL 1.4 spec (2011.04.06), Table 3.4
 
 attrs->context_debug= false;
+attrs->context_robust   = false;
 
 attrs->rgba_size= 0;
 attrs->red_size = 0;
@@ -414,6 +416,7 @@ parse_misc(struct wcore_config_attrs *attrs,
 CASE_INT(WAFFLE_SAMPLES, samples)
 
 CASE_BOOL(WAFFLE_CONTEXT_DEBUG, context_debug, false);
+CASE_BOOL(WAFFLE_CONTEXT_ROBUST_ACCESS, context_robust, false);
 CASE_BOOL(WAFFLE_SAMPLE_BUFFERS, sample_buffers, 
DEFAULT_SAMPLE_BUFFERS);
 CASE_BOOL(WAFFLE_DOUBLE_BUFFERED, double_buffered, 
DEFAULT_DOUBLE_BUFFERED);
 CASE_BOOL(WAFFLE_ACCUM_BUFFER, accum_buffer, DEFAULT_ACCUM_BUFFER);
diff --git a/src/waffle/core/wcore_config_attrs.h 
b/src/waffle/core/wcore_config_attrs.h
index cca5e8b..e00e517 100644
--- a/src/waffle/core/wcore_config_attrs.h
+++ b/src/waffle/core/wcore_config_attrs.h
@@ -54,6 +54,7 @@ struct wcore_config_attrs {
 
 bool context_forward_compatible;
 bool context_debug;
+bool context_robust;
 bool double_buffered;
 bool sample_buffers;
 bool accum_buffer;
diff --git a/src/waffle/core/wcore_util.c b/src/waffle/core/wcore_util.c
index c563fae..4c09164 100644
--- a/src/waffle/core/wcore_util.c
+++ b/src/waffle/core/wcore_util.c
@@ -97,6 +97,7 @@ wcore_enum_to_string(int32_t e)
 CASE(WAFFLE_CONTEXT_COMPATIBILITY_PROFILE);
 CASE(WAFFLE_CONTEXT_FORWARD_COMPATIBLE);
 CASE(WAFFLE_CONTEXT_DEBUG);
+CASE(WAFFLE_CONTEXT_ROBUST_ACCESS);
 CASE(WAFFLE_RED_SIZE);
 CASE(WAFFLE_GREEN_SIZE);
 CASE(WAFFLE_BLUE_SIZE);
-- 
2.8.0

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


[waffle] [PATCH 5/6] cgl: Add an error when trying to use a robust access context.

2016-04-06 Thread Bas Nieuwenhuizen
Signed-off-by: Bas Nieuwenhuizen 
---
 src/waffle/cgl/cgl_config.m | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m
index d7e8ed3..898ee24 100644
--- a/src/waffle/cgl/cgl_config.m
+++ b/src/waffle/cgl/cgl_config.m
@@ -82,6 +82,12 @@ cgl_config_check_attrs(const struct cgl_platform *plat,
 return false;
 }
 
+if (attrs->context_robust) {
+wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
+ "CGL does not support robust contexts");
+return false;
+}
+
 // Emulate EGL_KHR_create_context, which allows the implementation to
 // return a context of the latest supported flavor that is
 // backwards-compatibile with the requested flavor.
-- 
2.8.0

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


[waffle] [PATCH 3/6] wgl: Add support for robust access contexts.

2016-04-06 Thread Bas Nieuwenhuizen
Signed-off-by: Bas Nieuwenhuizen 
---
 src/waffle/wgl/wgl_config.c  | 7 +++
 src/waffle/wgl/wgl_context.c | 4 
 src/waffle/wgl/wgl_display.c | 1 +
 src/waffle/wgl/wgl_display.h | 1 +
 4 files changed, 13 insertions(+)

diff --git a/src/waffle/wgl/wgl_config.c b/src/waffle/wgl/wgl_config.c
index 59a70a6..80d45fc 100644
--- a/src/waffle/wgl/wgl_config.c
+++ b/src/waffle/wgl/wgl_config.c
@@ -71,6 +71,13 @@ wgl_config_check_context_attrs(struct wgl_display *dpy,
 return false;
 }
 
+if (attrs->context_robust && !dpy->ARB_create_context_robustness) {
+wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM,
+ "WGL_ARB_create_context_robustness is required in order 
to "
+ "request a robust access context");
+return false;
+}
+
 switch (attrs->context_api) {
 case WAFFLE_CONTEXT_OPENGL:
 if (!wcore_config_attrs_version_eq(attrs, 10) && 
!dpy->ARB_create_context) {
diff --git a/src/waffle/wgl/wgl_context.c b/src/waffle/wgl/wgl_context.c
index dd45f81..c7a351f 100644
--- a/src/waffle/wgl/wgl_context.c
+++ b/src/waffle/wgl/wgl_context.c
@@ -135,6 +135,10 @@ wgl_context_fill_attrib_list(struct wgl_config *config,
 context_flags |= WGL_CONTEXT_DEBUG_BIT_ARB;
 }
 
+if (attrs->context_robust) {
+context_flags |= WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB;
+}
+
 if (context_flags != 0) {
 attrib_list[i++] = WGL_CONTEXT_FLAGS_ARB;
 attrib_list[i++] = context_flags;
diff --git a/src/waffle/wgl/wgl_display.c b/src/waffle/wgl/wgl_display.c
index 9b3b38e..c0b547a 100644
--- a/src/waffle/wgl/wgl_display.c
+++ b/src/waffle/wgl/wgl_display.c
@@ -153,6 +153,7 @@ wgl_display_set_extensions(struct wgl_display *dpy)
 
 dpy->ARB_create_context = 
waffle_is_extension_in_string(extensions, "WGL_ARB_create_context");
 dpy->ARB_create_context_profile = 
waffle_is_extension_in_string(extensions, "WGL_ARB_create_context_profile");
+dpy->ARB_create_context_robustness  = 
waffle_is_extension_in_string(extensions, "WGL_ARB_create_context_robustness");
 dpy->EXT_create_context_es_profile  = 
waffle_is_extension_in_string(extensions, "WGL_EXT_create_context_es_profile");
 
 // The WGL_EXT_create_context_es2_profile spec, version 5 2012/04/06,
diff --git a/src/waffle/wgl/wgl_display.h b/src/waffle/wgl/wgl_display.h
index d0d94fe..c8dfb81 100644
--- a/src/waffle/wgl/wgl_display.h
+++ b/src/waffle/wgl/wgl_display.h
@@ -55,6 +55,7 @@ struct wgl_display {
 
 bool ARB_create_context;
 bool ARB_create_context_profile;
+bool ARB_create_context_robustness;
 bool EXT_create_context_es_profile;
 bool EXT_create_context_es2_profile;
 bool ARB_pixel_format;
-- 
2.8.0

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