summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-12-18 05:59:56 +0100
committerBenjamin Otte <otte@redhat.com>2016-12-20 18:01:11 +0100
commit4c74695a859b2826bced79af71c316ff673dca7a (patch)
tree20aef42ae7b577b1ff2987a109fcfa8996117385 /gsk
parent5dfb74c70cafc2e7fad980646a97dc13a27220aa (diff)
downloadgtk+-4c74695a859b2826bced79af71c316ff673dca7a.tar.gz
vulkan: Don't pass texture coordinates to the color pipeline
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gskvulkancolorpipeline.c22
-rw-r--r--gsk/resources/vulkan/color.frag.glsl2
-rw-r--r--gsk/resources/vulkan/color.frag.spvbin892 -> 804 bytes
-rw-r--r--gsk/resources/vulkan/color.vert.glsl4
-rw-r--r--gsk/resources/vulkan/color.vert.spvbin1104 -> 948 bytes
5 files changed, 7 insertions, 21 deletions
diff --git a/gsk/gskvulkancolorpipeline.c b/gsk/gskvulkancolorpipeline.c
index b7dc8f4ccb..6702537896 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 952f9b7f21..fba9e47120 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 45ffde52a7..beee876b17 100644
--- a/gsk/resources/vulkan/color.frag.spv
+++ b/gsk/resources/vulkan/color.frag.spv
Binary files differ
diff --git a/gsk/resources/vulkan/color.vert.glsl b/gsk/resources/vulkan/color.vert.glsl
index 2522b7e0ef..849d5cd517 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 3deee1c8e2..a7ca96a425 100644
--- a/gsk/resources/vulkan/color.vert.spv
+++ b/gsk/resources/vulkan/color.vert.spv
Binary files differ