Mesa (master): st/mesa: extract conversion from pipe_reset_status to GLenum

Nicolai Hähnle nh at kemper.freedesktop.org
Wed Oct 5 13:54:09 UTC 2016


Module: Mesa
Branch: master
Commit: d856130025be12230ed84fc31fcf5691641f1952
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d856130025be12230ed84fc31fcf5691641f1952

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Fri Sep 30 13:02:00 2016 +0200

st/mesa: extract conversion from pipe_reset_status to GLenum

Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/mesa/state_tracker/st_cb_flush.c | 29 ++++++++++++++++++-----------
 1 file changed, 18 insertions(+), 11 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_flush.c b/src/mesa/state_tracker/st_cb_flush.c
index 5cab5a7..87c3d81 100644
--- a/src/mesa/state_tracker/st_cb_flush.c
+++ b/src/mesa/state_tracker/st_cb_flush.c
@@ -141,19 +141,9 @@ static void st_glFinish(struct gl_context *ctx)
 }
 
 
-/**
- * Query information about GPU resets observed by this context
- *
- * Called via \c dd_function_table::GetGraphicsResetStatus.
- */
 static GLenum
-st_get_graphics_reset_status(struct gl_context *ctx)
+gl_reset_status_from_pipe_reset_status(enum pipe_reset_status status)
 {
-   struct st_context *st = st_context(ctx);
-   enum pipe_reset_status status;
-
-   status = st->pipe->get_device_reset_status(st->pipe);
-
    switch (status) {
    case PIPE_NO_RESET:
       return GL_NO_ERROR;
@@ -170,6 +160,23 @@ st_get_graphics_reset_status(struct gl_context *ctx)
 }
 
 
+/**
+ * Query information about GPU resets observed by this context
+ *
+ * Called via \c dd_function_table::GetGraphicsResetStatus.
+ */
+static GLenum
+st_get_graphics_reset_status(struct gl_context *ctx)
+{
+   struct st_context *st = st_context(ctx);
+   enum pipe_reset_status status;
+
+   status = st->pipe->get_device_reset_status(st->pipe);
+
+   return gl_reset_status_from_pipe_reset_status(status);
+}
+
+
 void st_init_flush_functions(struct pipe_screen *screen,
                              struct dd_function_table *functions)
 {




More information about the mesa-commit mailing list