添加多模型渲染,添加贴图渲染,添加平行光, 暂时不上传assets

This commit is contained in:
2026-09-21 14:07:20 +08:00
parent 381b7c0aa6
commit 7d628f8d8a
37 changed files with 9817 additions and 189 deletions
+9 -2
View File
@@ -9,12 +9,14 @@
#include <cstring>
#include "Engine/Core/Stats.h"
namespace Engine {
Buffer::Buffer(Device& device, MemoryAllocator& allocator,
vk::DeviceSize size, vk::BufferUsageFlags usage,
vk::MemoryPropertyFlags memProps)
: m_Device(device), m_Size(size)
: m_Device(device), m_Allocator(allocator) , m_Size(size)
{
vk::BufferCreateInfo bufferInfo;
bufferInfo.setSize(size)
@@ -31,12 +33,17 @@ namespace Engine {
m_MappedPtr = alloc.MappedPtr;
m_Device.GetDevice().bindBufferMemory(m_Buffer, m_Memory, m_Offset);
}
m_Allocation = alloc; // 成员变量,保存起来
STATS.AddBuffer(m_Size);
}
Buffer::~Buffer()
{
m_Device.GetDevice().destroyBuffer(m_Buffer);
m_Allocator.Free(m_Allocation);
STATS.RemoveBuffer(m_Size);
}
void Buffer::Upload(const void* data, vk::DeviceSize size, vk::DeviceSize offset)