Skip to content

Commit 2414bbc

Browse files
committed
Update base for Update on "[11/n][ET-VK] Introduce vTensor creation from external image"
Nearly all metadata is initialized to null/dummy values, except those absolutely needed in the pipeline: (1) image extents, (2) logical limits. Differential Revision: [D63843819](https://our.internmc.facebook.com/intern/diff/D63843819/) [ghstack-poisoned]
1 parent 95dfdfd commit 2414bbc

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

backends/vulkan/runtime/vk_api/memory/Allocator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ VulkanImage Allocator::create_image(
134134
image_props,
135135
view_props,
136136
sampler_props,
137-
initial_layout,
138137
sampler,
138+
initial_layout,
139139
allocate_memory);
140140
}
141141

backends/vulkan/runtime/vk_api/memory/Image.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ VulkanImage::VulkanImage(
115115
const ImageProperties& image_props,
116116
const ViewProperties& view_props,
117117
const SamplerProperties& sampler_props,
118-
const VkImageLayout layout,
119118
VkSampler sampler,
119+
const VkImageLayout layout,
120120
const bool allocate_memory)
121121
: device_{device},
122122
image_properties_(image_props),
@@ -186,7 +186,8 @@ VulkanImage::VulkanImage(
186186
const ImageProperties& image_props,
187187
VkImage image,
188188
VkImageView image_view,
189-
VkSampler sampler)
189+
VkSampler sampler,
190+
const VkImageLayout layout)
190191
: device_{device},
191192
image_properties_{image_props},
192193
view_properties_{},
@@ -200,7 +201,7 @@ VulkanImage::VulkanImage(
200201
image_view,
201202
sampler,
202203
},
203-
layout_{VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL} {}
204+
layout_{layout} {}
204205

205206
VulkanImage::VulkanImage(const VulkanImage& other) noexcept
206207
: device_(other.device_),

backends/vulkan/runtime/vk_api/memory/Image.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,17 @@ class VulkanImage final {
9999
const ImageProperties&,
100100
const ViewProperties&,
101101
const SamplerProperties&,
102-
const VkImageLayout layout,
103102
VkSampler,
103+
const VkImageLayout,
104104
const bool allocate_memory = true);
105105

106106
explicit VulkanImage(
107107
VkDevice,
108108
const ImageProperties&,
109109
VkImage,
110110
VkImageView,
111-
VkSampler);
111+
VkSampler,
112+
const VkImageLayout);
112113

113114
protected:
114115
/*

0 commit comments

Comments
 (0)