This allows LunarG and others without the NVIDIA XGL driver to use the nulldrv
on Windows.
xglNvidia += "\\xgl_nvidia.dll";
HMODULE module = LoadLibrary(xglNvidia.c_str());
if (!module) {
+ std::string xglNulldrv = getenv("LIBXGL_DRIVERS_PATH");
+ xglNulldrv += "\\xgl_nulldrv.dll";
+ module = LoadLibrary(xglNulldrv.c_str());
+ }
+ if (!module) {
return 0;
}
xglCreateInstance
xglEnumerateGpus
xglDestroyInstance
+ xcbCreateWindow
+ xcbDestroyWindow
+ xcbGetMessage
+ xcbQueuePresent
{
NULLDRV_LOG_FUNC;
}
+
+ICD_EXPORT void* xcbCreateWindow(
+ uint16_t width,
+ uint16_t height)
+{
+ static uint32_t window; // Kludge to the max
+ NULLDRV_LOG_FUNC;
+ return &window;
+}
+
+// May not be needed, if we stub out stuf in tri.c
+ICD_EXPORT void xcbDestroyWindow()
+{
+ NULLDRV_LOG_FUNC;
+}
+
+ICD_EXPORT int xcbGetMessage(void *msg)
+{
+ NULLDRV_LOG_FUNC;
+ return 0;
+}
+
+ICD_EXPORT XGL_RESULT xcbQueuePresent(void *queue, void *image, void* fence)
+{
+ return XGL_SUCCESS;
+}