if(r > 1.0f)
r -= 1.0f;
- clearValues[0].color.setFloat32({0.0f, 1.0f, 0.0f, 1.0f});
+ clearValues[0].color.setFloat32({0.0f, 0.0f, 0.0f, 1.0f});
clearValues[1].depthStencil.setDepth(1.0f).setStencil(0.0f);
auto rpInfo = vk::RenderPassBeginInfo{};
void Surface::AddSwapchainImage(vk::Image image, std::vector< SwapchainImage >& swapchainImages)
{
auto swapImage = std::move(SwapchainImage{});
- swapImage.image = MakeRef<Image>( mGraphics, image );
+ swapImage.image = NewRef<Image>( mGraphics, vk::ImageCreateInfo{}, image );
// create ImageView
CreateImageView(swapImage);
auto ivInfo = vk::ImageViewCreateInfo{};
ivInfo.setFormat(mFormat)
.setComponents(VK_COMPONENT_MAPPING_RGBA)
- .setImage(swapImage.image->GetImage())
+ .setImage(swapImage.image->GetVkImage())
.setSubresourceRange(vk::ImageSubresourceRange()
.setAspectMask(vk::ImageAspectFlagBits::eColor)
.setBaseArrayLayer(0)
.setLevelCount(1))
.setViewType(vk::ImageViewType::e2D);
- swapImage.imageView = swapImage.image->CreateView( ivInfo );
+ swapImage.imageView = ImageView::New( mGraphics, swapImage.image, ivInfo );
}
void Surface::CreateFramebuffer(SwapchainImage& swapImage)
{
vk::FramebufferCreateInfo fbInfo;
fbInfo.setAttachmentCount(mHasDepthStencil ? 2 : 1)
- .setPAttachments(&swapImage.imageView->GetImageView()) // todo: add depth/stencil attachment
+ .setPAttachments(&swapImage.imageView->GetVkImageView()) // todo: add depth/stencil attachment
.setHeight(mExtent.height)
.setWidth(mExtent.width)
.setLayers(1)
// Record layout transition for each image, after transition command buffers will be re-recorded
// and will take in account only present -> color layout transition
swapImage.layoutToColorCmdBuf->Begin();
- swapImage.layoutToColorCmdBuf->ImageLayoutTransition(swapImage.image->GetImage(),
+ swapImage.layoutToColorCmdBuf->ImageLayoutTransition(swapImage.image->GetVkImage(),
swapImage.layout,
vk::ImageLayout::eColorAttachmentOptimal,
vk::ImageAspectFlagBits::eColor);
{
swapImage.layoutToColorCmdBuf->Reset();
swapImage.layoutToColorCmdBuf->Begin();
- swapImage.layoutToColorCmdBuf->ImageLayoutTransition(swapImage.image->GetImage(),
+ swapImage.layoutToColorCmdBuf->ImageLayoutTransition(swapImage.image->GetVkImage(),
vk::ImageLayout::ePresentSrcKHR,
vk::ImageLayout::eColorAttachmentOptimal,
vk::ImageAspectFlagBits::eColor);