axmol/core/renderer/backend/metal/RenderTargetMTL.h

41 lines
1.1 KiB
C
Raw Normal View History

#pragma once
#include "../RenderTarget.h"
#include "CommandBufferMTL.h"
NS_AX_BACKEND_BEGIN
class RenderTargetMTL : public RenderTarget
{
public:
2021-12-25 10:04:45 +08:00
struct Attachment
{
id<MTLTexture> texture = nil;
2021-12-25 10:04:45 +08:00
int level = 0;
explicit operator bool() const { return texture != nullptr; }
};
2021-12-25 10:04:45 +08:00
/*
2021-12-25 10:04:45 +08:00
* generateFBO, false, use for screen framebuffer
*/
RenderTargetMTL(bool defaultRenderTarget);
~RenderTargetMTL();
void applyRenderPassAttachments(const RenderPassDescriptor&, MTLRenderPassDescriptor*) const;
2021-12-25 10:04:45 +08:00
Attachment getColorAttachment(int index) const;
Attachment getDepthAttachment() const;
Attachment getStencilAttachment() const;
2021-12-25 10:04:45 +08:00
PixelFormat getColorAttachmentPixelFormat(int index) const;
PixelFormat getDepthAttachmentPixelFormat() const;
PixelFormat getStencilAttachmentPixelFormat() const;
2021-12-25 10:04:45 +08:00
public:
// "Sidecar" textures used to implement automatic MSAA resolve.
// id<MTLTexture> multisampledColor[MRT::TARGET_COUNT] = { 0 };
// id<MTLTexture> multisampledDepth = nil;
// MetalContext*, DeviceMTL*
};
NS_AX_BACKEND_END