intel: Add new APIs for Tiler GPU support
The new APIs create objects but don't do anything yet so they are just a shell.
diff --git a/icd/intel/CMakeLists.txt b/icd/intel/CMakeLists.txt
index cabb959..9a0773b 100644
--- a/icd/intel/CMakeLists.txt
+++ b/icd/intel/CMakeLists.txt
@@ -22,6 +22,7 @@
intel.c
intel_gpa.c
event.c
+ fb.c
fence.c
format.c
gpu.c
diff --git a/icd/intel/fb.c b/icd/intel/fb.c
new file mode 100644
index 0000000..174e47c
--- /dev/null
+++ b/icd/intel/fb.c
@@ -0,0 +1,85 @@
+/*
+ * XGL
+ *
+ * Copyright (C) 2014 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.
+ *
+ */
+
+#include "dev.h"
+#include "obj.h"
+#include "fb.h"
+
+XGL_RESULT intel_fb_create(struct intel_dev *dev,
+ const XGL_FRAMEBUFFER_CREATE_INFO* info,
+ struct intel_framebuffer ** fb_ret)
+{
+ struct intel_framebuffer *fb;
+ fb = (struct intel_framebuffer *) intel_base_create(dev, sizeof(*fb),
+ dev->base.dbg, XGL_DBG_OBJECT_FRAMEBUFFER, info, 0);
+ if (!fb)
+ return XGL_ERROR_OUT_OF_MEMORY;
+ //todo
+
+ *fb_ret = fb;
+
+ return XGL_SUCCESS;
+
+}
+
+XGL_RESULT intel_rp_create(struct intel_dev *dev,
+ const XGL_RENDER_PASS_CREATE_INFO* info,
+ struct intel_render_pass** rp_ret)
+{
+ struct intel_render_pass *rp;
+ rp = (struct intel_render_pass *) intel_base_create(dev, sizeof(*rp),
+ dev->base.dbg, XGL_DBG_OBJECT_RENDER_PASS, info, 0);
+ if (!rp)
+ return XGL_ERROR_OUT_OF_MEMORY;
+ //todo
+
+ *rp_ret = rp;
+
+ return XGL_SUCCESS;
+}
+
+XGL_RESULT XGLAPI intelCreateFramebuffer(
+ XGL_DEVICE device,
+ const XGL_FRAMEBUFFER_CREATE_INFO* info,
+ XGL_FRAMEBUFFER* fb_ret)
+{
+ struct intel_dev *dev = intel_dev(device);
+
+ return intel_fb_create(dev, info, (struct intel_framebuffer **) fb_ret);
+}
+
+
+XGL_RESULT XGLAPI intelCreateRenderPass(
+ XGL_DEVICE device,
+ const XGL_RENDER_PASS_CREATE_INFO* info,
+ XGL_RENDER_PASS* rp_ret)
+{
+ struct intel_dev *dev = intel_dev(device);
+
+ return intel_rp_create(dev, info, (struct intel_render_pass **) rp_ret);
+}
+
+
+
diff --git a/icd/intel/fb.h b/icd/intel/fb.h
new file mode 100644
index 0000000..6b05097
--- /dev/null
+++ b/icd/intel/fb.h
@@ -0,0 +1,45 @@
+/*
+ * XGL
+ *
+ * Copyright (C) 2014 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.
+ *
+ */
+#pragma once
+
+struct intel_framebuffer {
+ struct intel_base base;
+
+};
+
+struct intel_render_pass {
+ struct intel_base base;
+
+};
+
+XGL_RESULT XGLAPI intelCreateFramebuffer(
+ XGL_DEVICE device,
+ const XGL_FRAMEBUFFER_CREATE_INFO* pCreateInfo,
+ XGL_FRAMEBUFFER* pFramebuffer);
+
+XGL_RESULT XGLAPI intelCreateRenderPass(
+ XGL_DEVICE device,
+ const XGL_RENDER_PASS_CREATE_INFO* pCreateInfo,
+ XGL_RENDER_PASS* pRenderPass);
diff --git a/icd/intel/obj.c b/icd/intel/obj.c
index 3ee7851..0c54e3c 100644
--- a/icd/intel/obj.c
+++ b/icd/intel/obj.c
@@ -157,6 +157,14 @@
assert(info.header->struct_type == XGL_STRUCTURE_TYPE_SHADER_CREATE_INFO);
shallow_copy = sizeof(XGL_SHADER_CREATE_INFO);
break;
+ case XGL_DBG_OBJECT_FRAMEBUFFER:
+ assert(info.header->struct_type == XGL_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO);
+ shallow_copy = sizeof(XGL_FRAMEBUFFER_CREATE_INFO);
+ break;
+ case XGL_DBG_OBJECT_RENDER_PASS:
+ assert(info.header->struct_type == XGL_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO);
+ shallow_copy = sizeof(XGL_RENDER_PASS_CREATE_INFO);
+ break;
default:
// log debug message regarding invalid struct_type?
intel_dev_log(dbg->dev, XGL_DBG_MSG_ERROR,