MCPcopy Create free account
hub / github.com/Inori/GPCS4 / createSwapImageViews

Method createSwapImageViews

GPCS4/Graphics/Sce/SceSwapchain.cpp:178–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176 }
177
178 void SceSwapchain::createSwapImageViews()
179 {
180 PresenterInfo info = m_presenter->info();
181
182 m_imageViews.clear();
183 m_imageViews.resize(info.imageCount);
184
185 VltImageCreateInfo imageInfo;
186 imageInfo.type = VK_IMAGE_TYPE_2D;
187 imageInfo.format = info.format.format;
188 imageInfo.flags = 0;
189 imageInfo.sampleCount = VK_SAMPLE_COUNT_1_BIT;
190 imageInfo.extent = { info.imageExtent.width, info.imageExtent.height, 1 };
191 imageInfo.numLayers = 1;
192 imageInfo.mipLevels = 1;
193 imageInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
194 imageInfo.stages = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
195 imageInfo.access = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
196 imageInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
197 imageInfo.layout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
198
199 VltImageViewCreateInfo viewInfo;
200 viewInfo.type = VK_IMAGE_VIEW_TYPE_2D;
201 viewInfo.format = info.format.format;
202 viewInfo.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
203 viewInfo.aspect = VK_IMAGE_ASPECT_COLOR_BIT;
204 viewInfo.minLevel = 0;
205 viewInfo.numLevels = 1;
206 viewInfo.minLayer = 0;
207 viewInfo.numLayers = 1;
208
209 for (uint32_t i = 0; i < info.imageCount; i++)
210 {
211 VkImage imageHandle = m_presenter->getImage(i).image;
212
213 Rc<VltImage> image =
214 m_device.device->createImageFromVkImage(imageInfo, imageHandle);
215
216 m_imageViews[i] =
217 m_device.device->createImageView(image, viewInfo);
218 }
219 }
220
221 void SceSwapchain::transitionImageLayout()
222 {

Callers

nothing calls this directly

Calls 6

getImageMethod · 0.80
infoMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45
createImageViewMethod · 0.45

Tested by

no test coverage detected