Vulkan/RenderBuffer: WIP

This commit is contained in:
Lynix 2017-09-16 10:36:41 +02:00
parent 8a55888ada
commit c4edf54297
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,39 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_RENDERBUFFER_HPP
#define NAZARA_RENDERBUFFER_HPP
#include <Nazara/Renderer/Config.hpp>
#include <Nazara/Utility/AbstractBuffer.hpp>
#include <Nazara/Utility/SoftwareBuffer.hpp>
namespace Nz
{
class NAZARA_RENDERER_API RenderBuffer : public AbstractBuffer
{
public:
RenderBuffer() = default;
~RenderBuffer() = default;
virtual bool Fill(const void* data, UInt32 offset, UInt32 size) = 0;
bool Initialize(UInt32 size, BufferUsageFlags usage) override;
DataStorage GetStorage() const override;
virtual void* Map(BufferAccess access, UInt32 offset = 0, UInt32 size = 0) = 0;
virtual bool Unmap() = 0;
private:
SoftwareBuffer m_softwareBuffer;
};
}
#include <Nazara/Renderer/RenderBuffer.inl>
#endif // NAZARA_RENDERBUFFER_HPP

View File

@ -0,0 +1,12 @@
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <memory>
#include <Nazara/Renderer/Debug.hpp>
namespace Nz
{
}
#include <Nazara/Renderer/DebugOff.hpp>

View File

@ -0,0 +1,20 @@
// Copyright (C) 2015 Jérôme Leclercq
// This file is part of the "Nazara Engine - Renderer module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Renderer/RenderBuffer.hpp>
#include <Nazara/Renderer/Debug.hpp>
namespace Nz
{
bool RenderBuffer::Initialize(UInt32 size, BufferUsageFlags usage)
{
m_softwareBuffer.Initialize(size, usage);
return true;
}
DataStorage Nz::RenderBuffer::GetStorage() const
{
return DataStorage::DataStorage_Hardware;
}
}