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

Unified Diff: gpu/vulkan/vulkan_image_view.cc

Issue 1829163003: Added initial implementation of the Vulkan Context Provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vk_surface_patch
Patch Set: Block off vulkan_cc with enable_vulkan (not relevant in future patch) 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
« no previous file with comments | « gpu/vulkan/vulkan_image_view.h ('k') | gpu/vulkan/vulkan_implementation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/vulkan/vulkan_image_view.cc
diff --git a/gpu/vulkan/vulkan_image_view.cc b/gpu/vulkan/vulkan_image_view.cc
index fd73a745ea715bc4d45e2b8ff27048859552e2ee..b8cb2615f0cea61ffbb915d2a70059a3605c1d4d 100644
--- a/gpu/vulkan/vulkan_image_view.cc
+++ b/gpu/vulkan/vulkan_image_view.cc
@@ -5,7 +5,7 @@
#include "gpu/vulkan/vulkan_image_view.h"
#include "base/logging.h"
-#include "gpu/vulkan/vulkan_implementation.h"
+#include "gpu/vulkan/vulkan_device_queue.h"
namespace gpu {
@@ -27,7 +27,8 @@ static_assert(arraysize(kAspectFlags) == VulkanImageView::NUM_IMAGE_TYPES,
"Array size for kAspectFlags must match image types.");
} // namespace
-VulkanImageView::VulkanImageView() {}
+VulkanImageView::VulkanImageView(VulkanDeviceQueue* device_queue)
+ : device_queue_(device_queue) {}
VulkanImageView::~VulkanImageView() {
DCHECK_EQ(static_cast<VkImageView>(VK_NULL_HANDLE), handle_);
@@ -63,8 +64,9 @@ bool VulkanImageView::Initialize(VkImage image,
VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY};
image_view_create_info.subresourceRange = image_subresource_range;
- VkResult result = vkCreateImageView(
- GetVulkanDevice(), &image_view_create_info, nullptr, &handle_);
+ VkResult result =
+ vkCreateImageView(device_queue_->GetVulkanDevice(),
+ &image_view_create_info, nullptr, &handle_);
if (VK_SUCCESS != result) {
DLOG(ERROR) << "vkCreateImageView() failed: " << result;
return false;
@@ -80,7 +82,7 @@ bool VulkanImageView::Initialize(VkImage image,
void VulkanImageView::Destroy() {
if (VK_NULL_HANDLE != handle_) {
- vkDestroyImageView(GetVulkanDevice(), handle_, nullptr);
+ vkDestroyImageView(device_queue_->GetVulkanDevice(), handle_, nullptr);
image_type_ = IMAGE_TYPE_INVALID;
handle_ = VK_NULL_HANDLE;
}
« no previous file with comments | « gpu/vulkan/vulkan_image_view.h ('k') | gpu/vulkan/vulkan_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698