mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-21 21:05:50 +12:00
support depth render targets
This commit is contained in:
parent
1df81c373c
commit
1ba54b44fb
4 changed files with 52 additions and 10 deletions
30
include/renderer_mtl/pica_to_mtl.hpp
Normal file
30
include/renderer_mtl/pica_to_mtl.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <Metal/Metal.hpp>
|
||||
#include "PICA/regs.hpp"
|
||||
|
||||
// HACK: both functions return a hardcoded format for now, since render pipeline needs to know the format at creation time
|
||||
namespace PICA {
|
||||
|
||||
inline MTL::PixelFormat toMTLPixelFormatColor(ColorFmt format) {
|
||||
return MTL::PixelFormatRGBA8Unorm;
|
||||
//switch (format) {
|
||||
//case ColorFmt::RGBA8: return MTL::PixelFormatRGBA8Unorm;
|
||||
//case ColorFmt::RGB8: return MTL::PixelFormatRGBA8Unorm; // TODO: return the correct format
|
||||
//case ColorFmt::RGBA5551: return MTL::PixelFormatBGR5A1Unorm;
|
||||
//case ColorFmt::RGB565: return MTL::PixelFormatB5G6R5Unorm; // TODO: check if this is correct
|
||||
//case ColorFmt::RGBA4: return MTL::PixelFormatABGR4Unorm; // TODO: check if this is correct
|
||||
//}
|
||||
}
|
||||
|
||||
inline MTL::PixelFormat toMTLPixelFormatDepth(DepthFmt format) {
|
||||
return MTL::PixelFormatDepth24Unorm_Stencil8;
|
||||
//switch (format) {
|
||||
//case DepthFmt::Depth16: return MTL::PixelFormatDepth16Unorm;
|
||||
//case DepthFmt::Unknown1: return MTL::PixelFormatInvalid;
|
||||
//case DepthFmt::Depth24: return MTL::PixelFormatDepth32Float; // TODO: is this okay?
|
||||
//case DepthFmt::Depth24Stencil8: return MTL::PixelFormatDepth24Unorm_Stencil8;
|
||||
//}
|
||||
}
|
||||
|
||||
} // namespace PICA
|
Loading…
Add table
Add a link
Reference in a new issue