[Mesa-dev] [PATCH v2 3/6] st/mesa: extract conversion from pipe_reset_status to GLenum
Nicolai Hähnle
nhaehnle at gmail.com
Tue Oct 4 08:11:21 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle 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
@@ -134,49 +134,56 @@ static void st_glFinish(struct gl_context *ctx)
struct st_context *st = st_context(ctx);
st_finish(st);
if (is_front_buffer_dirty(st)) {
display_front_buffer(st);
}
}
-/**
- * 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;
case PIPE_GUILTY_CONTEXT_RESET:
return GL_GUILTY_CONTEXT_RESET_ARB;
case PIPE_INNOCENT_CONTEXT_RESET:
return GL_INNOCENT_CONTEXT_RESET_ARB;
case PIPE_UNKNOWN_CONTEXT_RESET:
return GL_UNKNOWN_CONTEXT_RESET_ARB;
default:
assert(0);
return GL_NO_ERROR;
}
}
+/**
+ * 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)
{
functions->Flush = st_glFlush;
functions->Finish = st_glFinish;
if (screen->get_param(screen, PIPE_CAP_DEVICE_RESET_STATUS_QUERY))
functions->GetGraphicsResetStatus = st_get_graphics_reset_status;
/* Windows opengl32.dll calls glFinish prior to every swapbuffers.
--
2.7.4
More information about the mesa-dev
mailing list