vulkan: No need for different shaders anymore

Now that we don't do fancy texture stuff anymore, we don't need fancy
shaders either, so we can just compile against Vulkan 1.0 again.

And that means we need no fallback shaders for Vulkan 1.0 anymore.
This commit is contained in:
Benjamin Otte
2024-07-21 14:45:33 +02:00
parent 9c5ac13301
commit f5096fd11a
3 changed files with 5 additions and 32 deletions

View File

@@ -811,7 +811,6 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
PipelineCacheKey *cached_result;
VkPipeline vk_pipeline;
GdkDisplay *display;
const char *version_string;
char *vertex_shader_name, *fragment_shader_name;
G_GNUC_UNUSED gint64 begin_time = GDK_PROFILER_CURRENT_TIME;
const char *blend_name[] = { "NONE", "OVER", "ADD", "CLEAR" };
@@ -830,19 +829,13 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
return cached_result->vk_pipeline;
display = gsk_gpu_device_get_display (GSK_GPU_DEVICE (self));
if (gsk_vulkan_device_has_feature (self, GDK_VULKAN_FEATURE_DYNAMIC_INDEXING) &&
gsk_vulkan_device_has_feature (self, GDK_VULKAN_FEATURE_NONUNIFORM_INDEXING))
version_string = ".1.2";
else
version_string = ".1.0";
vertex_shader_name = g_strconcat ("/org/gtk/libgsk/shaders/vulkan/",
op_class->shader_name,
version_string,
".vert.spv",
NULL);
fragment_shader_name = g_strconcat ("/org/gtk/libgsk/shaders/vulkan/",
op_class->shader_name,
version_string,
".frag.spv",
NULL);
@@ -970,9 +963,8 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
&vk_pipeline);
gdk_profiler_end_markf (begin_time,
"Create Vulkan pipeline", "%s version=%s color states=%u variation=%u clip=%u blend=%s format=%u",
"Create Vulkan pipeline", "%s color states=%u variation=%u clip=%u blend=%s format=%u",
op_class->shader_name,
version_string + 1,
flags,
color_states,
variation,
@@ -980,9 +972,8 @@ gsk_vulkan_device_get_vk_pipeline (GskVulkanDevice *self,
vk_format);
GSK_DEBUG (SHADERS,
"Create Vulkan pipeline (%s %s, %u/%u/%u/%s/%u)",
"Create Vulkan pipeline (%s, %u/%u/%u/%s/%u)",
op_class->shader_name,
version_string + 1,
flags,
color_states,
variation,

View File

@@ -1,7 +1,3 @@
#ifdef HAVE_VULKAN_1_2
#extension GL_EXT_nonuniform_qualifier : enable
#endif
#include "enums.glsl"
layout(push_constant) uniform PushConstants {

View File

@@ -61,27 +61,13 @@ foreach shader: gsk_private_gpu_shaders
if (have_vulkan)
glslc_options = [
[ fs.name (fs.replace_suffix (shader, '')) + '.1.2.vert.spv',
[ '--target-env=vulkan1.2',
'-fshader-stage=vertex',
'-DGSK_VERTEX_SHADER=1',
'-DHAVE_VULKAN_1_2=1'
]
],
[ fs.name (fs.replace_suffix (shader, '')) + '.1.2.frag.spv',
[ '--target-env=vulkan1.2',
'-fshader-stage=fragment',
'-DGSK_FRAGMENT_SHADER=1',
'-DHAVE_VULKAN_1_2=1'
]
],
[ fs.name (fs.replace_suffix (shader, '')) + '.1.0.vert.spv',
[ fs.name (fs.replace_suffix (shader, '')) + '.vert.spv',
[ '--target-env=vulkan1.0',
'-fshader-stage=vertex',
'-DGSK_VERTEX_SHADER=1',
]
],
[ fs.name (fs.replace_suffix (shader, '')) + '.1.0.frag.spv',
[ fs.name (fs.replace_suffix (shader, '')) + '.frag.spv',
[ '--target-env=vulkan1.0',
'-fshader-stage=fragment',
'-DGSK_FRAGMENT_SHADER=1',