Closed xeechou closed 5 years ago
Hi @xeechou,
If I understand what you are trying to do correctly, your application would do something like:
Am I correct?
That should indeed work. Have you checked you are setting the viewport and scissor regions properly after (3) ?
The EGL_KHR_surfaceless_context extension states the following:
Append to the paragraph starting "The first time an OpenGL or OpenGL
ES context is made current..." with
"If the first time <ctx> is made current, it is without a default
framebuffer (e.g. both <draw> and <read> are EGL_NO_SURFACE), then
the viewport and scissor regions are set as though
glViewport(0,0,0,0) and glScissor(0,0,0,0) were called."
Also, if you have a test app that reproduces the issue and you can share it, that would save us some time.
Thanks.
Thanks for your reply. Yes, it is indeed what I am doing, I call glSicssor
every frame. I haven't tried the glViewport though. I will update on this tomorrow.
Before I was using the real EGLSurface and I didn't experience any problem. I also checked the EGL_RENDER_BUFFER
it appeared no problem, I hope it could be a simple fix with glViewPort
.
Update:
Applied glScissor
and and glViewport
to the application, I still got the same result. Here is my code for make current:
app_surface->eglwin = wl_egl_window_create(app_surface->wl_surface,
app_surface->w,
app_surface->h);
assert(app_surface->eglwin);
app_surface->eglsurface =
eglCreateWindowSurface(env->egl_display,
env->config,
(EGLNativeWindowType)app_surface->eglwin,
NULL);
assert(app_surface->eglsurface);
assert(eglMakeCurrent(env->egl_display, app_surface->eglsurface,
app_surface->eglsurface, env->egl_context));
glViewport(0, 0, app_surface->w, app_surface->h);
glScissor(0, 0, app_surface->w, app_surface->h);
And this is the result I got:
While supposingly I should have:
I am on a ubuntu 18.04 machine with nvidia-390 driver. Hope this helps.
Thanks
@xeechou , in order to try to reproduce this, I hacked into weston-simple-egl to make a surfaceless context current in init_egl()
. Then, after init_gl()
is called to create the different shaders and whatnot, I create the EGL surface with weston_platform_create_egl_surface()
, and make it current.
Everything works fine for me.
I'd double check your application, maybe taking weston-simple-egl as example.
Otherwise, my suggestion would be for you to provide the source code of a minimal application that reproduces the issue so we can work from there.
Thanks for your patience, I am trying to make an example code that can reproduce this problem. But I didn't try to sue weston's weston_platform_create_egl_surface
, instead I use EGLCreateWindowSurface
directly.
@xeechou, any updates on this? Are you still running into the issue?
@xeechou, I'm assuming you no longer see this issue, so I'll just close it. Feel free to re-open of you think this isn't resolved yet.
Hi,
I am currently experience the issues when
eglMakeCurrent
fromEGL_NO_SURFACE
to a valid egl surface. The intension is using the same shader to differentwl_surface
. WhileEGL_KHR_Surfaceless_context
is present and I can successfully create shaders andvao
,vbo
s, I cannot see the drawing result, however, aftereglMakeCurrent
fromEGL_NO_SURFACE
to a validEGLSurface
, I see only blank framebuffer on the screen.This issue however does not present with Mesa implementation, so I think this is a bug with nvidia's implementation.
I hope there is a way to fix it.
Regards, sichem