]> git.cworth.org Git - fips/blobdiff - context.c
stash
[fips] / context.c
index 3c58a60e6b2fbd76ca7a13dfaa3248f67fd43828..764e159f25cc9989722160bfc4cc6419d58bf979 100644 (file)
--- a/context.c
+++ b/context.c
@@ -68,6 +68,14 @@ context_destroy (context_t *ctx)
 void
 context_enter (fips_api_t api, void *system_context_id)
 {
+       /* Do nothing for a NULL system_context_id. (Don't ask me why,
+        * but Dota 2 likes to call MakeCurrent with a NULL context ID
+        * just before calling MakeCurrent with the same context it
+        * had been using before. We want to do nothing in this case.)
+        */
+       if (system_context_id == NULL)
+               return;
+
        /* Do nothing if the application is setting the same context
         * as is already current. */
        if (current_context && current_context->system_id == system_context_id)
@@ -91,7 +99,7 @@ context_leave (void)
        if (ctx == NULL)
                return;
 
-       metrics_destroy (ctx->metrics);
+       metrics_fini (ctx->metrics);
 }
 
 void
@@ -119,9 +127,15 @@ context_get_current_op (void)
 }
 
 void
-context_end_frame (void)
+context_end_frame_pre_swap (void)
+{
+       return metrics_end_frame_pre_swap (current_context->metrics);
+}
+
+void
+context_end_frame_post_swap (void)
 {
-       return metrics_end_frame (current_context->metrics);
+       return metrics_end_frame_post_swap (current_context->metrics);
 }
 
 /* Is the given extension available? */