Metal backend, part 7
This commit is contained in:
parent
1e147ec4e5
commit
e180bb5ea0
|
@ -32,6 +32,14 @@ struct FurnaceGUIRenderMetalPrivate {
|
||||||
id<MTLRenderCommandEncoder> renderEncoder;
|
id<MTLRenderCommandEncoder> renderEncoder;
|
||||||
id<CAMetalDrawable> drawable;
|
id<CAMetalDrawable> drawable;
|
||||||
MTLRenderPassDescriptor* renderPass;
|
MTLRenderPassDescriptor* renderPass;
|
||||||
|
|
||||||
|
FurnaceGUIRenderMetalPrivate():
|
||||||
|
context(NULL),
|
||||||
|
cmdQueue(NULL),
|
||||||
|
cmdBuf(NULL),
|
||||||
|
renderEncoder(NULL),
|
||||||
|
drawable(NULL),
|
||||||
|
renderPass(NULL) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class FurnaceMetalTexture: public FurnaceGUITexture {
|
class FurnaceMetalTexture: public FurnaceGUITexture {
|
||||||
|
@ -99,6 +107,20 @@ void FurnaceGUIRenderMetal::clear(ImVec4 color) {
|
||||||
int outW, outH;
|
int outW, outH;
|
||||||
getOutputSize(outW,outH);
|
getOutputSize(outW,outH);
|
||||||
priv->context.drawableSize=CGSizeMake(outW,outH);
|
priv->context.drawableSize=CGSizeMake(outW,outH);
|
||||||
|
|
||||||
|
if (priv->drawable) {
|
||||||
|
[priv->drawable release];
|
||||||
|
priv->drawable=NULL;
|
||||||
|
}
|
||||||
|
if (priv->cmdBuf) {
|
||||||
|
[priv->cmdBuf release];
|
||||||
|
priv->cmdBuf=NULL;
|
||||||
|
}
|
||||||
|
if (priv->renderEncoder) {
|
||||||
|
[priv->renderEncoder release];
|
||||||
|
priv->renderEncoder=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
priv->drawable=[priv->context nextDrawable];
|
priv->drawable=[priv->context nextDrawable];
|
||||||
|
|
||||||
priv->cmdBuf=[priv->cmdQueue commandBuffer];
|
priv->cmdBuf=[priv->cmdQueue commandBuffer];
|
||||||
|
|
Loading…
Reference in a new issue