2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-03 17:51:54 +00:00

Dump images from GfxImageLoadDef

This commit is contained in:
Jan
2021-04-28 00:05:56 +02:00
parent 687d1185a3
commit 12ac569bfa
14 changed files with 549 additions and 41 deletions

View File

@ -0,0 +1,35 @@
#pragma once
#include <unordered_map>
#include "Utils/ClassUtils.h"
#include "Image/DxgiFormat.h"
#include "Utils/MemoryManager.h"
#include "Image/Texture.h"
class Dx12TextureLoader
{
static std::unordered_map<ImageFormatId, ImageFormatId> m_conversion_table;
MemoryManager* m_memory_manager;
DXGI_FORMAT m_format;
TextureType m_type;
bool m_has_mip_maps;
size_t m_width;
size_t m_height;
size_t m_depth;
_NODISCARD const ImageFormat* GetFormatForDx12Format() const;
public:
explicit Dx12TextureLoader(MemoryManager* memoryManager);
Dx12TextureLoader& Format(DXGI_FORMAT format);
Dx12TextureLoader& Type(TextureType textureType);
Dx12TextureLoader& HasMipMaps(bool hasMipMaps);
Dx12TextureLoader& Width(size_t width);
Dx12TextureLoader& Height(size_t height);
Dx12TextureLoader& Depth(size_t depth);
Texture* LoadTexture(const void* data);
};