mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-04 23:31:01 +00:00
vulkan: enable forcing of full subgroups
This commit is contained in:
parent
758f8b26b9
commit
83024beec2
@ -90,9 +90,13 @@ int ff_vk_load_props(FFVulkanContext *s)
|
|||||||
s->hprops = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT) {
|
s->hprops = (VkPhysicalDeviceExternalMemoryHostPropertiesEXT) {
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT,
|
.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) {
|
s->desc_buf_props = (VkPhysicalDeviceDescriptorBufferPropertiesEXT) {
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT,
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT,
|
||||||
.pNext = &s->hprops,
|
.pNext = &s->subgroup_props,
|
||||||
};
|
};
|
||||||
s->driver_props = (VkPhysicalDeviceDriverProperties) {
|
s->driver_props = (VkPhysicalDeviceDriverProperties) {
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES,
|
.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,
|
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);
|
av_bprint_init(&shd->src, 0, AV_BPRINT_SIZE_UNLIMITED);
|
||||||
|
|
||||||
shd->shader.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
shd->shader.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
|
||||||
shd->shader.stage = stage;
|
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;
|
shd->name = name;
|
||||||
|
|
||||||
GLSLF(0, #version %i ,460);
|
GLSLF(0, #version %i ,460);
|
||||||
|
@ -61,6 +61,7 @@ typedef struct FFVkSPIRVShader {
|
|||||||
AVBPrint src;
|
AVBPrint src;
|
||||||
int local_size[3]; /* Compute shader workgroup sizes */
|
int local_size[3]; /* Compute shader workgroup sizes */
|
||||||
VkPipelineShaderStageCreateInfo shader;
|
VkPipelineShaderStageCreateInfo shader;
|
||||||
|
VkPipelineShaderStageRequiredSubgroupSizeCreateInfo subgroup_info;
|
||||||
} FFVkSPIRVShader;
|
} FFVkSPIRVShader;
|
||||||
|
|
||||||
typedef struct FFVulkanDescriptorSetBinding {
|
typedef struct FFVulkanDescriptorSetBinding {
|
||||||
@ -217,6 +218,7 @@ typedef struct FFVulkanContext {
|
|||||||
VkPhysicalDeviceMemoryProperties mprops;
|
VkPhysicalDeviceMemoryProperties mprops;
|
||||||
VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops;
|
VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops;
|
||||||
VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props;
|
VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props;
|
||||||
|
VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props;
|
||||||
VkQueueFamilyQueryResultStatusPropertiesKHR *query_props;
|
VkQueueFamilyQueryResultStatusPropertiesKHR *query_props;
|
||||||
VkQueueFamilyVideoPropertiesKHR *video_props;
|
VkQueueFamilyVideoPropertiesKHR *video_props;
|
||||||
VkQueueFamilyProperties2 *qf_props;
|
VkQueueFamilyProperties2 *qf_props;
|
||||||
@ -400,7 +402,7 @@ int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler,
|
|||||||
* Shader management.
|
* Shader management.
|
||||||
*/
|
*/
|
||||||
int ff_vk_shader_init(FFVulkanPipeline *pl, FFVkSPIRVShader *shd, const char *name,
|
int ff_vk_shader_init(FFVulkanPipeline *pl, FFVkSPIRVShader *shd, const char *name,
|
||||||
VkShaderStageFlags stage);
|
VkShaderStageFlags stage, uint32_t required_subgroup_size);
|
||||||
void ff_vk_shader_set_compute_sizes(FFVkSPIRVShader *shd, int x, int y, int z);
|
void ff_vk_shader_set_compute_sizes(FFVkSPIRVShader *shd, int x, int y, int z);
|
||||||
void ff_vk_shader_print(void *ctx, FFVkSPIRVShader *shd, int prio);
|
void ff_vk_shader_print(void *ctx, FFVkSPIRVShader *shd, int prio);
|
||||||
int ff_vk_shader_create(FFVulkanContext *s, FFVkSPIRVShader *shd,
|
int ff_vk_shader_create(FFVulkanContext *s, FFVkSPIRVShader *shd,
|
||||||
|
Loading…
Reference in New Issue
Block a user