diff options
author | Lynne <dev@lynne.ee> | 2023-03-06 00:19:12 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2023-05-29 00:41:49 +0200 |
commit | 83024beec226222334d7e4166da5e4cd0869e7cc (patch) | |
tree | ff4d3d9b0c69a0da452e54bccc08f1040aa3e91c /libavutil/vulkan.c | |
parent | 758f8b26b9592438027c43533bf662e5c407ae6a (diff) | |
download | ffmpeg-83024beec226222334d7e4166da5e4cd0869e7cc.tar.gz |
vulkan: enable forcing of full subgroups
Diffstat (limited to 'libavutil/vulkan.c')
-rw-r--r-- | libavutil/vulkan.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index 6dd4de0343..8a1233662f 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -90,9 +90,13 @@ int ff_vk_load_props(FFVulkanContext *s) s->hprops = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT, }; + s->subgroup_props = (VkPhysicalDeviceSubgroupSizeControlProperties) { + .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES, + .pNext = &s->hprops, + }; s->desc_buf_props = (VkPhysicalDeviceDescriptorBufferPropertiesEXT) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT, - .pNext = &s->hprops, + .pNext = &s->subgroup_props, }; s->driver_props = (VkPhysicalDeviceDriverProperties) { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES, @@ -1287,13 +1291,20 @@ void ff_vk_frame_barrier(FFVulkanContext *s, FFVkExecContext *e, } int ff_vk_shader_init(FFVulkanPipeline *pl, FFVkSPIRVShader *shd, const char *name, - VkShaderStageFlags stage) + VkShaderStageFlags stage, uint32_t required_subgroup_size) { av_bprint_init(&shd->src, 0, AV_BPRINT_SIZE_UNLIMITED); shd->shader.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shd->shader.stage = stage; + if (required_subgroup_size) { + shd->shader.flags |= VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT; + shd->shader.pNext = &shd->subgroup_info; + shd->subgroup_info.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO; + shd->subgroup_info.requiredSubgroupSize = required_subgroup_size; + } + shd->name = name; GLSLF(0, #version %i ,460); |