--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/4f845dff-8a9f-4649-8373-caa265167d95%40googlegroups.com.
SwiftShader currently only targets desktop platforms (Windows, Linux, MacOS). It is indeed used in the Android Emulator, but not on Android, at the moment.
2017-06-14 10:53 GMT-04:00 edward yuki <edward...@gmail.com>:
Besides, I was also wondering how swiftshader implements eglSwapBuffers on android?
On Wednesday, June 14, 2017 at 10:27:59 PM UTC+8, edward yuki wrote:Hi list:Is it possible to use swiftshader to act as a replacement for render libraries for apps on android, without using the vendor provided library?I tested the emulator (API 24/25 with swiftshader as GLES/GL library), and it seems apps are running in software rendering mode6-14 13:13:57.572 3775 3838 E libEGL : validate_display:99 error 3008 (EGL_BAD_DISPLAY)And isHardwareAccelerated returns false.I know it sound wired, but for some reasons I'm trying to not use the vendor provided library/GPU device for certain apps, and that's why I'm testing swiftshader.Thanks!
--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
Hi:Thanks for your reply. Actually I didn't quite understand this because if it's running in android emulator, it should contains an eglSwapBuffers impl for android.
Since it's used internally in the android emulator, (/vendor/lib/egl/libGL*swiftshader*.so), If I compile the ARM version of swiftshader, it should also work on arm android devices, is it the case?
Or it's still lacking something for the ARM version?Thanks.
On Wednesday, June 14, 2017 at 11:01:46 PM UTC+8, Alexis Hétu wrote:SwiftShader currently only targets desktop platforms (Windows, Linux, MacOS). It is indeed used in the Android Emulator, but not on Android, at the moment.2017-06-14 10:53 GMT-04:00 edward yuki <edward...@gmail.com>:Besides, I was also wondering how swiftshader implements eglSwapBuffers on android?--
On Wednesday, June 14, 2017 at 10:27:59 PM UTC+8, edward yuki wrote:Hi list:Is it possible to use swiftshader to act as a replacement for render libraries for apps on android, without using the vendor provided library?I tested the emulator (API 24/25 with swiftshader as GLES/GL library), and it seems apps are running in software rendering mode6-14 13:13:57.572 3775 3838 E libEGL : validate_display:99 error 3008 (EGL_BAD_DISPLAY)And isHardwareAccelerated returns false.I know it sound wired, but for some reasons I'm trying to not use the vendor provided library/GPU device for certain apps, and that's why I'm testing swiftshader.Thanks!
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader...@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/4f845dff-8a9f-4649-8373-caa265167d95%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "swiftshader" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/d96c46d4-d9bd-4459-91db-0f968794a6c6%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.
To post to this group, send email to swift...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/2a3c9de5-8cc9-43de-8ddf-c96f53fc69e7%40googlegroups.com.
Hi Nicolas:
However, SwiftShader does support "headless" rendering. You can create an EGL pbuffer surface, render to it, and read the result back with glReadPixels() without using any system-specific graphics buffers. We don't have any proof of concept of this on Android though, especially on ARM since that's still under active development and will take a while to finish.
I just tried render with eglCreatePbufferSurface and do not render on system graphics buffer, but the pixels read back using glReadPixels are all zero. The same code works fine with adreno EGL/GLES library.Main code is:EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(display, 0, 0);
eglChooseConfig(display, attribs, &config, 1, &numConfigs);
surface = eglCreatePbufferSurface(display, config, surfaceAttr);
//surface = eglCreateWindowSurface(display, config, s.get(), NULL);
context = eglCreateContext(display, config, NULL, NULL);
eglQuerySurface(display, surface, EGL_WIDTH, &w);
eglQuerySurface(display, surface, EGL_HEIGHT, &h);
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
return NO_INIT;and
char *buf = new char[mWidth*mHeight*4];
printf("mwidth %d height%d\n", mWidth, mHeight);
glViewport(0, 0, mWidth, mHeight);
eglSwapBuffers(mDisplay, mSurface);
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0.5, 0.5, 0.5, 0);
glFlush();
EGLBoolean res = eglSwapBuffers(mDisplay, mSurface);
glReadPixels(0,0,mWidth,mHeight,GL_RGBA, GL_UNSIGNED_BYTE, buf);
FILE* f = fopen("/data/local/tmp/1.raw", "w");
fwrite(buf, mWidth*mHeight*4, 1, f);
fclose(f);
}I've also attached the source.Maybe I'm missing something on arm version? Seems the rendering result is totally unwritten to buffer, even with offline surface.Thanks! Wishing to hear back from you.On Thursday, June 15, 2017 at 8:34:16 PM UTC+8, edward yuki wrote:The drawing related statements in my sample are only these simple ones :bool BootAnimation::android(){//...glViewport(0, 0, mWidth, mHeight);eglSwapBuffers(mDisplay, mSurface);//...while(1){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glClearColor(0.5, 0.5, 0.5, 0);EGLBoolean res = eglSwapBuffers(mDisplay, mSurface);}return false;}
On Thursday, June 15, 2017 at 8:29:00 PM UTC+8, edward yuki wrote:HI Nicolas:Thanks for your reply, I really appreciate it.Actually I did not try to replace the physical device's EGL/GL library(e.g. adreno on Nexus6P), I was trying to use swiftshader as a per-process replacement, given the single process itself does not have access to GPU, but still want to draw use OpenGLThe rendering target is still ANaitveWindow(or, GraphicBuffer) handled back by SurfaceFlinger (actually on android I think normally only surfaceflinger will call gralloc functions, and apps & normal processes get back GraphicBuffer from SurfaceFlinger. Surfaceflinger still uses default vendor provided/hardware backed render library, only the single client process use SwiftShader).For example, a typical render process on AndroidANativeWindow* window = ANativeWindow_fromSurface(env, javaSurface); ANativeWindow_Buffer buffer; if (ANativeWindow_lock(window, &buffer, NULL) == 0) { //DRAW: draw pixel on buffer ANativeWindow_unlockAndPost(window); }
After applying the patch you mentioned (https://swiftshader-review.googlesource.com/9588) and compiled an ARM version of swiftshader, I crafted a quick demo which requests Surface from surfaceflinger on nexus6p and use EGL/GL to draw on it. It's similar to android's bootanimation binary. The binary runs fine with stock libraries, However I replaces stock EGL/GLES library with SwiftShader's and it seems the drawing commands are not in effect. The surface stays black.I didn't see any error log though, seems the EGL functions are working correctly.I have minimized the OpenGL functions used to simple glClear and glClearColor and no shader source is involved. But the surface still stays black.Is this an intended behavior or I'm just missing something? In my understanding, since the surface/GraphicBuffer has already been successfully requested, SwiftShader should be able to draw on the buffer just like the normal Android software renderer using Skia, what's the lacking piece?I've attached my test demo source/binary. I changed the loading path of libGLESv1_CM_swiftshader and use LD_LIBRARY_PATH to load swiftshader libraries instead of system ones. My command line is like://copy swiftshader arm libraries to /data/local/tmp///cd /data/local/tmp///LD_LIBRARY_PATH=. ./animtestAlso attached the debug log. animtest.tar.gz contains the test binary's source and compiled binary tested on Android 6.0.1.I would be grateful if you could shed some light on this. Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to swiftshader+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/e9650a15-ab70-404b-abf2-0cf61fbe9e2b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swiftshader/4b5f6234-75b2-4d82-bf62-08531a17d22a%40googlegroups.com.