Merge "Skip snapshot when using unsupported EGLImage target" into main
diff --git a/host/gl/glestranslator/EGL/EglImp.cpp b/host/gl/glestranslator/EGL/EglImp.cpp
index f2fc602..c5de1e5 100644
--- a/host/gl/glestranslator/EGL/EglImp.cpp
+++ b/host/gl/glestranslator/EGL/EglImp.cpp
@@ -31,6 +31,7 @@
#include "aemu/base/system/System.h"
#include "aemu/base/SharedLibrary.h"
#include "host-common/GfxstreamFatalError.h"
+#include "host-common/emugl_vm_operations.h"
#include "host-common/logging.h"
#include "EglWindowSurface.h"
@@ -1387,39 +1388,40 @@
{
VALIDATE_DISPLAY(display);
- if (target != EGL_GL_TEXTURE_2D_KHR) {
- // Create image from underlying and add to registry
- EGLImage image = dpy->createNativeImage(dpy->getHostDriverDisplay(), 0, target, buffer, attrib_list);
+ if (target != EGL_GL_TEXTURE_2D_KHR) {
+ // Create image from underlying and add to registry
+ EGLImage image = dpy->createNativeImage(dpy->getHostDriverDisplay(), 0, target, buffer, attrib_list);
- if (image == EGL_NO_IMAGE_KHR) {
- return EGL_NO_IMAGE_KHR;
- }
+ if (image == EGL_NO_IMAGE_KHR) {
+ return EGL_NO_IMAGE_KHR;
+ }
- ImagePtr img( new EglImage() );
- img->isNative = true;
- img->nativeImage = image;
- img->width = 0;
- img->height = 0;
- if (attrib_list) {
- const EGLint* current = attrib_list;
- while (EGL_NONE != *current) {
- switch (*current) {
- case EGL_WIDTH:
- img->width = current[1];
- break;
- case EGL_HEIGHT:
- img->height = current[1];
- break;
- case EGL_LINUX_DRM_FOURCC_EXT:
- // TODO: Translate drm fourcc to internal format
- // img->fourcc = current[1];
- break;
- }
- current += 2;
- }
- }
- return dpy->addImageKHR(img);
- }
+ ImagePtr img( new EglImage() );
+ img->isNative = true;
+ img->nativeImage = image;
+ img->width = 0;
+ img->height = 0;
+ if (attrib_list) {
+ const EGLint* current = attrib_list;
+ while (EGL_NONE != *current) {
+ switch (*current) {
+ case EGL_WIDTH:
+ img->width = current[1];
+ break;
+ case EGL_HEIGHT:
+ img->height = current[1];
+ break;
+ case EGL_LINUX_DRM_FOURCC_EXT:
+ // TODO: Translate drm fourcc to internal format
+ // img->fourcc = current[1];
+ break;
+ }
+ current += 2;
+ }
+ }
+ get_emugl_vm_operations().setSkipSnapshotSave(true);
+ return dpy->addImageKHR(img);
+ }
ThreadInfo* thread = getThreadInfo();
ShareGroupPtr sg = thread->shareGroup;