Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: gpu/vulkan/vulkan_command_buffer.cc

Issue 1955803002: Added Validation to Vulkan CommandBuffer API's. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved declaration to initialization Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/vulkan/vulkan_command_buffer.cc
diff --git a/gpu/vulkan/vulkan_command_buffer.cc b/gpu/vulkan/vulkan_command_buffer.cc
index 5f345256e34b515e7b1692b59ba5dd007a21174c..25190261fe3f06e41cfe62110ec6b3d05e29ddb8 100644
--- a/gpu/vulkan/vulkan_command_buffer.cc
+++ b/gpu/vulkan/vulkan_command_buffer.cc
@@ -148,14 +148,20 @@ void VulkanCommandBuffer::ResetIfDirty() {
// using the asynchronous SubmissionFinished() function.
VkDevice device = device_queue_->GetVulkanDevice();
vkWaitForFences(device, 1, &submission_fence_, true, UINT64_MAX);
-
- vkResetCommandBuffer(command_buffer_, 0);
- record_type_ = RECORD_TYPE_EMPTY;
+ VkResult result = vkResetCommandBuffer(command_buffer_, 0);
+ if (VK_SUCCESS != result) {
+ DLOG(ERROR) << "vkResetCommandBuffer() failed: " << result;
+ } else {
+ record_type_ = RECORD_TYPE_EMPTY;
+ }
}
}
CommandBufferRecorderBase::~CommandBufferRecorderBase() {
- vkEndCommandBuffer(handle_);
+ VkResult result = vkEndCommandBuffer(handle_);
+ if (VK_SUCCESS != result) {
+ DLOG(ERROR) << "vkEndCommandBuffer() failed: " << result;
+ }
};
ScopedMultiUseCommandBufferRecorder::ScopedMultiUseCommandBufferRecorder(
@@ -164,7 +170,11 @@ ScopedMultiUseCommandBufferRecorder::ScopedMultiUseCommandBufferRecorder(
ValidateMultiUse(command_buffer);
VkCommandBufferBeginInfo begin_info = {};
begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
- vkBeginCommandBuffer(handle_, &begin_info);
+ VkResult result = vkBeginCommandBuffer(handle_, &begin_info);
+
+ if (VK_SUCCESS != result) {
+ DLOG(ERROR) << "vkBeginCommandBuffer() failed: " << result;
+ }
}
ScopedSingleUseCommandBufferRecorder::ScopedSingleUseCommandBufferRecorder(
@@ -174,7 +184,11 @@ ScopedSingleUseCommandBufferRecorder::ScopedSingleUseCommandBufferRecorder(
VkCommandBufferBeginInfo begin_info = {};
begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
- vkBeginCommandBuffer(handle_, &begin_info);
+ VkResult result = vkBeginCommandBuffer(handle_, &begin_info);
+
+ if (VK_SUCCESS != result) {
+ DLOG(ERROR) << "vkBeginCommandBuffer() failed: " << result;
+ }
}
} // namespace gpu
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698