From 11e2ca4b70c960a40883ac3e24a4891acf85a594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 11 Jul 2023 11:08:06 +0200 Subject: [PATCH] GPU: Fix compilation warnings Warnings caused by 1978b4fc929b9b2973d974739a8b05268a404a60 --- source/blender/python/generic/bgl.c | 4 ++++ source/blender/windowmanager/intern/wm_window.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index c23ca0a3712..a7eeadbea64 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -40,6 +40,7 @@ static CLG_LogRef LOG = {"bgl"}; /** \name Local utility defines for wrapping OpenGL * \{ */ +#ifdef WITH_OPENGL_BACKEND static void report_deprecated_call(const char *function_name) { /* Only report first 10 deprecated calls. BGL is typically used inside an handler that is @@ -67,6 +68,7 @@ static void report_deprecated_call_to_user(void) G.opengl_deprecation_usage_detected = true; PyC_FileAndNum(&G.opengl_deprecation_usage_filename, &G.opengl_deprecation_usage_lineno); } +#endif /** \} */ @@ -713,6 +715,7 @@ Buffer *BGL_MakeBuffer(int type, int ndimensions, int *dimensions, void *initbuf return buffer; } +#ifdef WITH_OPENGL_BACKEND /* Custom converter function so we can support a buffer, an integer or NULL. * Many OpenGL API functions can accept both an actual pointer or an offset * into a buffer that is already bound. */ @@ -742,6 +745,7 @@ static int BGL_BufferOrOffsetConverter(PyObject *object, BufferOrOffset *buffer) PyErr_SetString(PyExc_TypeError, "expected a bgl.Buffer or None"); return 0; } +#endif #define MAX_DIMENSIONS 256 static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds) diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index ff2df8d858c..26f08d19223 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1760,6 +1760,7 @@ GHOST_TDrawingContextType wm_ghost_drawing_context_type(const eGPUBackendType gp return GHOST_kDrawingContextTypeOpenGL; #endif BLI_assert_unreachable(); + return GHOST_kDrawingContextTypeNone; case GPU_BACKEND_VULKAN: #ifdef WITH_VULKAN_BACKEND return GHOST_kDrawingContextTypeVulkan; @@ -1769,10 +1770,9 @@ GHOST_TDrawingContextType wm_ghost_drawing_context_type(const eGPUBackendType gp case GPU_BACKEND_METAL: #ifdef WITH_METAL_BACKEND return GHOST_kDrawingContextTypeMetal; -#else +#endif BLI_assert_unreachable(); return GHOST_kDrawingContextTypeNone; -#endif } /* Avoid control reaches end of non-void function compilation warning, which could be promoted