parent
59fa23497a
commit
208926062c
@ -0,0 +1,105 @@
|
||||
From 84c91abab33966f928497c24db4a39f436d2dca8 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jose.dapena@lge.com>
|
||||
Date: Fri, 07 Jun 2019 09:50:11 +0000
|
||||
Subject: [PATCH] Make SharedMemoryMapping move constructor noexcept
|
||||
|
||||
As LayerTreeHostImpl::UIResourceData move constructor is declared
|
||||
noexcept with default implementation, the move constructor of its
|
||||
members should also be noexcept. GCC will fail to build otherwise
|
||||
for mismatching noexcept declaration.
|
||||
|
||||
We also set the move assignment operator.
|
||||
|
||||
Bug: 819294
|
||||
Change-Id: Icd663da83b882e15f7d16780c9241972e09bc492
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645297
|
||||
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
|
||||
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#667064}
|
||||
---
|
||||
|
||||
diff --git a/base/memory/shared_memory_mapping.cc b/base/memory/shared_memory_mapping.cc
|
||||
index 2be2570..8426fa8 100644
|
||||
--- a/base/memory/shared_memory_mapping.cc
|
||||
+++ b/base/memory/shared_memory_mapping.cc
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
SharedMemoryMapping::SharedMemoryMapping() = default;
|
||||
|
||||
-SharedMemoryMapping::SharedMemoryMapping(SharedMemoryMapping&& mapping)
|
||||
+SharedMemoryMapping::SharedMemoryMapping(SharedMemoryMapping&& mapping) noexcept
|
||||
: memory_(mapping.memory_),
|
||||
size_(mapping.size_),
|
||||
mapped_size_(mapping.mapped_size_),
|
||||
@@ -42,7 +42,7 @@
|
||||
}
|
||||
|
||||
SharedMemoryMapping& SharedMemoryMapping::operator=(
|
||||
- SharedMemoryMapping&& mapping) {
|
||||
+ SharedMemoryMapping&& mapping) noexcept {
|
||||
Unmap();
|
||||
memory_ = mapping.memory_;
|
||||
size_ = mapping.size_;
|
||||
@@ -90,9 +90,9 @@
|
||||
|
||||
ReadOnlySharedMemoryMapping::ReadOnlySharedMemoryMapping() = default;
|
||||
ReadOnlySharedMemoryMapping::ReadOnlySharedMemoryMapping(
|
||||
- ReadOnlySharedMemoryMapping&&) = default;
|
||||
+ ReadOnlySharedMemoryMapping&&) noexcept = default;
|
||||
ReadOnlySharedMemoryMapping& ReadOnlySharedMemoryMapping::operator=(
|
||||
- ReadOnlySharedMemoryMapping&&) = default;
|
||||
+ ReadOnlySharedMemoryMapping&&) noexcept = default;
|
||||
ReadOnlySharedMemoryMapping::ReadOnlySharedMemoryMapping(
|
||||
void* address,
|
||||
size_t size,
|
||||
@@ -102,9 +102,9 @@
|
||||
|
||||
WritableSharedMemoryMapping::WritableSharedMemoryMapping() = default;
|
||||
WritableSharedMemoryMapping::WritableSharedMemoryMapping(
|
||||
- WritableSharedMemoryMapping&&) = default;
|
||||
+ WritableSharedMemoryMapping&&) noexcept = default;
|
||||
WritableSharedMemoryMapping& WritableSharedMemoryMapping::operator=(
|
||||
- WritableSharedMemoryMapping&&) = default;
|
||||
+ WritableSharedMemoryMapping&&) noexcept = default;
|
||||
WritableSharedMemoryMapping::WritableSharedMemoryMapping(
|
||||
void* address,
|
||||
size_t size,
|
||||
diff --git a/base/memory/shared_memory_mapping.h b/base/memory/shared_memory_mapping.h
|
||||
index d9569af..2b8858e 100644
|
||||
--- a/base/memory/shared_memory_mapping.h
|
||||
+++ b/base/memory/shared_memory_mapping.h
|
||||
@@ -32,8 +32,8 @@
|
||||
SharedMemoryMapping();
|
||||
|
||||
// Move operations are allowed.
|
||||
- SharedMemoryMapping(SharedMemoryMapping&& mapping);
|
||||
- SharedMemoryMapping& operator=(SharedMemoryMapping&& mapping);
|
||||
+ SharedMemoryMapping(SharedMemoryMapping&& mapping) noexcept;
|
||||
+ SharedMemoryMapping& operator=(SharedMemoryMapping&& mapping) noexcept;
|
||||
|
||||
// Unmaps the region if the mapping is valid.
|
||||
virtual ~SharedMemoryMapping();
|
||||
@@ -93,8 +93,9 @@
|
||||
ReadOnlySharedMemoryMapping();
|
||||
|
||||
// Move operations are allowed.
|
||||
- ReadOnlySharedMemoryMapping(ReadOnlySharedMemoryMapping&&);
|
||||
- ReadOnlySharedMemoryMapping& operator=(ReadOnlySharedMemoryMapping&&);
|
||||
+ ReadOnlySharedMemoryMapping(ReadOnlySharedMemoryMapping&&) noexcept;
|
||||
+ ReadOnlySharedMemoryMapping& operator=(
|
||||
+ ReadOnlySharedMemoryMapping&&) noexcept;
|
||||
|
||||
// Returns the base address of the mapping. This is read-only memory. This is
|
||||
// page-aligned. This is nullptr for invalid instances.
|
||||
@@ -171,8 +172,9 @@
|
||||
WritableSharedMemoryMapping();
|
||||
|
||||
// Move operations are allowed.
|
||||
- WritableSharedMemoryMapping(WritableSharedMemoryMapping&&);
|
||||
- WritableSharedMemoryMapping& operator=(WritableSharedMemoryMapping&&);
|
||||
+ WritableSharedMemoryMapping(WritableSharedMemoryMapping&&) noexcept;
|
||||
+ WritableSharedMemoryMapping& operator=(
|
||||
+ WritableSharedMemoryMapping&&) noexcept;
|
||||
|
||||
// Returns the base address of the mapping. This is writable memory. This is
|
||||
// page-aligned. This is nullptr for invalid instances.
|
@ -0,0 +1,115 @@
|
||||
From fdb3bb1f8c41d044a5b0cb80257a26dd3c8f83a3 Mon Sep 17 00:00:00 2001
|
||||
From: Jose Dapena Paz <jose.dapena@lge.com>
|
||||
Date: Tue, 11 Jun 2019 17:39:38 +0000
|
||||
Subject: [PATCH] GCC: do not use old C notation to assign struct with property names.
|
||||
|
||||
The notation for initialization of structs referring to its properties
|
||||
is invalid in C++. This is not accepted in GCC. It was making build
|
||||
fail in VulkanCommandBuffer.
|
||||
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc: In member function 'void gpu::VulkanCommandBuffer::TransitionImageLayout(VkImage, VkImageLayout, VkImageLayout)':
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:214:7: error: expected primary-expression before '.' token
|
||||
.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:215:7: error: expected primary-expression before '.' token
|
||||
.subresourceRange.baseMipLevel = 0,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:216:7: error: expected primary-expression before '.' token
|
||||
.subresourceRange.levelCount = 1,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:217:7: error: expected primary-expression before '.' token
|
||||
.subresourceRange.baseArrayLayer = 0,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:218:7: error: expected primary-expression before '.' token
|
||||
.subresourceRange.layerCount = 1,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc: In member function 'void gpu::VulkanCommandBuffer::CopyBufferToImage(VkBuffer, VkImage, uint32_t, uint32_t, uint32_t, uint32_t)':
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:235:7: error: expected primary-expression before '.' token
|
||||
.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:236:7: error: expected primary-expression before '.' token
|
||||
.imageSubresource.mipLevel = 0,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:237:7: error: expected primary-expression before '.' token
|
||||
.imageSubresource.baseArrayLayer = 0,
|
||||
^
|
||||
./../../../chromium-76.0.3806.1/gpu/vulkan/vulkan_command_buffer.cc:238:7: error: expected primary-expression before '.' token
|
||||
.imageSubresource.layerCount = 1,
|
||||
^
|
||||
Bug: 819294
|
||||
|
||||
Change-Id: I999abece0c727e77964789183642ba62009c2c22
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1651802
|
||||
Commit-Queue: José Dapena Paz <jose.dapena@lge.com>
|
||||
Reviewed-by: Antoine Labour <piman@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/master@{#668033}
|
||||
---
|
||||
|
||||
diff --git a/gpu/vulkan/vulkan_command_buffer.cc b/gpu/vulkan/vulkan_command_buffer.cc
|
||||
index ba776e4..4f14c85 100644
|
||||
--- a/gpu/vulkan/vulkan_command_buffer.cc
|
||||
+++ b/gpu/vulkan/vulkan_command_buffer.cc
|
||||
@@ -207,21 +207,20 @@
|
||||
void VulkanCommandBuffer::TransitionImageLayout(VkImage image,
|
||||
VkImageLayout old_layout,
|
||||
VkImageLayout new_layout) {
|
||||
- VkImageMemoryBarrier barrier = {
|
||||
- .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
|
||||
- .srcAccessMask = GetAccessMask(old_layout),
|
||||
- .dstAccessMask = GetAccessMask(new_layout),
|
||||
- .oldLayout = old_layout,
|
||||
- .newLayout = new_layout,
|
||||
- .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
- .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
|
||||
- .image = image,
|
||||
- .subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
- .subresourceRange.baseMipLevel = 0,
|
||||
- .subresourceRange.levelCount = 1,
|
||||
- .subresourceRange.baseArrayLayer = 0,
|
||||
- .subresourceRange.layerCount = 1,
|
||||
- };
|
||||
+ VkImageMemoryBarrier barrier = {};
|
||||
+ barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
|
||||
+ barrier.srcAccessMask = GetAccessMask(old_layout);
|
||||
+ barrier.dstAccessMask = GetAccessMask(new_layout);
|
||||
+ barrier.oldLayout = old_layout;
|
||||
+ barrier.newLayout = new_layout;
|
||||
+ barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
+ barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
|
||||
+ barrier.image = image;
|
||||
+ barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
+ barrier.subresourceRange.baseMipLevel = 0;
|
||||
+ barrier.subresourceRange.levelCount = 1;
|
||||
+ barrier.subresourceRange.baseArrayLayer = 0;
|
||||
+ barrier.subresourceRange.layerCount = 1;
|
||||
vkCmdPipelineBarrier(command_buffer_, GetPipelineStageFlags(old_layout),
|
||||
GetPipelineStageFlags(new_layout), 0, 0, nullptr, 0,
|
||||
nullptr, 1, &barrier);
|
||||
@@ -233,17 +232,16 @@
|
||||
uint32_t buffer_height,
|
||||
uint32_t width,
|
||||
uint32_t height) {
|
||||
- VkBufferImageCopy region = {
|
||||
- .bufferOffset = 0,
|
||||
- .bufferRowLength = buffer_width,
|
||||
- .bufferImageHeight = buffer_height,
|
||||
- .imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
- .imageSubresource.mipLevel = 0,
|
||||
- .imageSubresource.baseArrayLayer = 0,
|
||||
- .imageSubresource.layerCount = 1,
|
||||
- .imageOffset = {0, 0, 0},
|
||||
- .imageExtent = {width, height, 1},
|
||||
- };
|
||||
+ VkBufferImageCopy region = {};
|
||||
+ region.bufferOffset = 0;
|
||||
+ region.bufferRowLength = buffer_width;
|
||||
+ region.bufferImageHeight = buffer_height;
|
||||
+ region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
+ region.imageSubresource.mipLevel = 0;
|
||||
+ region.imageSubresource.baseArrayLayer = 0;
|
||||
+ region.imageSubresource.layerCount = 1;
|
||||
+ region.imageOffset = {0, 0, 0};
|
||||
+ region.imageExtent = {width, height, 1};
|
||||
vkCmdCopyBufferToImage(command_buffer_, buffer, image,
|
||||
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion);
|
||||
}
|
Loading…
Reference in new issue