gallium: add PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET
authorMarek Olšák <marek.olsak@amd.com>
Fri, 2 Nov 2018 20:08:26 +0000 (16:08 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 9 Nov 2018 19:55:04 +0000 (14:55 -0500)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_manager.c

index dacedf5b936473ec522be86300d32ee86757c69e..693f041b1da928a301c34d31f91e88eb45a5ac25 100644 (file)
@@ -401,6 +401,9 @@ enum pipe_flush_flags
  */
 #define PIPE_CONTEXT_LOW_PRIORITY      (1 << 5)
 
+/** Stop execution if the device is reset. */
+#define PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET (1 << 6)
+
 /**
  * Flags for pipe_context::memory_barrier.
  */
index ceb48dd4903c241d8fb5ff72d9d42b445b8adccc..690d5bc23136f288e2bafb4454a824ed20aadbee 100644 (file)
@@ -888,6 +888,9 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
    else if (attribs->flags & ST_CONTEXT_FLAG_HIGH_PRIORITY)
       ctx_flags |= PIPE_CONTEXT_HIGH_PRIORITY;
 
+   if (attribs->flags & ST_CONTEXT_FLAG_RESET_NOTIFICATION_ENABLED)
+      ctx_flags |= PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET;
+
    pipe = smapi->screen->context_create(smapi->screen, NULL, ctx_flags);
    if (!pipe) {
       *error = ST_CONTEXT_ERROR_NO_MEMORY;