No need to glFlush() right before glReadPixels(...)

fbshipit-source-id: 185da7c
This commit is contained in:
Nikhilesh Sigatapu
2016-11-05 06:47:36 +00:00
committed by Exponent GitHub Bot
parent cbd915e611
commit 63aa6296cd

View File

@@ -720,14 +720,12 @@ private:
size_t byteLength = width * height * bytesPerPixel(type, format);
auto pixels = std::shared_ptr<void>(malloc(byteLength), free);
addBlockingToNextBatch([&] {
glFlush();
glReadPixels(x, y, width, height, format, type, pixels.get());
});
JSObjectSetTypedArrayData(jsCtx, (JSObjectRef) jsArgv[6], pixels.get(), byteLength);
} else {
void *pixels = JSObjectGetTypedArrayBytesPtr(jsCtx, (JSObjectRef) jsArgv[6], NULL);
addBlockingToNextBatch([&] {
glFlush();
glReadPixels(x, y, width, height, format, type, pixels);
});
}