GPU: Fix compilation warnings

Warnings caused by 1978b4fc92
This commit is contained in:
Clément Foucault
2023-07-11 11:08:06 +02:00
parent 1978b4fc92
commit 11e2ca4b70
2 changed files with 6 additions and 2 deletions

View File

@@ -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)

View File

@@ -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