[gtk+/wip/otte/rendernode: 94/110] vulkan: Add GskVulkanBlendPipeline
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/rendernode: 94/110] vulkan: Add GskVulkanBlendPipeline
- Date: Mon, 19 Dec 2016 04:52:07 +0000 (UTC)
commit 441c31220624ed961e1278036b1ba95f8ac39198
Author: Benjamin Otte <otte redhat com>
Date: Sun Dec 18 00:57:37 2016 +0100
vulkan: Add GskVulkanBlendPipeline
So far that's just a simple pipeline that doesn't do anything.
gsk/Makefile.am | 2 +
gsk/gskvulkanblendpipeline.c | 37 +++++++++++++++++++++++++++++++++++
gsk/gskvulkanblendpipelineprivate.h | 22 ++++++++++++++++++++
gsk/gskvulkanpipeline.c | 6 +++-
gsk/gskvulkanpipelineprivate.h | 3 +-
gsk/gskvulkanrender.c | 7 +++--
6 files changed, 71 insertions(+), 6 deletions(-)
---
diff --git a/gsk/Makefile.am b/gsk/Makefile.am
index beadbf3..5b41940 100644
--- a/gsk/Makefile.am
+++ b/gsk/Makefile.am
@@ -24,6 +24,7 @@ noinst_LTLIBRARIES =
if HAVE_VULKAN
gsk_private_vulan_source_h = \
+ gskvulkanblendpipelineprivate.h \
gskvulkanbufferprivate.h \
gskvulkancommandpoolprivate.h \
gskvulkanimageprivate.h \
@@ -35,6 +36,7 @@ gsk_private_vulan_source_h = \
gskvulkanrenderpassprivate.h \
gskvulkanshaderprivate.h
gsk_private_vulkan_source_c = \
+ gskvulkanblendpipeline.c \
gskvulkanbuffer.c \
gskvulkancommandpool.c \
gskvulkanimage.c \
diff --git a/gsk/gskvulkanblendpipeline.c b/gsk/gskvulkanblendpipeline.c
new file mode 100644
index 0000000..9445be7
--- /dev/null
+++ b/gsk/gskvulkanblendpipeline.c
@@ -0,0 +1,37 @@
+#include "config.h"
+
+#include "gskvulkanblendpipelineprivate.h"
+
+struct _GskVulkanBlendPipeline
+{
+ GObject parent_instance;
+};
+
+G_DEFINE_TYPE (GskVulkanBlendPipeline, gsk_vulkan_blend_pipeline, G_TYPE_OBJECT)
+
+static void
+gsk_vulkan_blend_pipeline_finalize (GObject *gobject)
+{
+ //GskVulkanBlendPipeline *self = GSK_VULKAN_BLEND_PIPELINE (gobject);
+
+ G_OBJECT_CLASS (gsk_vulkan_blend_pipeline_parent_class)->finalize (gobject);
+}
+
+static void
+gsk_vulkan_blend_pipeline_class_init (GskVulkanBlendPipelineClass *klass)
+{
+ G_OBJECT_CLASS (klass)->finalize = gsk_vulkan_blend_pipeline_finalize;
+}
+
+static void
+gsk_vulkan_blend_pipeline_init (GskVulkanBlendPipeline *self)
+{
+}
+
+GskVulkanPipeline *
+gsk_vulkan_blend_pipeline_new (GskVulkanPipelineLayout *layout,
+ const char *shader_name,
+ VkRenderPass render_pass)
+{
+ return gsk_vulkan_pipeline_new (GSK_TYPE_VULKAN_BLEND_PIPELINE, layout, shader_name, render_pass);
+}
diff --git a/gsk/gskvulkanblendpipelineprivate.h b/gsk/gskvulkanblendpipelineprivate.h
new file mode 100644
index 0000000..23a54f9
--- /dev/null
+++ b/gsk/gskvulkanblendpipelineprivate.h
@@ -0,0 +1,22 @@
+#ifndef __GSK_VULKAN_BLEND_PIPELINE_PRIVATE_H__
+#define __GSK_VULKAN_BLEND_PIPELINE_PRIVATE_H__
+
+#include <gdk/gdk.h>
+
+#include "gskvulkanpipelineprivate.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GskVulkanBlendPipelineLayout GskVulkanBlendPipelineLayout;
+
+#define GSK_TYPE_VULKAN_BLEND_PIPELINE (gsk_vulkan_blend_pipeline_get_type ())
+
+G_DECLARE_FINAL_TYPE (GskVulkanBlendPipeline, gsk_vulkan_blend_pipeline, GSK, VULKAN_BLEND_PIPELINE,
GskVulkanPipeline)
+
+GskVulkanPipeline * gsk_vulkan_blend_pipeline_new (GskVulkanPipelineLayout *
layout,
+ const char
*shader_name,
+ VkRenderPass
render_pass);
+
+G_END_DECLS
+
+#endif /* __GSK_VULKAN_BLEND_PIPELINE_PRIVATE_H__ */
diff --git a/gsk/gskvulkanpipeline.c b/gsk/gskvulkanpipeline.c
index 9d9d098..cd9b629 100644
--- a/gsk/gskvulkanpipeline.c
+++ b/gsk/gskvulkanpipeline.c
@@ -63,7 +63,8 @@ gsk_vulkan_pipeline_init (GskVulkanPipeline *self)
}
GskVulkanPipeline *
-gsk_vulkan_pipeline_new (GskVulkanPipelineLayout *layout,
+gsk_vulkan_pipeline_new (GType pipeline_type,
+ GskVulkanPipelineLayout *layout,
const char *shader_name,
VkRenderPass render_pass)
{
@@ -72,11 +73,12 @@ gsk_vulkan_pipeline_new (GskVulkanPipelineLayout *layout,
VkDevice device;
+ g_return_val_if_fail (!g_type_is_a (pipeline_type, GSK_TYPE_VULKAN_PIPELINE), NULL);
g_return_val_if_fail (layout != NULL, NULL);
g_return_val_if_fail (shader_name != NULL, NULL);
g_return_val_if_fail (render_pass != VK_NULL_HANDLE, NULL);
- self = g_object_new (GSK_TYPE_VULKAN_PIPELINE, NULL);
+ self = g_object_new (pipeline_type, NULL);
priv = gsk_vulkan_pipeline_get_instance_private (self);
diff --git a/gsk/gskvulkanpipelineprivate.h b/gsk/gskvulkanpipelineprivate.h
index 8c1548d..1f1ad1a 100644
--- a/gsk/gskvulkanpipelineprivate.h
+++ b/gsk/gskvulkanpipelineprivate.h
@@ -41,7 +41,8 @@ VkDescriptorSetLayout gsk_vulkan_pipeline_layout_get_descriptor_set_la
(GskVulkanPipelineLayout
*self);
-GskVulkanPipeline * gsk_vulkan_pipeline_new (GskVulkanPipelineLayout
*layout,
+GskVulkanPipeline * gsk_vulkan_pipeline_new (GType
pipeline_type,
+ GskVulkanPipelineLayout
*layout,
const char
*shader_name,
VkRenderPass
render_pass);
diff --git a/gsk/gskvulkanrender.c b/gsk/gskvulkanrender.c
index 838ea61..ec7a5b9 100644
--- a/gsk/gskvulkanrender.c
+++ b/gsk/gskvulkanrender.c
@@ -3,6 +3,7 @@
#include "gskvulkanrenderprivate.h"
#include "gskrendererprivate.h"
+#include "gskvulkanblendpipelineprivate.h"
#include "gskvulkanbufferprivate.h"
#include "gskvulkancommandpoolprivate.h"
#include "gskvulkanpipelineprivate.h"
@@ -298,9 +299,9 @@ gsk_vulkan_render_get_pipeline (GskVulkanRender *self,
if (self->pipelines[type] == NULL)
{
- self->pipelines[type] = gsk_vulkan_pipeline_new (self->layout,
- pipeline_info[type].name,
- self->render_pass);
+ self->pipelines[type] = gsk_vulkan_blend_pipeline_new (self->layout,
+ pipeline_info[type].name,
+ self->render_pass);
}
return self->pipelines[type];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]