Although I've gotten things to work somewhat, I still wish I could use the default (and higher-resolution) depth stencil format, PFG_D32_FLOAT_S8X24_UINT
, which when using Metal translates to MTLPixelFormatDepth32Float_Stencil8
.
One thing I wonder about is that I found some messages online saying that in order to copy from Metal textures reliably, you need to use MTLStoreActionStore
, not MTLStoreActionDontCare
. And it looks like Ogre is using MTLStoreActionDontCare
. I tried changing that, by messing with the mStoreActionDepth
member of a CompositorPassSceneDef
, but it didn't seem to fix anything.
I also notice that Ogre seems to assume that PFG_D32_FLOAT_S8X24_UINT
is a 64-bit format, which might not be the case for MTLPixelFormatDepth32Float_Stencil8
. Apple's docs on MTLPixelFormatDepth32Float_Stencil8
say it is a 40-bit format, but "some Metal device objects allocate 64-bits per pixel". So presumably in some other cases, it is 40 bits per pixel.