/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/RendererVulkan/Resources/BufferVulkan.h
65 строк
2 KB
Sanakan8472
Copy / Readback fixes (#1963)
11 июн 2026, 18:07
Не верифицирован
11 июн 2026, 18:07
b50d6f1
Код
Авторство
О чём код?
#pragma once #include <RendererVulkan/RendererVulkanDLL.h> #include <RendererFoundation/Resources/Buffer.h> #include <RendererVulkan/Device/DeviceVulkan.h> class EZ_RENDERERVULKAN_DLL ezGALBufferVulkan : public ezGALBuffer { public: EZ_ALWAYS_INLINE vk::Buffer GetVkBuffer() const; const vk::DescriptorBufferInfo& GetBufferInfo() const; EZ_ALWAYS_INLINE vk::IndexType GetIndexType() const; EZ_ALWAYS_INLINE ezVulkanAllocation GetAllocation() const; EZ_ALWAYS_INLINE const ezVulkanAllocationInfo& GetAllocationInfo() const; EZ_ALWAYS_INLINE vk::PipelineStageFlags GetUsedByPipelineStage() const; EZ_ALWAYS_INLINE vk::AccessFlags GetAccessMask() const; vk::BufferView GetTexelBufferView(ezGALBufferRange bufferRange, ezEnum<ezGALResourceFormat> overrideTexelBufferFormat) const; static vk::DeviceSize GetAlignment(const ezGALDeviceVulkan* pDevice, vk::BufferUsageFlags usage); protected: friend class ezGALDeviceVulkan; friend class ezMemoryUtils; ezGALBufferVulkan(const ezGALBufferCreationDescription& Description); virtual ~ezGALBufferVulkan(); virtual ezResult InitPlatform(ezGALDevice* pDevice, ezArrayPtr<const ezUInt8> pInitialData) override; virtual ezResult DeInitPlatform(ezGALDevice* pDevice) override; virtual void SetDebugNamePlatform(const char* szName) const override; void CreateBuffer(); protected: vk::Buffer m_Buffer = {}; ezVulkanAllocation m_pAlloc = {}; ezVulkanAllocationInfo m_AllocInfo = {}; vk::DescriptorBufferInfo m_ResourceBufferInfo = {}; // Data for memory barriers and access vk::PipelineStageFlags m_Stages = {}; vk::AccessFlags m_Access = {}; vk::IndexType m_IndexType = vk::IndexType::eUint16; // Only applicable for index buffers vk::BufferUsageFlags m_Usage = {}; vk::DeviceSize m_Size = 0; ezGALDeviceVulkan* m_pDeviceVulkan = nullptr; vk::Device m_Device = {}; // Views struct View : ezHashableStruct<View> { ezGALBufferRange m_BufferRange; ezEnum<ezGALResourceFormat> m_OverrideTexelBufferFormat; EZ_ALWAYS_INLINE static ezUInt32 Hash(const View& value) { return value.CalculateHash(); } EZ_ALWAYS_INLINE static bool Equal(const View& a, const View& b) { return a == b; } }; mutable ezHashTable<View, vk::BufferView, View> m_TexelBufferViews; mutable ezString m_sDebugName; }; #include <RendererVulkan/Resources/Implementation/BufferVulkan_inl.h>