Skip to content

Commit 8bbd608

Browse files
committed
Add error log message when immediate command list failed to reset
1 parent b04701c commit 8bbd608

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

source/d3d12/d3d12_impl_command_list_immediate.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,13 @@ bool reshade::d3d12::command_list_immediate_impl::flush()
162162
_cmd_alloc[_cmd_index]->Reset();
163163

164164
// Reset command list using current command allocator and put it into the recording state
165-
return SUCCEEDED(_orig->Reset(_cmd_alloc[_cmd_index].get(), nullptr));
165+
if (const HRESULT hr = _orig->Reset(_cmd_alloc[_cmd_index].get(), nullptr); FAILED(hr))
166+
{
167+
log::message(log::level::error, "Failed to reset immediate command list with error code %s!", reshade::log::hr_to_string(hr).c_str());
168+
return false;
169+
}
170+
171+
return true;
166172
}
167173
bool reshade::d3d12::command_list_immediate_impl::flush_and_wait()
168174
{

source/vulkan/vulkan_impl_command_list_immediate.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ bool reshade::vulkan::command_list_immediate_impl::flush(VkSubmitInfo &semaphore
158158

159159
// Command buffer is now ready for a reset
160160
if (vk.BeginCommandBuffer(_cmd_buffers[_cmd_index], &begin_info) != VK_SUCCESS)
161+
{
162+
log::message(log::level::error, "Failed to reset immediate command list!");
161163
return false;
164+
}
162165

163166
// Command buffer is now in the recording state
164167
_orig = _cmd_buffers[_cmd_index];

0 commit comments

Comments
 (0)