Cleanups and checks.
This commit is contained in:
parent
4dd8effd7b
commit
cc67b17ae4
|
|
@ -79,6 +79,34 @@ Frame::~Frame()
|
|||
DEBUG("Destoryed Frame");
|
||||
}
|
||||
|
||||
Frame::Frame(Frame &&other) noexcept
|
||||
: m_Device(other.m_Device)
|
||||
, m_Pool(Take(other.m_Pool))
|
||||
, m_CommandBuffer(Take(other.m_CommandBuffer))
|
||||
, m_FrameAvailableFence(Take(other.m_FrameAvailableFence))
|
||||
, m_ImageAcquireSem(Take(other.m_ImageAcquireSem))
|
||||
, m_RenderFinishSem(Take(other.m_RenderFinishSem))
|
||||
, m_FrameIdx(other.m_FrameIdx)
|
||||
, m_ImageIdx(other.m_ImageIdx)
|
||||
{
|
||||
}
|
||||
|
||||
Frame &
|
||||
Frame::operator=(Frame &&other) noexcept
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
m_Device = other.m_Device;
|
||||
m_Pool = Take(other.m_Pool);
|
||||
m_CommandBuffer = Take(other.m_CommandBuffer);
|
||||
m_FrameAvailableFence = Take(other.m_FrameAvailableFence);
|
||||
m_ImageAcquireSem = Take(other.m_ImageAcquireSem);
|
||||
m_RenderFinishSem = Take(other.m_RenderFinishSem);
|
||||
m_FrameIdx = other.m_FrameIdx;
|
||||
m_ImageIdx = other.m_ImageIdx;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Frame Manager
|
||||
|
||||
FrameManager::FrameManager(const Device *device, u32 queueFamilyIndex, u32 framesInFlight)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ struct Frame
|
|||
|
||||
Frame(const Device *device, u32 queueFamilyIndex, u32 frameCount);
|
||||
~Frame();
|
||||
|
||||
Frame(Frame &&other) noexcept;
|
||||
Frame &operator=(Frame &&other) noexcept;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Frame);
|
||||
};
|
||||
|
||||
struct FrameManager
|
||||
|
|
|
|||
|
|
@ -243,7 +243,6 @@ main(int, char **)
|
|||
vertexStaging.Write(&device, 0, vertices.size() * sizeof vertices[0], vertices.data());
|
||||
|
||||
imageStaging.Init(&device, imageFile.GetSize(), "Image Staging");
|
||||
INFO("fine {}", imageFile.GetSize());
|
||||
imageStaging.Write(&device, 0, imageFile.GetSize(), imageFile.m_Data);
|
||||
|
||||
vk::ImageMemoryBarrier imageReadyToWrite = {
|
||||
|
|
@ -668,7 +667,7 @@ CreatePipeline(const Device *device, const Swapchain *swapchain)
|
|||
.viewMask = 0,
|
||||
.colorAttachmentCount = 1,
|
||||
.pColorAttachmentFormats = &swapchain->m_Format,
|
||||
.depthAttachmentFormat = vk::Format::eD32Sfloat,
|
||||
.depthAttachmentFormat = vk::Format::eD24UnormS8Uint,
|
||||
};
|
||||
|
||||
vk::GraphicsPipelineCreateInfo pipelineCreateInfo = {
|
||||
|
|
|
|||
|
|
@ -335,7 +335,8 @@ main(int, char **)
|
|||
gui::Draw(cmd, currentAttachment);
|
||||
|
||||
cmd.pipelineBarrier(vk::PipelineStageFlagBits::eColorAttachmentOutput, vk::PipelineStageFlagBits::eAllCommands,
|
||||
{}, 0, nullptr, 0, nullptr, postRenderBarriers.size(), postRenderBarriers.data());
|
||||
{}, 0, nullptr, 0, nullptr, Cast<u32>(postRenderBarriers.size()),
|
||||
postRenderBarriers.data());
|
||||
|
||||
vk::ImageBlit blitRegion = {
|
||||
.srcSubresource =
|
||||
|
|
|
|||
Loading…
Reference in New Issue