intel: an XGL_INSTANCE is not an XGL_OBJECT
It should not embed an intel_obj nor be created by intel_base_create(). Note
that there is an issue with both the old and new code: the allocation of
intel_instance uses the default allocator instead of the app-provided
allocator. It will be fixed later.
diff --git a/icd/intel/instance.h b/icd/intel/instance.h
new file mode 100644
index 0000000..3971f16
--- /dev/null
+++ b/icd/intel/instance.h
@@ -0,0 +1,43 @@
+/*
+ * XGL
+ *
+ * Copyright (C) 2015 LunarG, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Chia-I Wu <olv@lunarg.com>
+ */
+
+#ifndef INSTANCE_H
+#define INSTANCE_H
+
+#include "intel.h"
+
+struct intel_instance {
+ /* the loader expects a "void *" at the beginning */
+ void *loader_data;
+};
+
+static inline struct intel_instance *intel_instance(XGL_INSTANCE instance)
+{
+ return (struct intel_instance *) instance;
+}
+
+#endif /* INSTANCE_H */