Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More validation logs for CommandEncoderVK submission #43859

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions impeller/renderer/backend/vulkan/command_encoder_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ bool CommandEncoderVK::Submit(SubmitCallback callback) {
// Make sure to call callback with `false` if anything returns early.
bool fail_callback = !!callback;
if (!IsValid()) {
VALIDATION_LOG << "Cannot submit invalid CommandEncoderVK.";
if (fail_callback) {
callback(false);
}
Expand All @@ -179,22 +180,28 @@ bool CommandEncoderVK::Submit(SubmitCallback callback) {

auto command_buffer = GetCommandBuffer();

if (command_buffer.end() != vk::Result::eSuccess) {
auto status = command_buffer.end();
if (status != vk::Result::eSuccess) {
VALIDATION_LOG << "Failed to end command buffer: " << vk::to_string(status);
return false;
}
std::shared_ptr<const DeviceHolder> strong_device = device_holder_.lock();
if (!strong_device) {
VALIDATION_LOG << "Device lost.";
return false;
}
auto [fence_result, fence] = strong_device->GetDevice().createFenceUnique({});
if (fence_result != vk::Result::eSuccess) {
VALIDATION_LOG << "Failed to create fence: " << vk::to_string(fence_result);
return false;
}

vk::SubmitInfo submit_info;
std::vector<vk::CommandBuffer> buffers = {command_buffer};
submit_info.setCommandBuffers(buffers);
if (queue_->Submit(submit_info, *fence) != vk::Result::eSuccess) {
status = queue_->Submit(submit_info, *fence);
if (status != vk::Result::eSuccess) {
VALIDATION_LOG << "Failed to submit queue: " << vk::to_string(status);
return false;
}

Expand Down