#include <xgl.h>
#include <xglDbg.h>
-typedef XGL_RESULT (*LoadT)();
-typedef XGL_RESULT (*UnloadT)();
typedef XGL_RESULT (XGLAPI *InitAndEnumerateGpusT)(const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, XGL_UINT maxGpus, XGL_UINT* pGpuCount, XGL_PHYSICAL_GPU* pGpus);
typedef XGL_RESULT (XGLAPI *DbgRegisterMsgCallbackT)(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, XGL_VOID* pUserData);
typedef XGL_RESULT (XGLAPI *DbgUnregisterMsgCallbackT)(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback);
struct loader_icd {
void *handle;
- LoadT Load;
- UnloadT Unload;
InitAndEnumerateGpusT InitAndEnumerateGpus;
DbgRegisterMsgCallbackT DbgRegisterMsgCallback;
DbgUnregisterMsgCallbackT DbgUnregisterMsgCallback;
static void
loader_icd_destroy(struct loader_icd *icd)
{
- icd->Unload();
dlclose(icd->handle);
free(icd);
}
return NULL; \
} \
} while (0)
- LOOKUP(icd, Load);
- LOOKUP(icd, Unload);
LOOKUP(icd, InitAndEnumerateGpus);
LOOKUP(icd, DbgRegisterMsgCallback);
LOOKUP(icd, DbgUnregisterMsgCallback);
icd = loader_icd_create(icd_library);
if (icd) {
- if (XGL_SUCCESS == icd->Load() &&
- XGL_SUCCESS == loader_icd_set_global_options(icd) &&
+ if (XGL_SUCCESS == loader_icd_set_global_options(icd) &&
XGL_SUCCESS == loader_icd_register_msg_callbacks(icd)) {
/* prepend to the list */
icd->next = loader.icds;