Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

[Metal]readpixel (MTLTexture::getpixels) on a separate thread.

$
0
0
/////////////////////////// id<MTLTexture> m_texture; // got from main/renader thread void ReadPixels() { std::vector<uint8_t> buffer; buffer.resize(bufferSize); [m_texture getBytes:buffer.data() bytesPerRow:[m_texture 32] * 4 fromRegion:MTLRegionMake2D(0 0 32 32) mipmapLevel:0]; } //////////////////////////////////////////// ReadPixels works well when called by main/render thread. it crashed in separate thread call. i want to make MTLTexture::getbytes worked as opengles sharegroup/eagl sharecontext/egl. but i do not know the property way.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>