[Bf-blender-cvs] [45e6ca36615] blender-v2.90-release: Cleanup: Stop accessing gpu_batch_presets_reset()

Dalai Felinto noreply at git.blender.org
Thu Aug 6 16:44:08 CEST 2020


Commit: 45e6ca36615fe9a720c9f25343556326fcbd5952
Author: Dalai Felinto
Date:   Thu Aug 6 14:23:39 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rB45e6ca36615fe9a720c9f25343556326fcbd5952

Cleanup: Stop accessing gpu_batch_presets_reset()

The current code is accessing this from outside the gpu "namespace". As
such it should be accessing GPU_ functions, not gpu_ functions.

This is also a place to centralize the XXX message that will be
addressed upon refactor. So we can reuse this call in other places that
need the same temporary workaround.

Groundwork for upcoming fix (D8472)

===================================================================

M	source/blender/editors/space_image/space_image.c
M	source/blender/gpu/GPU_batch_presets.h
M	source/blender/gpu/intern/gpu_batch_presets.c

===================================================================

diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index d7d85112497..1799fc10c76 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -643,9 +643,7 @@ static void image_main_region_draw(const bContext *C, ARegion *region)
   // View2DScrollers *scrollers;
   float col[3];
 
-  /* XXX This is in order to draw UI batches with the DRW
-   * old context since we now use it for drawing the entire area. */
-  gpu_batch_presets_reset();
+  GPU_batch_presets_reset();
 
   GPUViewport *viewport = region->draw_buffer->viewport;
   DefaultFramebufferList *fbl = GPU_viewport_framebuffer_list_get(viewport);
diff --git a/source/blender/gpu/GPU_batch_presets.h b/source/blender/gpu/GPU_batch_presets.h
index eb803333d98..38de21e7955 100644
--- a/source/blender/gpu/GPU_batch_presets.h
+++ b/source/blender/gpu/GPU_batch_presets.h
@@ -50,6 +50,8 @@ bool gpu_batch_presets_unregister(struct GPUBatch *preset_batch);
 void gpu_batch_presets_reset(void);
 void gpu_batch_presets_exit(void);
 
+void GPU_batch_presets_reset(void);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/gpu/intern/gpu_batch_presets.c b/source/blender/gpu/intern/gpu_batch_presets.c
index d16edab5ac9..7f842d4d508 100644
--- a/source/blender/gpu/intern/gpu_batch_presets.c
+++ b/source/blender/gpu/intern/gpu_batch_presets.c
@@ -406,4 +406,17 @@ void gpu_batch_presets_exit(void)
   BLI_mutex_end(&g_presets_3d.mutex);
 }
 
+/**
+ * This function only needs to be accessed externally because
+ * we are drawing UI batches with the DRW old context.
+ *
+ * And now we use it for drawing the entire area.
+ *
+ * XXX (Clément) - to cleanup in the upcoming 2.91 refactor.
+ **/
+void GPU_batch_presets_reset()
+{
+  gpu_batch_presets_reset();
+}
+
 /** \} */



More information about the Bf-blender-cvs mailing list