<p dir="ltr">Sorry to be pedantic, but you're enabling the ext for gles1.1, but the new entrypoint appear to only apply to gles2. I think you also want a es1="1.1" or something along those lines.</p>
<div class="gmail_quote">On May 24, 2016 8:02 PM, "Kristian Høgsberg" <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Kristian Høgsberg Kristensen <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>><br>
<br>
As per GL_KHR_robustness, we have to return GL_CONTEXT_LOST from all<br>
entry points when we lose a context. We do this by creating a new<br>
dispatch table and setting that when we learn that we've lost the<br>
context.<br>
<br>
With the GL_CONTEXT_LOST reporting in place we can turn on<br>
GL_KHR_robustness.<br>
<br>
Signed-off-by: Kristian Høgsberg Kristensen <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>><br>
---<br>
<br>
v2: Add dispatch for un-suffixed and KHR-suffixed entrypoint added by<br>
the extension.<br>
<br>
docs/GL3.txt | 2 +-<br>
docs/relnotes/11.3.0.html | 1 +<br>
src/mapi/glapi/gen/KHR_robustness.xml | 66 +++++++++++++++++++++<br>
src/mapi/glapi/gen/KHR_robustness_es.xml | 63 ++++++++++++++++++++<br>
src/mapi/glapi/gen/Makefile.am | 2 +<br>
src/mapi/glapi/gen/es_EXT.xml | 2 +<br>
src/mapi/glapi/gen/gl_API.xml | 3 +<br>
src/mesa/drivers/dri/i965/brw_context.h | 2 +<br>
src/mesa/drivers/dri/i965/brw_reset.c | 20 +++++++<br>
src/mesa/drivers/dri/i965/intel_batchbuffer.c | 3 +<br>
src/mesa/drivers/dri/i965/intel_extensions.c | 1 +<br>
src/mesa/main/context.c | 1 +<br>
src/mesa/main/context.h | 2 +<br>
src/mesa/main/extensions_table.h | 1 +<br>
src/mesa/main/getstring.c | 82 ++++++++++++++++++++++++++-<br>
src/mesa/main/mtypes.h | 7 ++-<br>
src/mesa/main/tests/dispatch_sanity.cpp | 12 ++++<br>
17 files changed, 267 insertions(+), 3 deletions(-)<br>
create mode 100644 src/mapi/glapi/gen/KHR_robustness.xml<br>
create mode 100644 src/mapi/glapi/gen/KHR_robustness_es.xml<br>
<br>
diff --git a/docs/GL3.txt b/docs/GL3.txt<br>
index b5f03af..21ab46a 100644<br>
--- a/docs/GL3.txt<br>
+++ b/docs/GL3.txt<br>
@@ -218,7 +218,7 @@ GL 4.5, GLSL 4.50:<br>
GL_ARB_shader_texture_image_samples DONE (i965, nv50, nvc0, r600, radeonsi)<br>
GL_ARB_texture_barrier DONE (i965, nv50, nvc0, r600, radeonsi)<br>
GL_KHR_context_flush_control DONE (all - but needs GLX/EGL extension to be useful)<br>
- GL_KHR_robustness not started (90% done with the ARB variant)<br>
+ GL_KHR_robustness DONE (i965)<br>
GL_EXT_shader_integer_mix DONE (all drivers that support GLSL)<br>
<br>
These are the extensions cherry-picked to make GLES 3.1<br>
diff --git a/docs/relnotes/11.3.0.html b/docs/relnotes/11.3.0.html<br>
index 5871ec8..d5bb292 100644<br>
--- a/docs/relnotes/11.3.0.html<br>
+++ b/docs/relnotes/11.3.0.html<br>
@@ -59,6 +59,7 @@ Note: some of the new features are only available with certain drivers.<br>
<li>GL_ARB_shader_storage_buffer_objects on radeonsi, softpipe</li><br>
<li>GL_ATI_fragment_shader on all Gallium drivers</li><br>
<li>GL_EXT_base_instance on all drivers that support GL_ARB_base_instance</li><br>
+<li>GL_KHR_robustness on i965</li><br>
<li>GL_OES_draw_buffers_indexed and GL_EXT_draw_buffers_indexed on all drivers that support GL_ARB_draw_buffers_blend</li><br>
<li>GL_OES_sample_shading on i965, nvc0, r600, radeonsi</li><br>
<li>GL_OES_sample_variables on i965, nvc0, r600, radeonsi</li><br>
diff --git a/src/mapi/glapi/gen/KHR_robustness.xml b/src/mapi/glapi/gen/KHR_robustness.xml<br>
new file mode 100644<br>
index 0000000..56bcfcc<br>
--- /dev/null<br>
+++ b/src/mapi/glapi/gen/KHR_robustness.xml<br>
@@ -0,0 +1,66 @@<br>
+<?xml version="1.0"?><br>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"><br>
+<br>
+<!-- Note: no GLX protocol info yet. --><br>
+<br>
+<br>
+<OpenGLAPI><br>
+<br>
+<category name="GL_KHR_robustness" number="170"><br>
+<br>
+ <enum name="GUILTY_CONTEXT_RESET" value="0x8253"/><br>
+ <enum name="INNOCENT_CONTEXT_RESET" value="0x8254"/><br>
+ <enum name="UNKNOWN_CONTEXT_RESET" value="0x8255"/><br>
+<br>
+ <enum name="RESET_NOTIFICATION_STRATEGY" count="1" value="0x8256"><br>
+ <size name="Get" mode="get"/><br>
+ </enum><br>
+ <enum name="LOSE_CONTEXT_ON_RESET" value="0x8252"/><br>
+ <enum name="NO_RESET_NOTIFICATION" value="0x8261"/><br>
+<br>
+ <enum name="CONTEXT_FLAG_ROBUST_ACCESS_BIT" value="0x00000004"/><br>
+<br>
+ <!-- This extension applies to both GL and ES. GL entrypoints have<br>
+ no suffix, ES entrypoints have the KHR suffix. This file<br>
+ defines entry points for GL. --><br>
+<br>
+ <!-- GL definitions --><br>
+ <function name="GetGraphicsResetStatus" alias="GetGraphicsResetStatusARB"><br>
+ <return type="GLenum"/><br>
+ </function><br>
+<br>
+ <function name="ReadnPixels" alias="ReadnPixelsARB"><br>
+ <param name="x" type="GLint"/><br>
+ <param name="y" type="GLint"/><br>
+ <param name="width" type="GLsizei"/><br>
+ <param name="height" type="GLsizei"/><br>
+ <param name="format" type="GLenum"/><br>
+ <param name="type" type="GLenum"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="data" type="GLvoid *" output="true"/><br>
+ </function><br>
+<br>
+ <function name="GetnUniformfv" alias="GetnUniformfvARB"><br>
+ <param name="program" type="GLuint"/><br>
+ <param name="location" type="GLint"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="params" type="GLfloat *" output="true"/><br>
+ </function><br>
+<br>
+ <function name="GetnUniformiv" alias="GetnUniformivARB"><br>
+ <param name="program" type="GLuint"/><br>
+ <param name="location" type="GLint"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="params" type="GLint *" output="true"/><br>
+ </function><br>
+<br>
+ <function name="GetnUniformuiv" alias="GetnUniformuivARB"><br>
+ <param name="program" type="GLuint"/><br>
+ <param name="location" type="GLint"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="params" type="GLuint *" output="true"/><br>
+ </function><br>
+<br>
+</category><br>
+<br>
+</OpenGLAPI><br>
diff --git a/src/mapi/glapi/gen/KHR_robustness_es.xml b/src/mapi/glapi/gen/KHR_robustness_es.xml<br>
new file mode 100644<br>
index 0000000..ba8bdda<br>
--- /dev/null<br>
+++ b/src/mapi/glapi/gen/KHR_robustness_es.xml<br>
@@ -0,0 +1,63 @@<br>
+<?xml version="1.0"?><br>
+<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd"><br>
+<br>
+<OpenGLAPI><br>
+<br>
+<category name="GL_KHR_robustness" number="190"><br>
+<br>
+ <enum name="GUILTY_CONTEXT_RESET_KHR" value="0x8253"/><br>
+ <enum name="INNOCENT_CONTEXT_RESET_KHR" value="0x8254"/><br>
+ <enum name="UNKNOWN_CONTEXT_RESET_KHR" value="0x8255"/><br>
+<br>
+ <enum name="RESET_NOTIFICATION_STRATEGY_KHR" count="1" value="0x8256"><br>
+ <size name="Get" mode="get"/><br>
+ </enum><br>
+ <enum name="LOSE_CONTEXT_ON_RESET_KHR" value="0x8252"/><br>
+ <enum name="NO_RESET_NOTIFICATION_KHR" value="0x8261"/><br>
+<br>
+ <enum name="CONTEXT_FLAG_ROBUST_ACCESS_BIT_KHR" value="0x00000004"/><br>
+<br>
+ <!-- This extension applies to both GL and ES. GL entrypoints have<br>
+ no suffix, ES entrypoints have the KHR suffix. This file<br>
+ defines entry points for both ES. --><br>
+<br>
+ <function name="GetGraphicsResetStatusKHR"<br>
+ alias="GetGraphicsResetStatusARB" es2="2.0"><br>
+ <return type="GLenum"/><br>
+ </function><br>
+<br>
+ <function name="ReadnPixelsKHR" alias="ReadnPixelsARB" es2="2.0"><br>
+ <param name="x" type="GLint"/><br>
+ <param name="y" type="GLint"/><br>
+ <param name="width" type="GLsizei"/><br>
+ <param name="height" type="GLsizei"/><br>
+ <param name="format" type="GLenum"/><br>
+ <param name="type" type="GLenum"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="data" type="GLvoid *" output="true"/><br>
+ </function><br>
+<br>
+ <function name="GetnUniformfvKHR" alias="GetnUniformfvARB" es2="2.0"><br>
+ <param name="program" type="GLuint"/><br>
+ <param name="location" type="GLint"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="params" type="GLfloat *" output="true"/><br>
+ </function><br>
+<br>
+ <function name="GetnUniformivKHR" alias="GetnUniformivARB" es2="2.0"><br>
+ <param name="program" type="GLuint"/><br>
+ <param name="location" type="GLint"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="params" type="GLint *" output="true"/><br>
+ </function><br>
+<br>
+ <function name="GetnUniformuivKHR" alias="GetnUniformuivARB" es2="2.0"><br>
+ <param name="program" type="GLuint"/><br>
+ <param name="location" type="GLint"/><br>
+ <param name="bufSize" type="GLsizei"/><br>
+ <param name="params" type="GLuint *" output="true"/><br>
+ </function><br>
+<br>
+</category><br>
+<br>
+</OpenGLAPI><br>
diff --git a/src/mapi/glapi/gen/Makefile.am b/src/mapi/glapi/gen/Makefile.am<br>
index 0759819..c511de9 100644<br>
--- a/src/mapi/glapi/gen/Makefile.am<br>
+++ b/src/mapi/glapi/gen/Makefile.am<br>
@@ -192,6 +192,8 @@ API_XML = \<br>
INTEL_performance_query.xml \<br>
KHR_debug.xml \<br>
KHR_context_flush_control.xml \<br>
+ KHR_robustness.xml \<br>
+ KHR_robustness_es.xml \<br>
KHR_texture_compression_astc.xml \<br>
NV_conditional_render.xml \<br>
NV_primitive_restart.xml \<br>
diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml<br>
index ce4c4c4..6886dab 100644<br>
--- a/src/mapi/glapi/gen/es_EXT.xml<br>
+++ b/src/mapi/glapi/gen/es_EXT.xml<br>
@@ -924,6 +924,8 @@<br>
<br>
</category><br>
<br>
+<xi:include href="KHR_robustness_es.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" rel="noreferrer" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
+<br>
<category name="GL_EXT_base_instance" number="203"><br>
<br>
<function name="DrawArraysInstancedBaseInstanceEXT" es2="3.0"<br>
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml<br>
index 2fcba0b..766fe3c 100644<br>
--- a/src/mapi/glapi/gen/gl_API.xml<br>
+++ b/src/mapi/glapi/gen/gl_API.xml<br>
@@ -8288,6 +8288,9 @@<br>
<br>
<xi:include href="KHR_context_flush_control.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" rel="noreferrer" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
<br>
+<!-- ARB extension 170 --><br>
+<xi:include href="KHR_robustness.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" rel="noreferrer" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
+<br>
<!-- ARB extension 171 --><br>
<xi:include href="ARB_pipeline_statistics_query.xml" xmlns:xi="<a href="http://www.w3.org/2001/XInclude" rel="noreferrer" target="_blank">http://www.w3.org/2001/XInclude</a>"/><br>
<br>
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h<br>
index 5155475..4b22201 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_context.h<br>
+++ b/src/mesa/drivers/dri/i965/brw_context.h<br>
@@ -1704,6 +1704,8 @@ gen7_emit_urb_state(struct brw_context *brw,<br>
/* brw_reset.c */<br>
extern GLenum<br>
brw_get_graphics_reset_status(struct gl_context *ctx);<br>
+void<br>
+brw_check_for_reset(struct brw_context *brw);<br>
<br>
/* brw_compute.c */<br>
extern void<br>
diff --git a/src/mesa/drivers/dri/i965/brw_reset.c b/src/mesa/drivers/dri/i965/brw_reset.c<br>
index e3182b1..df734e5 100644<br>
--- a/src/mesa/drivers/dri/i965/brw_reset.c<br>
+++ b/src/mesa/drivers/dri/i965/brw_reset.c<br>
@@ -20,6 +20,9 @@<br>
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
* DEALINGS IN THE SOFTWARE.<br>
*/<br>
+<br>
+#include "main/context.h"<br>
+<br>
#include "brw_context.h"<br>
<br>
/**<br>
@@ -73,3 +76,20 @@ brw_get_graphics_reset_status(struct gl_context *ctx)<br>
<br>
return GL_NO_ERROR;<br>
}<br>
+<br>
+void<br>
+brw_check_for_reset(struct brw_context *brw)<br>
+{<br>
+ uint32_t reset_count;<br>
+ uint32_t active;<br>
+ uint32_t pending;<br>
+ int err;<br>
+<br>
+ err = drm_intel_get_reset_stats(brw->hw_ctx, &reset_count, &active,<br>
+ &pending);<br>
+ if (err)<br>
+ return;<br>
+<br>
+ if (active > 0 || pending > 0)<br>
+ _mesa_set_context_lost_dispatch(&brw->ctx);<br>
+}<br>
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c<br>
index f220311..5a0db9f 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c<br>
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c<br>
@@ -368,6 +368,9 @@ do_flush_locked(struct brw_context *brw)<br>
if (unlikely(INTEL_DEBUG & DEBUG_BATCH))<br>
do_batch_dump(brw);<br>
<br>
+ if (brw->ctx.Const.ResetStrategy == GL_LOSE_CONTEXT_ON_RESET_ARB)<br>
+ brw_check_for_reset(brw);<br>
+<br>
if (ret != 0) {<br>
fprintf(stderr, "intel_do_flush_locked failed: %s\n", strerror(-ret));<br>
exit(1);<br>
diff --git a/src/mesa/drivers/dri/i965/intel_extensions.c b/src/mesa/drivers/dri/i965/intel_extensions.c<br>
index feea6ca..b8d7517 100644<br>
--- a/src/mesa/drivers/dri/i965/intel_extensions.c<br>
+++ b/src/mesa/drivers/dri/i965/intel_extensions.c<br>
@@ -246,6 +246,7 @@ intelInitExtensions(struct gl_context *ctx)<br>
ctx->Extensions.EXT_texture_sRGB_decode = true;<br>
ctx->Extensions.EXT_texture_swizzle = true;<br>
ctx->Extensions.EXT_vertex_array_bgra = true;<br>
+ ctx->Extensions.KHR_robustness = true;<br>
ctx->Extensions.AMD_seamless_cubemap_per_texture = true;<br>
ctx->Extensions.APPLE_object_purgeable = true;<br>
ctx->Extensions.ATI_separate_stencil = true;<br>
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c<br>
index 7c0a6ef..172c854 100644<br>
--- a/src/mesa/main/context.c<br>
+++ b/src/mesa/main/context.c<br>
@@ -1367,6 +1367,7 @@ _mesa_free_context_data( struct gl_context *ctx )<br>
free(ctx->BeginEnd);<br>
free(ctx->OutsideBeginEnd);<br>
free(ctx->Save);<br>
+ free(ctx->ContextLost);<br>
<br>
/* Shared context state (display lists, textures, etc) */<br>
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);<br>
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h<br>
index 46444d2..ef19cc6 100644<br>
--- a/src/mesa/main/context.h<br>
+++ b/src/mesa/main/context.h<br>
@@ -158,6 +158,8 @@ _mesa_notifySwapBuffers(struct gl_context *gc);<br>
extern struct _glapi_table *<br>
_mesa_get_dispatch(struct gl_context *ctx);<br>
<br>
+extern void<br>
+_mesa_set_context_lost_dispatch(struct gl_context *ctx);<br>
<br>
extern GLboolean<br>
_mesa_valid_to_render(struct gl_context *ctx, const char *where);<br>
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h<br>
index a809023..a30e729 100644<br>
--- a/src/mesa/main/extensions_table.h<br>
+++ b/src/mesa/main/extensions_table.h<br>
@@ -279,6 +279,7 @@ EXT(INTEL_performance_query , INTEL_performance_query<br>
EXT(KHR_context_flush_control , dummy_true , GLL, GLC, x , ES2, 2014)<br>
EXT(KHR_debug , dummy_true , GLL, GLC, 11, ES2, 2012)<br>
EXT(KHR_robust_buffer_access_behavior , ARB_robust_buffer_access_behavior , GLL, GLC, x , ES2, 2014)<br>
+EXT(KHR_robustness , KHR_robustness , GLL, GLC, 11, ES2, 2012)<br>
EXT(KHR_texture_compression_astc_hdr , KHR_texture_compression_astc_hdr , GLL, GLC, x , ES2, 2012)<br>
EXT(KHR_texture_compression_astc_ldr , KHR_texture_compression_astc_ldr , GLL, GLC, x , ES2, 2012)<br>
<br>
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c<br>
index 92f8a38..125b03a 100644<br>
--- a/src/mesa/main/getstring.c<br>
+++ b/src/mesa/main/getstring.c<br>
@@ -31,7 +31,8 @@<br>
#include "enums.h"<br>
#include "extensions.h"<br>
#include "mtypes.h"<br>
-<br>
+#include "macros.h"<br>
+#include "main/dispatch.h" /* for _gloffset_COUNT */<br>
<br>
/**<br>
* Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.<br>
@@ -310,6 +311,82 @@ _mesa_GetError( void )<br>
return e;<br>
}<br>
<br>
+static void<br>
+_context_lost_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length,<br>
+ GLint *values)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ if (ctx)<br>
+ _mesa_error(ctx, GL_CONTEXT_LOST, "GetSynciv(invalid call)");<br>
+<br>
+ if (pname == GL_SYNC_STATUS && bufSize >= 1)<br>
+ *values = GL_SIGNALED;<br>
+}<br>
+<br>
+static void<br>
+_context_lost_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ if (ctx)<br>
+ _mesa_error(ctx, GL_CONTEXT_LOST, "GetQueryObjectuiv(context lost)");<br>
+<br>
+ if (pname == GL_QUERY_RESULT_AVAILABLE)<br>
+ *params = GL_TRUE;<br>
+}<br>
+<br>
+static int<br>
+context_lost_nop_handler(void)<br>
+{<br>
+ GET_CURRENT_CONTEXT(ctx);<br>
+ if (ctx)<br>
+ _mesa_error(ctx, GL_CONTEXT_LOST, "context lost");<br>
+<br>
+ return 0;<br>
+}<br>
+<br>
+void<br>
+_mesa_set_context_lost_dispatch(struct gl_context *ctx)<br>
+{<br>
+ if (ctx->ContextLost == NULL) {<br>
+ int numEntries = MAX2(_glapi_get_dispatch_table_size(), _gloffset_COUNT);<br>
+<br>
+ ctx->ContextLost = malloc(numEntries * sizeof(_glapi_proc));<br>
+ if (!ctx->ContextLost)<br>
+ return;<br>
+<br>
+ _glapi_proc *entry = (_glapi_proc *) ctx->ContextLost;<br>
+ unsigned i;<br>
+ for (i = 0; i < numEntries; i++)<br>
+ entry[i] = (_glapi_proc) context_lost_nop_handler;<br>
+<br>
+ /* The ARB_robustness specification says:<br>
+ *<br>
+ * "* GetError and GetGraphicsResetStatus behave normally following a<br>
+ * graphics reset, so that the application can determine a reset<br>
+ * has occurred, and when it is safe to destroy and recreate the<br>
+ * context.<br>
+ *<br>
+ * * Any commands which might cause a polling application to block<br>
+ * indefinitely will generate a CONTEXT_LOST error, but will also<br>
+ * return a value indicating completion to the application. Such<br>
+ * commands include:<br>
+ *<br>
+ * + GetSynciv with <pname> SYNC_STATUS ignores the other<br>
+ * parameters and returns SIGNALED in <values>.<br>
+ *<br>
+ * + GetQueryObjectuiv with <pname> QUERY_RESULT_AVAILABLE<br>
+ * ignores the other parameters and returns TRUE in <params>."<br>
+ */<br>
+ SET_GetError(ctx->ContextLost, _mesa_GetError);<br>
+ SET_GetGraphicsResetStatusARB(ctx->ContextLost, _mesa_GetGraphicsResetStatusARB);<br>
+ SET_GetSynciv(ctx->ContextLost, _context_lost_GetSynciv);<br>
+ SET_GetQueryObjectuiv(ctx->ContextLost, _context_lost_GetQueryObjectuiv);<br>
+ }<br>
+<br>
+ ctx->CurrentDispatch = ctx->ContextLost;<br>
+ _glapi_set_dispatch(ctx->CurrentDispatch);<br>
+}<br>
+<br>
/**<br>
* Returns an error code specified by GL_ARB_robustness, or GL_NO_ERROR.<br>
* \return current context status<br>
@@ -358,6 +435,9 @@ _mesa_GetGraphicsResetStatusARB( void )<br>
mtx_unlock(&ctx->Shared->Mutex);<br>
}<br>
<br>
+ if (status != GL_NO_ERROR)<br>
+ _mesa_set_context_lost_dispatch(ctx);<br>
+<br>
if (!ctx->Driver.GetGraphicsResetStatus && (MESA_VERBOSE & VERBOSE_API))<br>
_mesa_debug(ctx,<br>
"glGetGraphicsResetStatusARB always returns GL_NO_ERROR "<br>
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h<br>
index b7b3ede..e16663d 100644<br>
--- a/src/mesa/main/mtypes.h<br>
+++ b/src/mesa/main/mtypes.h<br>
@@ -3899,6 +3899,7 @@ struct gl_extensions<br>
GLboolean ATI_separate_stencil;<br>
GLboolean GREMEDY_string_marker;<br>
GLboolean INTEL_performance_query;<br>
+ GLboolean KHR_robustness;<br>
GLboolean KHR_texture_compression_astc_hdr;<br>
GLboolean KHR_texture_compression_astc_ldr;<br>
GLboolean MESA_pack_invert;<br>
@@ -4302,7 +4303,11 @@ struct gl_context<br>
*/<br>
struct _glapi_table *BeginEnd;<br>
/**<br>
- * Tracks the current dispatch table out of the 3 above, so that it can be<br>
+ * Dispatch table for when a graphics reset has happened.<br>
+ */<br>
+ struct _glapi_table *ContextLost;<br>
+ /**<br>
+ * Tracks the current dispatch table out of the 4 above, so that it can be<br>
* re-set on glXMakeCurrent().<br>
*/<br>
struct _glapi_table *CurrentDispatch;<br>
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp<br>
index c85bc54..24f1d87 100644<br>
--- a/src/mesa/main/tests/dispatch_sanity.cpp<br>
+++ b/src/mesa/main/tests/dispatch_sanity.cpp<br>
@@ -852,6 +852,11 @@ const struct function common_desktop_functions_possible[] = {<br>
// { "glTextureStorage3DMultisampleEXT", 43, -1 }, // XXX: Add to xml<br>
<br>
/* GL 4.5 */<br>
+ { "glGetGraphicsResetStatus", 45, -1 },<br>
+ { "glReadnPixels", 45, -1 },<br>
+ { "glGetnUniformfv", 45, -1 },<br>
+ { "glGetnUniformiv", 45, -1 },<br>
+ { "glGetnUniformuiv", 45, -1 },<br>
{ "glMemoryBarrierByRegion", 45, -1 },<br>
<br>
/* GL_ARB_internalformat_query */<br>
@@ -2306,6 +2311,13 @@ const struct function gles2_functions_possible[] = {<br>
/* GL_EXT_polygon_offset_clamp */<br>
{ "glPolygonOffsetClampEXT", 11, -1 },<br>
<br>
+ /* GL_KHR_robustness */<br>
+ { "glGetGraphicsResetStatusKHR", 20, -1 },<br>
+ { "glReadnPixelsKHR", 20, -1 },<br>
+ { "glGetnUniformfvKHR", 20, -1 },<br>
+ { "glGetnUniformivKHR", 20, -1 },<br>
+ { "glGetnUniformuivKHR", 20, -1 },<br>
+<br>
{ NULL, 0, -1 }<br>
};<br>
<br>
--<br>
2.5.0<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div>