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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 1776453003: Added initial implementation of Vulkan Render Passes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn_vulkan
Patch Set: Ensure vulkan handles all initialized to null, check destruction in destructor Created 4 years, 9 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
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 25380102fdbd0b73e97ca16ecbb02522afb80e84..780c0e483eefe09595a349994ce70f15317c2868 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -51,6 +51,10 @@
#include "content/common/gpu/stream_texture_android.h"
#endif
+#if defined(ENABLE_VULKAN)
+#include "gpu/vulkan/vulkan_surface.h"
+#endif
+
namespace content {
struct WaitForCommandState {
WaitForCommandState(int32_t start, int32_t end, IPC::Message* reply)
@@ -491,6 +495,13 @@ void GpuCommandBufferStub::Destroy() {
command_buffer_.reset();
+#if defined(ENABLE_VULKAN)
+ if (vk_surface_) {
+ vk_surface_->Destroy();
+ vk_surface_.reset();
+ }
+#endif
+
// Remove this after crbug.com/248395 is sorted out.
surface_ = NULL;
}
@@ -539,6 +550,12 @@ void GpuCommandBufferStub::OnInitialize(
this,
handle_,
surface_format_);
+#if defined(ENABLE_VULKAN)
+ vk_surface_ = gfx::VulkanSurface::CreateViewSurface(handle_.handle);
+ bool vk_result = vk_surface_->Initialize(
+ static_cast<gfx::VulkanSurface::Format>(surface_format_));
+ DCHECK(vk_result);
+#endif
} else {
surface_ = manager->GetDefaultOffscreenSurface();
}

Powered by Google App Engine
This is Rietveld 408576698