Signed-off-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl> --- 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; </varlistentry> <varlistentry> + <term><constant>WAFFLE_CONTEXT_ROBUST_ACCESS</constant></term> + <listitem> + <para> + Feature test macro: <code>WAFFLE_API_VERSION >= 0x0106</code>. + (See <citerefentry><refentrytitle>waffle_feature_test_macros</refentrytitle><manvolnum>7</manvolnum></citerefentry>). + </para> + <para> + This attribute, if true, instructs + <citerefentry><refentrytitle><function>waffle_context_create</function></refentrytitle><manvolnum>3</manvolnum></citerefentry> + to create a robust access context. + </para> + <para> + Robust access contexts can implement additional runtime checks, such as bounds checks for various + operations. + </para> + <para> + This attribute is optional and its default value is false(0). + + Valid values are true(1), false(0), and <constant>WAFFLE_DONT_CARE</constant>. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><constant>WAFFLE_RED_SIZE</constant></term> <term><constant>WAFFLE_GREEN_SIZE</constant></term> <term><constant>WAFFLE_BLUE_SIZE</constant></term> 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