2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 12:31:20 +00:00
metaforce/aurora/lib/gfx/texture_convert.hpp
Luke Street 22dfd3b3f7 aurora: Rework texture binding API
- Texture binding is now handled by GX calls
- More CCubeMaterial / CCubeRenderer impl
- Semi-working thermal visor rendering
- More CGraphicsPalette impl
- Some CWorldShadow impl
- Start work on indirect texturing
- Stub out CTextRenderBuffer
2022-05-13 19:40:31 -04:00

26 lines
658 B
C++

#pragma once
#include "common.hpp"
#include "../gpu.hpp"
namespace aurora::gfx {
static wgpu::TextureFormat to_wgpu(GX::TextureFormat format) {
switch (format) {
case GX::TF_C8:
case GX::TF_I8:
return wgpu::TextureFormat::R8Unorm;
case GX::TF_CMPR:
if (gpu::g_device.HasFeature(wgpu::FeatureName::TextureCompressionBC)) {
return wgpu::TextureFormat::BC1RGBAUnorm;
}
[[fallthrough]];
default:
return wgpu::TextureFormat::RGBA8Unorm;
}
}
ByteBuffer convert_texture(GX::TextureFormat format, uint32_t width, uint32_t height, uint32_t mips,
ArrayRef<uint8_t> data);
} // namespace aurora::gfx