[gtk+/wip/otte/rendernode: 97/100] vulkan: Don't pass texture coordinates to the color pipeline
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/rendernode: 97/100] vulkan: Don't pass texture coordinates to the color pipeline
- Date: Sun, 18 Dec 2016 06:36:50 +0000 (UTC)
commit b9d90bc7cec2d348e9e69e00ca6464c72ce71985
Author: Benjamin Otte <otte redhat com>
Date: Sun Dec 18 05:59:56 2016 +0100
vulkan: Don't pass texture coordinates to the color pipeline
gsk/gskvulkancolorpipeline.c | 22 +++++++---------------
gsk/resources/vulkan/color.frag.glsl | 2 --
gsk/resources/vulkan/color.frag.spv | Bin 892 -> 804 bytes
gsk/resources/vulkan/color.vert.glsl | 4 ----
gsk/resources/vulkan/color.vert.spv | Bin 1104 -> 948 bytes
5 files changed, 7 insertions(+), 21 deletions(-)
---
diff --git a/gsk/gskvulkancolorpipeline.c b/gsk/gskvulkancolorpipeline.c
index b7dc8f4..6702537 100644
--- a/gsk/gskvulkancolorpipeline.c
+++ b/gsk/gskvulkancolorpipeline.c
@@ -13,8 +13,6 @@ struct _GskVulkanVertex
{
float x;
float y;
- float tex_x;
- float tex_y;
};
G_DEFINE_TYPE (GskVulkanColorPipeline, gsk_vulkan_color_pipeline, GSK_TYPE_VULKAN_PIPELINE)
@@ -25,7 +23,7 @@ gsk_vulkan_color_pipeline_get_input_state_create_info (GskVulkanPipeline *self)
static const VkVertexInputBindingDescription vertexBindingDescriptions[] = {
{
.binding = 0,
- .stride = 4 * sizeof (float),
+ .stride = sizeof (GskVulkanVertex),
.inputRate = VK_VERTEX_INPUT_RATE_VERTEX
}
};
@@ -35,12 +33,6 @@ gsk_vulkan_color_pipeline_get_input_state_create_info (GskVulkanPipeline *self)
.binding = 0,
.format = VK_FORMAT_R32G32_SFLOAT,
.offset = 0,
- },
- {
- .location = 1,
- .binding = 0,
- .format = VK_FORMAT_R32G32_SFLOAT,
- .offset = 2 * sizeof (float),
}
};
static const VkPipelineVertexInputStateCreateInfo info = {
@@ -98,12 +90,12 @@ gsk_vulkan_color_pipeline_collect_vertex_data (GskVulkanColorPipeline *pipeline,
{
GskVulkanVertex *vertices = (GskVulkanVertex *) data;
- vertices[0] = (GskVulkanVertex) { rect->origin.x, rect->origin.y,
0.0, 0.0 };
- vertices[1] = (GskVulkanVertex) { rect->origin.x + rect->size.width, rect->origin.y,
1.0, 0.0 };
- vertices[2] = (GskVulkanVertex) { rect->origin.x, rect->origin.y + rect->size.height,
0.0, 1.0 };
- vertices[3] = (GskVulkanVertex) { rect->origin.x, rect->origin.y + rect->size.height,
0.0, 1.0 };
- vertices[4] = (GskVulkanVertex) { rect->origin.x + rect->size.width, rect->origin.y,
1.0, 0.0 };
- vertices[5] = (GskVulkanVertex) { rect->origin.x + rect->size.width, rect->origin.y + rect->size.height,
1.0, 1.0 };
+ vertices[0] = (GskVulkanVertex) { rect->origin.x, rect->origin.y };
+ vertices[1] = (GskVulkanVertex) { rect->origin.x + rect->size.width, rect->origin.y };
+ vertices[2] = (GskVulkanVertex) { rect->origin.x, rect->origin.y + rect->size.height };
+ vertices[3] = (GskVulkanVertex) { rect->origin.x, rect->origin.y + rect->size.height };
+ vertices[4] = (GskVulkanVertex) { rect->origin.x + rect->size.width, rect->origin.y };
+ vertices[5] = (GskVulkanVertex) { rect->origin.x + rect->size.width, rect->origin.y + rect->size.height };
}
gsize
diff --git a/gsk/resources/vulkan/color.frag.glsl b/gsk/resources/vulkan/color.frag.glsl
index 952f9b7..fba9e47 100644
--- a/gsk/resources/vulkan/color.frag.glsl
+++ b/gsk/resources/vulkan/color.frag.glsl
@@ -1,7 +1,5 @@
#version 420 core
-layout(location = 0) in vec2 inTexCoord;
-
layout(set = 0, binding = 0) uniform sampler2D inTexture;
layout(push_constant) uniform PushConstants {
diff --git a/gsk/resources/vulkan/color.frag.spv b/gsk/resources/vulkan/color.frag.spv
index 45ffde5..beee876 100644
Binary files a/gsk/resources/vulkan/color.frag.spv and b/gsk/resources/vulkan/color.frag.spv differ
diff --git a/gsk/resources/vulkan/color.vert.glsl b/gsk/resources/vulkan/color.vert.glsl
index 2522b7e..849d5cd 100644
--- a/gsk/resources/vulkan/color.vert.glsl
+++ b/gsk/resources/vulkan/color.vert.glsl
@@ -1,19 +1,15 @@
#version 420 core
layout(location = 0) in vec2 inPosition;
-layout(location = 1) in vec2 inTexCoord;
layout(push_constant) uniform PushConstants {
mat4 mvp;
} push;
-layout(location = 0) out vec2 outTexCoord;
-
out gl_PerVertex {
vec4 gl_Position;
};
void main() {
gl_Position = push.mvp * vec4 (inPosition, 0.0, 1.0);
- outTexCoord = inTexCoord;
}
diff --git a/gsk/resources/vulkan/color.vert.spv b/gsk/resources/vulkan/color.vert.spv
index 3deee1c..a7ca96a 100644
Binary files a/gsk/resources/vulkan/color.vert.spv and b/gsk/resources/vulkan/color.vert.spv differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]