Skip to content

Commit

Permalink
vkd3d: Add config flag to force ONE_TIME_SUBMIT.
Browse files Browse the repository at this point in the history
Signed-off-by: Hans-Kristian Arntzen <[email protected]>
  • Loading branch information
HansKristian-Work committed Dec 6, 2024
1 parent 73e59ce commit 6a035d3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions include/vkd3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 8 additions & 4 deletions libs/vkd3d/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6a035d3

Please sign in to comment.