diff --git a/include/vkd3d.h b/include/vkd3d.h index 175a278c3f..3bf7b5626b 100644 --- a/include/vkd3d.h +++ b/include/vkd3d.h @@ -111,6 +111,7 @@ extern "C" { #define VKD3D_CONFIG_FLAG_INSTRUCTION_QA_CHECKS (1ull << 53) #define VKD3D_CONFIG_FLAG_TRANSFER_QUEUE (1ull << 54) #define VKD3D_CONFIG_FLAG_NO_GPU_UPLOAD_HEAP (1ull << 55) +#define VKD3D_CONFIG_FLAG_ONE_TIME_SUBMIT (1ull << 56) struct vkd3d_instance; diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index a1d284b25a..e1e4dea6af 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -1906,7 +1906,8 @@ static HRESULT d3d12_command_list_begin_command_buffer(struct d3d12_command_list begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; begin_info.pNext = NULL; - begin_info.flags = 0; + begin_info.flags = (vkd3d_config_flags & VKD3D_CONFIG_FLAG_ONE_TIME_SUBMIT) ? + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0; begin_info.pInheritanceInfo = NULL; if ((vr = VK_CALL(vkBeginCommandBuffer(list->cmd.vk_command_buffer, &begin_info))) < 0) @@ -2018,7 +2019,8 @@ static void d3d12_command_list_begin_new_sequence(struct d3d12_command_list *lis begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; begin_info.pNext = NULL; - begin_info.flags = 0; + begin_info.flags = (vkd3d_config_flags & VKD3D_CONFIG_FLAG_ONE_TIME_SUBMIT) ? + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0; begin_info.pInheritanceInfo = NULL; if ((vr = VK_CALL(vkBeginCommandBuffer(iteration->vk_command_buffer, &begin_info))) < 0) { @@ -2112,7 +2114,8 @@ static HRESULT d3d12_command_allocator_allocate_init_command_buffer(struct d3d12 begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; begin_info.pNext = NULL; - begin_info.flags = 0; + begin_info.flags = (vkd3d_config_flags & VKD3D_CONFIG_FLAG_ONE_TIME_SUBMIT) ? + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0; begin_info.pInheritanceInfo = NULL; if ((vr = VK_CALL(vkBeginCommandBuffer(list->cmd.iterations[0].vk_init_commands, &begin_info))) < 0) @@ -2162,7 +2165,8 @@ static HRESULT d3d12_command_allocator_allocate_init_post_indirect_command_buffe begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; begin_info.pNext = NULL; - begin_info.flags = 0; + begin_info.flags = (vkd3d_config_flags & VKD3D_CONFIG_FLAG_ONE_TIME_SUBMIT) ? + VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT : 0; begin_info.pInheritanceInfo = NULL; if ((vr = VK_CALL(vkBeginCommandBuffer(iteration->vk_init_commands, &begin_info))) < 0) diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index 9a6ee1fb98..b2d2b2e804 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -982,6 +982,7 @@ static const struct vkd3d_debug_option vkd3d_config_options[] = {"instruction_qa_checks", VKD3D_CONFIG_FLAG_INSTRUCTION_QA_CHECKS}, {"transfer_queue", VKD3D_CONFIG_FLAG_TRANSFER_QUEUE}, {"no_gpu_upload_heap", VKD3D_CONFIG_FLAG_NO_GPU_UPLOAD_HEAP}, + {"one_time_submit", VKD3D_CONFIG_FLAG_ONE_TIME_SUBMIT}, }; static void vkd3d_config_flags_init_once(void)