diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c index 1dbea45076..a319c9c5dc 100644 --- a/gdk/gdkvulkancontext.c +++ b/gdk/gdkvulkancontext.c @@ -52,6 +52,7 @@ struct _GdkVulkanContextPrivate { GdkMemoryFormat gdk_format; } formats[4]; GdkMemoryDepth current_format; + GdkMemoryFormat offscreen_formats[4]; VkSwapchainKHR swapchain; VkSemaphore draw_semaphore; @@ -693,6 +694,11 @@ gdk_vulkan_context_real_init (GInitable *initable, if (!priv->vulkan_ref) return FALSE; + priv->offscreen_formats[GDK_MEMORY_U8] = GDK_MEMORY_B8G8R8A8_PREMULTIPLIED; + priv->offscreen_formats[GDK_MEMORY_U16] = GDK_MEMORY_R16G16B16A16_PREMULTIPLIED; + priv->offscreen_formats[GDK_MEMORY_FLOAT16] = GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED; + priv->offscreen_formats[GDK_MEMORY_FLOAT32] = GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED; + if (surface == NULL) { for (i = 0; i < G_N_ELEMENTS (priv->formats); i++) @@ -748,6 +754,7 @@ gdk_vulkan_context_real_init (GInitable *initable, { priv->formats[GDK_MEMORY_U8].vk_format = formats[i]; priv->formats[GDK_MEMORY_U8].gdk_format = GDK_MEMORY_B8G8R8A8_PREMULTIPLIED; + priv->offscreen_formats[GDK_MEMORY_U8] = GDK_MEMORY_B8G8R8A8_PREMULTIPLIED; }; break; @@ -827,6 +834,15 @@ out_surface: return FALSE; } +GdkMemoryFormat +gdk_vulkan_context_get_offscreen_format (GdkVulkanContext *context, + GdkMemoryDepth depth) +{ + GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context); + + return priv->offscreen_formats[depth]; +} + static void gdk_vulkan_context_initable_init (GInitableIface *iface) { @@ -1168,6 +1184,7 @@ gdk_display_create_vulkan_device (GdkDisplay *display, .descriptorBindingPartiallyBound = VK_TRUE, .descriptorBindingVariableDescriptorCount = VK_TRUE, .descriptorBindingSampledImageUpdateAfterBind = VK_TRUE, + .descriptorBindingStorageBufferUpdateAfterBind = VK_TRUE, } }, NULL, diff --git a/gdk/gdkvulkancontextprivate.h b/gdk/gdkvulkancontextprivate.h index 7a59485675..cb06efd73c 100644 --- a/gdk/gdkvulkancontextprivate.h +++ b/gdk/gdkvulkancontextprivate.h @@ -69,9 +69,12 @@ gdk_vulkan_handle_result (VkResult res, #define GDK_VK_CHECK(func, ...) gdk_vulkan_handle_result (func (__VA_ARGS__), G_STRINGIFY (func)) -gboolean gdk_display_ref_vulkan (GdkDisplay *display, - GError **error); -void gdk_display_unref_vulkan (GdkDisplay *display); +gboolean gdk_display_ref_vulkan (GdkDisplay *display, + GError **error); +void gdk_display_unref_vulkan (GdkDisplay *display); + +GdkMemoryFormat gdk_vulkan_context_get_offscreen_format (GdkVulkanContext *context, + GdkMemoryDepth depth); #else /* !GDK_RENDERING_VULKAN */ diff --git a/gsk/vulkan/gskvulkanbuffer.c b/gsk/vulkan/gskvulkanbuffer.c index 90bdf8b753..cd7b8a01cb 100644 --- a/gsk/vulkan/gskvulkanbuffer.c +++ b/gsk/vulkan/gskvulkanbuffer.c @@ -78,8 +78,8 @@ gsk_vulkan_buffer_new_map (GdkVulkanContext *context, { return gsk_vulkan_buffer_new_internal (context, size, - (mode & GSK_VULKAN_READ ? VK_BUFFER_USAGE_TRANSFER_SRC_BIT : 0) | - (mode & GSK_VULKAN_WRITE ? VK_BUFFER_USAGE_TRANSFER_DST_BIT : 0)); + (mode & GSK_VULKAN_READ ? VK_BUFFER_USAGE_TRANSFER_DST_BIT : 0) | + (mode & GSK_VULKAN_WRITE ? VK_BUFFER_USAGE_TRANSFER_SRC_BIT : 0)); } void diff --git a/gsk/vulkan/gskvulkanimage.c b/gsk/vulkan/gskvulkanimage.c index 030a3ac979..709584e02c 100644 --- a/gsk/vulkan/gskvulkanimage.c +++ b/gsk/vulkan/gskvulkanimage.c @@ -488,24 +488,6 @@ gsk_memory_format_get_fallback (GdkMemoryFormat format) } } -GdkMemoryFormat -gsk_render_node_get_preferred_vulkan_format (GskRenderNode *node) -{ - switch (gsk_render_node_get_preferred_depth (node)) - { - case GDK_MEMORY_U8: - return GDK_MEMORY_R8G8B8A8_PREMULTIPLIED; - case GDK_MEMORY_U16: - return GDK_MEMORY_R16G16B16A16_PREMULTIPLIED; - case GDK_MEMORY_FLOAT16: - return GDK_MEMORY_R16G16B16A16_FLOAT_PREMULTIPLIED; - case GDK_MEMORY_FLOAT32: - return GDK_MEMORY_R32G32B32A32_FLOAT_PREMULTIPLIED; - default: - g_return_val_if_reached (GDK_MEMORY_R8G8B8A8_PREMULTIPLIED); - } -} - static gboolean gsk_vulkan_context_supports_format (GdkVulkanContext *context, VkFormat format) diff --git a/gsk/vulkan/gskvulkanimageprivate.h b/gsk/vulkan/gskvulkanimageprivate.h index 25ab54ded4..401711fd9e 100644 --- a/gsk/vulkan/gskvulkanimageprivate.h +++ b/gsk/vulkan/gskvulkanimageprivate.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "gskvulkanbufferprivate.h" #include "gskvulkancommandpoolprivate.h" @@ -22,8 +21,6 @@ void gsk_vulkan_uploader_free (GskVulk void gsk_vulkan_uploader_reset (GskVulkanUploader *self); void gsk_vulkan_uploader_upload (GskVulkanUploader *self); -GdkMemoryFormat gsk_render_node_get_preferred_vulkan_format (GskRenderNode *node); - GskVulkanImage * gsk_vulkan_image_new_for_swapchain (GdkVulkanContext *context, VkImage image, VkFormat format, diff --git a/gsk/vulkan/gskvulkanrender.c b/gsk/vulkan/gskvulkanrender.c index bb4c0001f3..8f39b7a78c 100644 --- a/gsk/vulkan/gskvulkanrender.c +++ b/gsk/vulkan/gskvulkanrender.c @@ -41,6 +41,8 @@ #define GDK_ARRAY_NO_MEMSET 1 #include "gdk/gdkarrayimpl.c" +#define N_DESCRIPTOR_SETS 3 + struct _GskVulkanRender { GskRenderer *renderer; @@ -52,7 +54,7 @@ struct _GskVulkanRender GskVulkanCommandPool *command_pool; VkFence fence; - VkDescriptorSetLayout descriptor_set_layout; + VkDescriptorSetLayout descriptor_set_layouts[N_DESCRIPTOR_SETS]; VkPipelineLayout pipeline_layout; GskVulkanUploader *uploader; @@ -60,7 +62,7 @@ struct _GskVulkanRender GskDescriptorImageInfos descriptor_samplers; GskDescriptorBufferInfos descriptor_buffers; VkDescriptorPool descriptor_pool; - VkDescriptorSet descriptor_set; + VkDescriptorSet descriptor_sets[N_DESCRIPTOR_SETS]; GskVulkanPipeline *pipelines[GSK_VULKAN_N_PIPELINES]; GskVulkanImage *target; @@ -148,9 +150,9 @@ gsk_vulkan_render_new (GskRenderer *renderer, &(VkDescriptorPoolCreateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, .flags = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT, - .maxSets = 1, - .poolSizeCount = 3, - .pPoolSizes = (VkDescriptorPoolSize[3]) { + .maxSets = N_DESCRIPTOR_SETS, + .poolSizeCount = N_DESCRIPTOR_SETS, + .pPoolSizes = (VkDescriptorPoolSize[N_DESCRIPTOR_SETS]) { { .type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, .descriptorCount = DESCRIPTOR_POOL_MAXITEMS @@ -171,7 +173,7 @@ gsk_vulkan_render_new (GskRenderer *renderer, GSK_VK_CHECK (vkCreateDescriptorSetLayout, device, &(VkDescriptorSetLayoutCreateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, - .bindingCount = 3, + .bindingCount = 1, .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, .pBindings = (VkDescriptorSetLayoutBinding[3]) { { @@ -179,30 +181,12 @@ gsk_vulkan_render_new (GskRenderer *renderer, .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, .descriptorCount = DESCRIPTOR_POOL_MAXITEMS, .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT - }, - { - .binding = 1, - .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER, - .descriptorCount = DESCRIPTOR_POOL_MAXITEMS, - .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT - }, - { - .binding = 2, - .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, - .descriptorCount = DESCRIPTOR_POOL_MAXITEMS, - .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT - }, + } }, .pNext = &(VkDescriptorSetLayoutBindingFlagsCreateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, - .bindingCount = 3, - .pBindingFlags = (VkDescriptorBindingFlags[3]) { - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT - | VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT - | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, - VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT - | VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT - | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, + .bindingCount = 1, + .pBindingFlags = (VkDescriptorBindingFlags[1]) { VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT | VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, @@ -210,15 +194,65 @@ gsk_vulkan_render_new (GskRenderer *renderer, } }, NULL, - &self->descriptor_set_layout); + &self->descriptor_set_layouts[0]); + + GSK_VK_CHECK (vkCreateDescriptorSetLayout, device, + &(VkDescriptorSetLayoutCreateInfo) { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, + .bindingCount = 1, + .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, + .pBindings = (VkDescriptorSetLayoutBinding[1]) { + { + .binding = 0, + .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER, + .descriptorCount = DESCRIPTOR_POOL_MAXITEMS, + .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT + } + }, + .pNext = &(VkDescriptorSetLayoutBindingFlagsCreateInfo) { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, + .bindingCount = 1, + .pBindingFlags = (VkDescriptorBindingFlags[1]) { + VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT + | VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT + | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, + }, + } + }, + NULL, + &self->descriptor_set_layouts[1]); + + GSK_VK_CHECK (vkCreateDescriptorSetLayout, device, + &(VkDescriptorSetLayoutCreateInfo) { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, + .bindingCount = 1, + .flags = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT, + .pBindings = (VkDescriptorSetLayoutBinding[1]) { + { + .binding = 0, + .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, + .descriptorCount = DESCRIPTOR_POOL_MAXITEMS, + .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT + }, + }, + .pNext = &(VkDescriptorSetLayoutBindingFlagsCreateInfo) { + .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO, + .bindingCount = 1, + .pBindingFlags = (VkDescriptorBindingFlags[1]) { + VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT + | VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT + | VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, + }, + } + }, + NULL, + &self->descriptor_set_layouts[2]); GSK_VK_CHECK (vkCreatePipelineLayout, device, &(VkPipelineLayoutCreateInfo) { .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO, - .setLayoutCount = 1, - .pSetLayouts = (VkDescriptorSetLayout[1]) { - self->descriptor_set_layout - }, + .setLayoutCount = G_N_ELEMENTS (self->descriptor_set_layouts), + .pSetLayouts = self->descriptor_set_layouts, .pushConstantRangeCount = gsk_vulkan_push_constants_get_range_count (), .pPushConstantRanges = gsk_vulkan_push_constants_get_ranges () }, @@ -403,10 +437,18 @@ gsk_vulkan_render_get_pipeline (GskVulkanRender *self, return self->pipelines[type]; } -VkDescriptorSet -gsk_vulkan_render_get_descriptor_set (GskVulkanRender *self) +void +gsk_vulkan_render_bind_descriptor_sets (GskVulkanRender *self, + VkCommandBuffer command_buffer) { - return self->descriptor_set; + vkCmdBindDescriptorSets (command_buffer, + VK_PIPELINE_BIND_POINT_GRAPHICS, + self->pipeline_layout, + 0, + 3, + self->descriptor_sets, + 0, + NULL); } gsize @@ -537,11 +579,6 @@ gsk_vulkan_render_prepare_descriptor_sets (GskVulkanRender *self) gsk_vulkan_render_pass_reserve_descriptor_sets (pass, self); } - if (gsk_descriptor_image_infos_get_size (&self->descriptor_samplers) == 0 && - gsk_descriptor_image_infos_get_size (&self->descriptor_images) == 0 && - gsk_descriptor_buffer_infos_get_size (&self->descriptor_buffers) == 0) - return; - if (self->storage_buffer_memory) { gsk_vulkan_buffer_unmap (self->storage_buffer); @@ -553,26 +590,26 @@ gsk_vulkan_render_prepare_descriptor_sets (GskVulkanRender *self) &(VkDescriptorSetAllocateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO, .descriptorPool = self->descriptor_pool, - .descriptorSetCount = 1, - .pSetLayouts = &self->descriptor_set_layout, + .descriptorSetCount = N_DESCRIPTOR_SETS, + .pSetLayouts = self->descriptor_set_layouts, .pNext = &(VkDescriptorSetVariableDescriptorCountAllocateInfo) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO, - .descriptorSetCount = 1, - .pDescriptorCounts = (uint32_t[1]) { - gsk_descriptor_image_infos_get_size (&self->descriptor_images) - + gsk_descriptor_image_infos_get_size (&self->descriptor_samplers) - + gsk_descriptor_buffer_infos_get_size (&self->descriptor_buffers) + .descriptorSetCount = N_DESCRIPTOR_SETS, + .pDescriptorCounts = (uint32_t[N_DESCRIPTOR_SETS]) { + MAX (1, gsk_descriptor_image_infos_get_size (&self->descriptor_images)), + MAX (1, gsk_descriptor_image_infos_get_size (&self->descriptor_samplers)), + MAX (1, gsk_descriptor_buffer_infos_get_size (&self->descriptor_buffers)) } } }, - &self->descriptor_set); + self->descriptor_sets); n_descriptor_sets = 0; if (gsk_descriptor_image_infos_get_size (&self->descriptor_images) > 0) { descriptor_sets[n_descriptor_sets++] = (VkWriteDescriptorSet) { .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, - .dstSet = self->descriptor_set, + .dstSet = self->descriptor_sets[0], .dstBinding = 0, .dstArrayElement = 0, .descriptorCount = gsk_descriptor_image_infos_get_size (&self->descriptor_images), @@ -584,8 +621,8 @@ gsk_vulkan_render_prepare_descriptor_sets (GskVulkanRender *self) { descriptor_sets[n_descriptor_sets++] = (VkWriteDescriptorSet) { .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, - .dstSet = self->descriptor_set, - .dstBinding = 1, + .dstSet = self->descriptor_sets[1], + .dstBinding = 0, .dstArrayElement = 0, .descriptorCount = gsk_descriptor_image_infos_get_size (&self->descriptor_samplers), .descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER, @@ -596,8 +633,8 @@ gsk_vulkan_render_prepare_descriptor_sets (GskVulkanRender *self) { descriptor_sets[n_descriptor_sets++] = (VkWriteDescriptorSet) { .sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET, - .dstSet = self->descriptor_set, - .dstBinding = 2, + .dstSet = self->descriptor_sets[2], + .dstBinding = 0, .dstArrayElement = 0, .descriptorCount = gsk_descriptor_buffer_infos_get_size (&self->descriptor_buffers), .descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, @@ -741,9 +778,10 @@ gsk_vulkan_render_free (GskVulkanRender *self) gsk_descriptor_image_infos_clear (&self->descriptor_samplers); gsk_descriptor_buffer_infos_clear (&self->descriptor_buffers); - vkDestroyDescriptorSetLayout (device, - self->descriptor_set_layout, - NULL); + for (i = 0; i < N_DESCRIPTOR_SETS; i++) + vkDestroyDescriptorSetLayout (device, + self->descriptor_set_layouts[i], + NULL); vkDestroyFence (device, self->fence, diff --git a/gsk/vulkan/gskvulkanrenderer.c b/gsk/vulkan/gskvulkanrenderer.c index 694786e13f..7a42e1acb9 100644 --- a/gsk/vulkan/gskvulkanrenderer.c +++ b/gsk/vulkan/gskvulkanrenderer.c @@ -14,8 +14,9 @@ #include "gdk/gdkdisplayprivate.h" #include "gdk/gdkdrawcontextprivate.h" -#include "gdk/gdktextureprivate.h" #include "gdk/gdkprofilerprivate.h" +#include "gdk/gdktextureprivate.h" +#include "gdk/gdkvulkancontextprivate.h" #include @@ -286,7 +287,8 @@ gsk_vulkan_renderer_render_texture (GskRenderer *renderer, ceil (viewport->size.width), ceil (viewport->size.height)); image = gsk_vulkan_image_new_for_offscreen (self->vulkan, - gsk_render_node_get_preferred_vulkan_format (root), + gdk_vulkan_context_get_offscreen_format (self->vulkan, + gsk_render_node_get_preferred_depth (root)), rounded_viewport.size.width, rounded_viewport.size.height); diff --git a/gsk/vulkan/gskvulkanrenderpass.c b/gsk/vulkan/gskvulkanrenderpass.c index 96904e6711..3e793e4600 100644 --- a/gsk/vulkan/gskvulkanrenderpass.c +++ b/gsk/vulkan/gskvulkanrenderpass.c @@ -26,6 +26,8 @@ #include "gskvulkanrendererprivate.h" #include "gskprivate.h" +#include "gdk/gdkvulkancontextprivate.h" + #define ORTHO_NEAR_PLANE -10000 #define ORTHO_FAR_PLANE 10000 @@ -1275,7 +1277,8 @@ gsk_vulkan_render_pass_render_offscreen (GdkVulkanContext *vulkan, ceil (scale_y * viewport->size.height)); result = gsk_vulkan_image_new_for_offscreen (vulkan, - gsk_render_node_get_preferred_vulkan_format (node), + gdk_vulkan_context_get_offscreen_format (vulkan, + gsk_render_node_get_preferred_depth (node)), view.size.width, view.size.height); #ifdef G_ENABLE_DEBUG @@ -2436,7 +2439,6 @@ gsk_vulkan_render_pass_draw (GskVulkanRenderPass *self, VkPipelineLayout pipeline_layout, VkCommandBuffer command_buffer) { - VkDescriptorSet descriptor_set; cairo_rectangle_int_t rect; vkCmdSetViewport (command_buffer, @@ -2469,16 +2471,7 @@ gsk_vulkan_render_pass_draw (GskVulkanRenderPass *self, }, VK_SUBPASS_CONTENTS_INLINE); - descriptor_set = gsk_vulkan_render_get_descriptor_set (render); - if (descriptor_set) - vkCmdBindDescriptorSets (command_buffer, - VK_PIPELINE_BIND_POINT_GRAPHICS, - pipeline_layout, - 0, - 1, - &descriptor_set, - 0, - NULL); + gsk_vulkan_render_bind_descriptor_sets (render, command_buffer); gsk_vulkan_render_pass_draw_rect (self, render, pipeline_layout, command_buffer); diff --git a/gsk/vulkan/gskvulkanrenderprivate.h b/gsk/vulkan/gskvulkanrenderprivate.h index d09feaf284..112b657785 100644 --- a/gsk/vulkan/gskvulkanrenderprivate.h +++ b/gsk/vulkan/gskvulkanrenderprivate.h @@ -93,7 +93,8 @@ guchar * gsk_vulkan_render_get_buffer_memory (GskVulk gsize size, gsize alignment, gsize *out_offset); -VkDescriptorSet gsk_vulkan_render_get_descriptor_set (GskVulkanRender *self); +void gsk_vulkan_render_bind_descriptor_sets (GskVulkanRender *self, + VkCommandBuffer command_buffer); void gsk_vulkan_render_draw (GskVulkanRender *self); diff --git a/gsk/vulkan/resources/blendmode-clip-rounded.frag.spv b/gsk/vulkan/resources/blendmode-clip-rounded.frag.spv index 423ac50f4a..b1f01de900 100644 Binary files a/gsk/vulkan/resources/blendmode-clip-rounded.frag.spv and b/gsk/vulkan/resources/blendmode-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/blendmode-clip-rounded.vert.spv b/gsk/vulkan/resources/blendmode-clip-rounded.vert.spv index efc8c1dde5..13f49e72c0 100644 Binary files a/gsk/vulkan/resources/blendmode-clip-rounded.vert.spv and b/gsk/vulkan/resources/blendmode-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/blendmode-clip.frag.spv b/gsk/vulkan/resources/blendmode-clip.frag.spv index f6f8196ef0..5fae3d4921 100644 Binary files a/gsk/vulkan/resources/blendmode-clip.frag.spv and b/gsk/vulkan/resources/blendmode-clip.frag.spv differ diff --git a/gsk/vulkan/resources/blendmode-clip.vert.spv b/gsk/vulkan/resources/blendmode-clip.vert.spv index efc8c1dde5..13f49e72c0 100644 Binary files a/gsk/vulkan/resources/blendmode-clip.vert.spv and b/gsk/vulkan/resources/blendmode-clip.vert.spv differ diff --git a/gsk/vulkan/resources/blendmode.frag.spv b/gsk/vulkan/resources/blendmode.frag.spv index f6f8196ef0..5fae3d4921 100644 Binary files a/gsk/vulkan/resources/blendmode.frag.spv and b/gsk/vulkan/resources/blendmode.frag.spv differ diff --git a/gsk/vulkan/resources/blendmode.vert.spv b/gsk/vulkan/resources/blendmode.vert.spv index 4c4a8ebce3..a0cf5d61c5 100644 Binary files a/gsk/vulkan/resources/blendmode.vert.spv and b/gsk/vulkan/resources/blendmode.vert.spv differ diff --git a/gsk/vulkan/resources/blur-clip-rounded.frag.spv b/gsk/vulkan/resources/blur-clip-rounded.frag.spv index 69de15f823..6143d5887b 100644 Binary files a/gsk/vulkan/resources/blur-clip-rounded.frag.spv and b/gsk/vulkan/resources/blur-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/blur-clip-rounded.vert.spv b/gsk/vulkan/resources/blur-clip-rounded.vert.spv index d87ff54381..7eba3c835d 100644 Binary files a/gsk/vulkan/resources/blur-clip-rounded.vert.spv and b/gsk/vulkan/resources/blur-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/blur-clip.frag.spv b/gsk/vulkan/resources/blur-clip.frag.spv index edcb13a2f3..12f42b7e5e 100644 Binary files a/gsk/vulkan/resources/blur-clip.frag.spv and b/gsk/vulkan/resources/blur-clip.frag.spv differ diff --git a/gsk/vulkan/resources/blur-clip.vert.spv b/gsk/vulkan/resources/blur-clip.vert.spv index d87ff54381..7eba3c835d 100644 Binary files a/gsk/vulkan/resources/blur-clip.vert.spv and b/gsk/vulkan/resources/blur-clip.vert.spv differ diff --git a/gsk/vulkan/resources/blur.frag.spv b/gsk/vulkan/resources/blur.frag.spv index edcb13a2f3..12f42b7e5e 100644 Binary files a/gsk/vulkan/resources/blur.frag.spv and b/gsk/vulkan/resources/blur.frag.spv differ diff --git a/gsk/vulkan/resources/blur.vert.spv b/gsk/vulkan/resources/blur.vert.spv index b92d7f0877..51185e4654 100644 Binary files a/gsk/vulkan/resources/blur.vert.spv and b/gsk/vulkan/resources/blur.vert.spv differ diff --git a/gsk/vulkan/resources/border-clip-rounded.frag.spv b/gsk/vulkan/resources/border-clip-rounded.frag.spv index 4f92e4b3a9..80135c9ff3 100644 Binary files a/gsk/vulkan/resources/border-clip-rounded.frag.spv and b/gsk/vulkan/resources/border-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/border-clip-rounded.vert.spv b/gsk/vulkan/resources/border-clip-rounded.vert.spv index 38dd7e11a9..dc30933cfb 100644 Binary files a/gsk/vulkan/resources/border-clip-rounded.vert.spv and b/gsk/vulkan/resources/border-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/border-clip.frag.spv b/gsk/vulkan/resources/border-clip.frag.spv index e0e9f37f7e..b2e28636be 100644 Binary files a/gsk/vulkan/resources/border-clip.frag.spv and b/gsk/vulkan/resources/border-clip.frag.spv differ diff --git a/gsk/vulkan/resources/border-clip.vert.spv b/gsk/vulkan/resources/border-clip.vert.spv index 38dd7e11a9..dc30933cfb 100644 Binary files a/gsk/vulkan/resources/border-clip.vert.spv and b/gsk/vulkan/resources/border-clip.vert.spv differ diff --git a/gsk/vulkan/resources/border.frag.spv b/gsk/vulkan/resources/border.frag.spv index e0e9f37f7e..b2e28636be 100644 Binary files a/gsk/vulkan/resources/border.frag.spv and b/gsk/vulkan/resources/border.frag.spv differ diff --git a/gsk/vulkan/resources/border.vert.spv b/gsk/vulkan/resources/border.vert.spv index 4545d40983..07228039c1 100644 Binary files a/gsk/vulkan/resources/border.vert.spv and b/gsk/vulkan/resources/border.vert.spv differ diff --git a/gsk/vulkan/resources/color-clip-rounded.frag.spv b/gsk/vulkan/resources/color-clip-rounded.frag.spv index 496f8371ca..c3eff9d7f1 100644 Binary files a/gsk/vulkan/resources/color-clip-rounded.frag.spv and b/gsk/vulkan/resources/color-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/color-clip-rounded.vert.spv b/gsk/vulkan/resources/color-clip-rounded.vert.spv index c64ae703d3..d202725245 100644 Binary files a/gsk/vulkan/resources/color-clip-rounded.vert.spv and b/gsk/vulkan/resources/color-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/color-clip.frag.spv b/gsk/vulkan/resources/color-clip.frag.spv index 0fd1f7436a..378a8dd830 100644 Binary files a/gsk/vulkan/resources/color-clip.frag.spv and b/gsk/vulkan/resources/color-clip.frag.spv differ diff --git a/gsk/vulkan/resources/color-clip.vert.spv b/gsk/vulkan/resources/color-clip.vert.spv index c64ae703d3..d202725245 100644 Binary files a/gsk/vulkan/resources/color-clip.vert.spv and b/gsk/vulkan/resources/color-clip.vert.spv differ diff --git a/gsk/vulkan/resources/color-matrix-clip-rounded.frag.spv b/gsk/vulkan/resources/color-matrix-clip-rounded.frag.spv index 4924bc9595..bc8c03554e 100644 Binary files a/gsk/vulkan/resources/color-matrix-clip-rounded.frag.spv and b/gsk/vulkan/resources/color-matrix-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/color-matrix-clip-rounded.vert.spv b/gsk/vulkan/resources/color-matrix-clip-rounded.vert.spv index 22fe32d5e8..9b63dcccba 100644 Binary files a/gsk/vulkan/resources/color-matrix-clip-rounded.vert.spv and b/gsk/vulkan/resources/color-matrix-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/color-matrix-clip.frag.spv b/gsk/vulkan/resources/color-matrix-clip.frag.spv index d02299566f..1ec1197659 100644 Binary files a/gsk/vulkan/resources/color-matrix-clip.frag.spv and b/gsk/vulkan/resources/color-matrix-clip.frag.spv differ diff --git a/gsk/vulkan/resources/color-matrix-clip.vert.spv b/gsk/vulkan/resources/color-matrix-clip.vert.spv index 22fe32d5e8..9b63dcccba 100644 Binary files a/gsk/vulkan/resources/color-matrix-clip.vert.spv and b/gsk/vulkan/resources/color-matrix-clip.vert.spv differ diff --git a/gsk/vulkan/resources/color-matrix.frag.spv b/gsk/vulkan/resources/color-matrix.frag.spv index d02299566f..1ec1197659 100644 Binary files a/gsk/vulkan/resources/color-matrix.frag.spv and b/gsk/vulkan/resources/color-matrix.frag.spv differ diff --git a/gsk/vulkan/resources/color-matrix.vert.spv b/gsk/vulkan/resources/color-matrix.vert.spv index 15f399786e..fb1373bf05 100644 Binary files a/gsk/vulkan/resources/color-matrix.vert.spv and b/gsk/vulkan/resources/color-matrix.vert.spv differ diff --git a/gsk/vulkan/resources/color.frag.spv b/gsk/vulkan/resources/color.frag.spv index 0fd1f7436a..378a8dd830 100644 Binary files a/gsk/vulkan/resources/color.frag.spv and b/gsk/vulkan/resources/color.frag.spv differ diff --git a/gsk/vulkan/resources/color.vert.spv b/gsk/vulkan/resources/color.vert.spv index 8c6ac2e786..3992c82071 100644 Binary files a/gsk/vulkan/resources/color.vert.spv and b/gsk/vulkan/resources/color.vert.spv differ diff --git a/gsk/vulkan/resources/common.frag.glsl b/gsk/vulkan/resources/common.frag.glsl index 043d15a22e..314477f697 100644 --- a/gsk/vulkan/resources/common.frag.glsl +++ b/gsk/vulkan/resources/common.frag.glsl @@ -1,6 +1,6 @@ layout(set = 0, binding = 0) uniform texture2D textures[50000]; -layout(set = 0, binding = 1) uniform sampler samplers[50000]; -layout(set = 0, binding = 2) readonly buffer FloatBuffers { +layout(set = 1, binding = 0) uniform sampler samplers[50000]; +layout(set = 2, binding = 0) readonly buffer FloatBuffers { float floats[]; } buffers[50000]; diff --git a/gsk/vulkan/resources/crossfade-clip-rounded.frag.spv b/gsk/vulkan/resources/crossfade-clip-rounded.frag.spv index 76802428b4..2452726c44 100644 Binary files a/gsk/vulkan/resources/crossfade-clip-rounded.frag.spv and b/gsk/vulkan/resources/crossfade-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/crossfade-clip-rounded.vert.spv b/gsk/vulkan/resources/crossfade-clip-rounded.vert.spv index b0165e395c..4db5a05bfe 100644 Binary files a/gsk/vulkan/resources/crossfade-clip-rounded.vert.spv and b/gsk/vulkan/resources/crossfade-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/crossfade-clip.frag.spv b/gsk/vulkan/resources/crossfade-clip.frag.spv index d4a6b21209..b969b21dd8 100644 Binary files a/gsk/vulkan/resources/crossfade-clip.frag.spv and b/gsk/vulkan/resources/crossfade-clip.frag.spv differ diff --git a/gsk/vulkan/resources/crossfade-clip.vert.spv b/gsk/vulkan/resources/crossfade-clip.vert.spv index b0165e395c..4db5a05bfe 100644 Binary files a/gsk/vulkan/resources/crossfade-clip.vert.spv and b/gsk/vulkan/resources/crossfade-clip.vert.spv differ diff --git a/gsk/vulkan/resources/crossfade.frag.spv b/gsk/vulkan/resources/crossfade.frag.spv index d4a6b21209..b969b21dd8 100644 Binary files a/gsk/vulkan/resources/crossfade.frag.spv and b/gsk/vulkan/resources/crossfade.frag.spv differ diff --git a/gsk/vulkan/resources/crossfade.vert.spv b/gsk/vulkan/resources/crossfade.vert.spv index 1be82eb26b..c8cf569098 100644 Binary files a/gsk/vulkan/resources/crossfade.vert.spv and b/gsk/vulkan/resources/crossfade.vert.spv differ diff --git a/gsk/vulkan/resources/inset-shadow-clip-rounded.frag.spv b/gsk/vulkan/resources/inset-shadow-clip-rounded.frag.spv index f48ba11a02..b6b7445339 100644 Binary files a/gsk/vulkan/resources/inset-shadow-clip-rounded.frag.spv and b/gsk/vulkan/resources/inset-shadow-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/inset-shadow-clip-rounded.vert.spv b/gsk/vulkan/resources/inset-shadow-clip-rounded.vert.spv index 2f4cec46cf..f8dcdb0242 100644 Binary files a/gsk/vulkan/resources/inset-shadow-clip-rounded.vert.spv and b/gsk/vulkan/resources/inset-shadow-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/inset-shadow-clip.frag.spv b/gsk/vulkan/resources/inset-shadow-clip.frag.spv index 06ead8fe3d..d1239f0a09 100644 Binary files a/gsk/vulkan/resources/inset-shadow-clip.frag.spv and b/gsk/vulkan/resources/inset-shadow-clip.frag.spv differ diff --git a/gsk/vulkan/resources/inset-shadow-clip.vert.spv b/gsk/vulkan/resources/inset-shadow-clip.vert.spv index 2f4cec46cf..f8dcdb0242 100644 Binary files a/gsk/vulkan/resources/inset-shadow-clip.vert.spv and b/gsk/vulkan/resources/inset-shadow-clip.vert.spv differ diff --git a/gsk/vulkan/resources/inset-shadow.frag.spv b/gsk/vulkan/resources/inset-shadow.frag.spv index 06ead8fe3d..d1239f0a09 100644 Binary files a/gsk/vulkan/resources/inset-shadow.frag.spv and b/gsk/vulkan/resources/inset-shadow.frag.spv differ diff --git a/gsk/vulkan/resources/inset-shadow.vert.spv b/gsk/vulkan/resources/inset-shadow.vert.spv index c327ec6f6b..c4a2b2c214 100644 Binary files a/gsk/vulkan/resources/inset-shadow.vert.spv and b/gsk/vulkan/resources/inset-shadow.vert.spv differ diff --git a/gsk/vulkan/resources/linear-clip-rounded.frag.spv b/gsk/vulkan/resources/linear-clip-rounded.frag.spv index 5a7953ec0c..5dfba323b3 100644 Binary files a/gsk/vulkan/resources/linear-clip-rounded.frag.spv and b/gsk/vulkan/resources/linear-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/linear-clip-rounded.vert.spv b/gsk/vulkan/resources/linear-clip-rounded.vert.spv index 77a39b828c..ba5af49500 100644 Binary files a/gsk/vulkan/resources/linear-clip-rounded.vert.spv and b/gsk/vulkan/resources/linear-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/linear-clip.frag.spv b/gsk/vulkan/resources/linear-clip.frag.spv index 826b9835e8..6e28a7d839 100644 Binary files a/gsk/vulkan/resources/linear-clip.frag.spv and b/gsk/vulkan/resources/linear-clip.frag.spv differ diff --git a/gsk/vulkan/resources/linear-clip.vert.spv b/gsk/vulkan/resources/linear-clip.vert.spv index 77a39b828c..ba5af49500 100644 Binary files a/gsk/vulkan/resources/linear-clip.vert.spv and b/gsk/vulkan/resources/linear-clip.vert.spv differ diff --git a/gsk/vulkan/resources/linear.frag.spv b/gsk/vulkan/resources/linear.frag.spv index 826b9835e8..6e28a7d839 100644 Binary files a/gsk/vulkan/resources/linear.frag.spv and b/gsk/vulkan/resources/linear.frag.spv differ diff --git a/gsk/vulkan/resources/linear.vert b/gsk/vulkan/resources/linear.vert index d2cb76fed9..ec077f16ed 100644 --- a/gsk/vulkan/resources/linear.vert +++ b/gsk/vulkan/resources/linear.vert @@ -3,11 +3,6 @@ #include "common.vert.glsl" #include "rect.vert.glsl" -struct ColorStop { - float offset; - vec4 color; -}; - layout(location = 0) in vec4 inRect; layout(location = 1) in vec2 inStart; layout(location = 2) in vec2 inEnd; diff --git a/gsk/vulkan/resources/linear.vert.spv b/gsk/vulkan/resources/linear.vert.spv index 7069b9e48d..aa6d52676d 100644 Binary files a/gsk/vulkan/resources/linear.vert.spv and b/gsk/vulkan/resources/linear.vert.spv differ diff --git a/gsk/vulkan/resources/mask-clip-rounded.frag.spv b/gsk/vulkan/resources/mask-clip-rounded.frag.spv index d0c9d218ee..a8c49f492b 100644 Binary files a/gsk/vulkan/resources/mask-clip-rounded.frag.spv and b/gsk/vulkan/resources/mask-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/mask-clip-rounded.vert.spv b/gsk/vulkan/resources/mask-clip-rounded.vert.spv index c48cb041d9..0231979d08 100644 Binary files a/gsk/vulkan/resources/mask-clip-rounded.vert.spv and b/gsk/vulkan/resources/mask-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/mask-clip.frag.spv b/gsk/vulkan/resources/mask-clip.frag.spv index 00ca0800aa..24325b1588 100644 Binary files a/gsk/vulkan/resources/mask-clip.frag.spv and b/gsk/vulkan/resources/mask-clip.frag.spv differ diff --git a/gsk/vulkan/resources/mask-clip.vert.spv b/gsk/vulkan/resources/mask-clip.vert.spv index c48cb041d9..0231979d08 100644 Binary files a/gsk/vulkan/resources/mask-clip.vert.spv and b/gsk/vulkan/resources/mask-clip.vert.spv differ diff --git a/gsk/vulkan/resources/mask.frag.spv b/gsk/vulkan/resources/mask.frag.spv index 00ca0800aa..24325b1588 100644 Binary files a/gsk/vulkan/resources/mask.frag.spv and b/gsk/vulkan/resources/mask.frag.spv differ diff --git a/gsk/vulkan/resources/mask.vert.spv b/gsk/vulkan/resources/mask.vert.spv index 846d460a06..2407952f52 100644 Binary files a/gsk/vulkan/resources/mask.vert.spv and b/gsk/vulkan/resources/mask.vert.spv differ diff --git a/gsk/vulkan/resources/outset-shadow-clip-rounded.frag.spv b/gsk/vulkan/resources/outset-shadow-clip-rounded.frag.spv index 46b09af170..48e3538a10 100644 Binary files a/gsk/vulkan/resources/outset-shadow-clip-rounded.frag.spv and b/gsk/vulkan/resources/outset-shadow-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/outset-shadow-clip-rounded.vert.spv b/gsk/vulkan/resources/outset-shadow-clip-rounded.vert.spv index c70940d652..28a2cdeab5 100644 Binary files a/gsk/vulkan/resources/outset-shadow-clip-rounded.vert.spv and b/gsk/vulkan/resources/outset-shadow-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/outset-shadow-clip.frag.spv b/gsk/vulkan/resources/outset-shadow-clip.frag.spv index 9e7e4bde9b..ca5e278709 100644 Binary files a/gsk/vulkan/resources/outset-shadow-clip.frag.spv and b/gsk/vulkan/resources/outset-shadow-clip.frag.spv differ diff --git a/gsk/vulkan/resources/outset-shadow-clip.vert.spv b/gsk/vulkan/resources/outset-shadow-clip.vert.spv index c70940d652..28a2cdeab5 100644 Binary files a/gsk/vulkan/resources/outset-shadow-clip.vert.spv and b/gsk/vulkan/resources/outset-shadow-clip.vert.spv differ diff --git a/gsk/vulkan/resources/outset-shadow.frag.spv b/gsk/vulkan/resources/outset-shadow.frag.spv index 9e7e4bde9b..ca5e278709 100644 Binary files a/gsk/vulkan/resources/outset-shadow.frag.spv and b/gsk/vulkan/resources/outset-shadow.frag.spv differ diff --git a/gsk/vulkan/resources/outset-shadow.vert.spv b/gsk/vulkan/resources/outset-shadow.vert.spv index 4423d343f8..5044911150 100644 Binary files a/gsk/vulkan/resources/outset-shadow.vert.spv and b/gsk/vulkan/resources/outset-shadow.vert.spv differ diff --git a/gsk/vulkan/resources/texture-clip-rounded.frag.spv b/gsk/vulkan/resources/texture-clip-rounded.frag.spv index ca3a6511d9..0a8c9fba4c 100644 Binary files a/gsk/vulkan/resources/texture-clip-rounded.frag.spv and b/gsk/vulkan/resources/texture-clip-rounded.frag.spv differ diff --git a/gsk/vulkan/resources/texture-clip-rounded.vert.spv b/gsk/vulkan/resources/texture-clip-rounded.vert.spv index 9695b23d00..92863efc83 100644 Binary files a/gsk/vulkan/resources/texture-clip-rounded.vert.spv and b/gsk/vulkan/resources/texture-clip-rounded.vert.spv differ diff --git a/gsk/vulkan/resources/texture-clip.frag.spv b/gsk/vulkan/resources/texture-clip.frag.spv index cabb91a88d..3e4d3bec7d 100644 Binary files a/gsk/vulkan/resources/texture-clip.frag.spv and b/gsk/vulkan/resources/texture-clip.frag.spv differ diff --git a/gsk/vulkan/resources/texture-clip.vert.spv b/gsk/vulkan/resources/texture-clip.vert.spv index 9695b23d00..92863efc83 100644 Binary files a/gsk/vulkan/resources/texture-clip.vert.spv and b/gsk/vulkan/resources/texture-clip.vert.spv differ diff --git a/gsk/vulkan/resources/texture.frag.spv b/gsk/vulkan/resources/texture.frag.spv index cabb91a88d..3e4d3bec7d 100644 Binary files a/gsk/vulkan/resources/texture.frag.spv and b/gsk/vulkan/resources/texture.frag.spv differ diff --git a/gsk/vulkan/resources/texture.vert.spv b/gsk/vulkan/resources/texture.vert.spv index 22094cff21..fea6f3e173 100644 Binary files a/gsk/vulkan/resources/texture.vert.spv and b/gsk/vulkan/resources/texture.vert.spv differ