On 7/22/11 4:18 PM, Robert Osfield wrote:
Hi Hartmut,

On Fri, Jul 22, 2011 at 2:30 PM, Hartmut Seichter
<[email protected]>  wrote:
Firstly, I figured that the calls to eglCreateContext and eglCreateSurface
were swapped. It shouldn't make a difference but I think most examples are
in that order. Beside that, a final eglMakeCurrent with context and surface
was missing to connect them.
An eglMakeCurrent should just be required before rendering, and should
be called by osgViewer
when required.  This is at least how GLX and the other OpenGL
windowing system integration work.
In general I think there quite some subtle differences between WGL, GLX, CGL and EGL. Because EGL tries to be everybody darling things are a bit long-winded and especially real embedded hardware can be fiddly. Also, EGL does allow OpenVG contexts or shared contexts between GLES and VG, and in that case you need a bound surface+context to create another (OpenVG) context that you can add.

Regarding the EGL_<COLOR>_SIZE items. This might be a driver issue, but I
have enough devices here to see similar behavior with them - actually
leaving things at 0 (default) is probably the best way to handle that.
What
happens is that eglChooseConfig creates some random config just to satisfy
some items in your attributes and a subsequent eglCreateWindowSurface fails
then with a "Bad Config" error.

EGL_DEPTH_SIZE seemingly works with value of 1.

My tests are on a N900 and a few other devices.
I really don't feel comfortable with just leaving the RGBA all to
defaults, and explictly setting a value 0 certainly doesn't sound like
default.  It seems wrong to me.  Could you please documentation that
this is appropriate for EGL that lead down the path you have taken?
Please read the EGL documentation at Khronos, default is 0 or if you don't want to set it its EGL_DONT_CARE like I had in my earlier patch - http://www.khronos.org/files/egl-1-4-quick-reference-card.pdf
The original code passes on the Traits::red, green, blue and alpha
values when creating a GLX context.   The present code in svn/trunk
doesn't do this for EGL but does it correctly for GLX, so I would have
though we should be passing on these values rather than just leave the
values of 1.
I have tested and I am 100% sure that on the devices here setting it to 1 will not work for ES1 nor for ES2. We can argue that it should actually find a correct one (and in the meantime point fingers at GLES driver implementers) but you are probably better off with the EGL default (0) or declaring it as EGL_DONT_CARE (-1) which usually finds a matching visual. I had a quick try with traits-><color> and didn't got it working. I think the traits relaxation kicked in for X11 and subsequently the values in the traits are not the actual ones of the visual. I will have another try later.


Cheers,
Hartmut



Robert.








I added an extra small tweak to switch of composting on hildon based
devices. It should not effect other X11 implementations.

Cheers,
Hartmut

On 7/22/11 10:54 AM, Robert Osfield wrote:
Hi Harmut,

Could you answer the questions I posed in my previous email, I can't
merge any changes from you till I've got to the bottom of the
problems.

I'm curious as to why this wasn't a problem in my own testing, I
presume it's a driver specific issue.

- the defaults for EGL_<COLOR>_SIZE is 0 and can be set safely to
EGL_DONT_CARE
But we do care what the colour and depth buffer settings are...  which
is why I set them to a minimum of 1.  I don't understand why setting
them to EGL_DONT_CARE would be a good thing, we want to make sure that
the context created can do a RGB + depth buffer.

I don't understand the motivation or need for this change.

Could you explain?

Thanks,
Robert.

_______________________________________________
osg-submissions mailing list
[email protected]

http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

--
Hartmut Seichter, PhD (HKU), Dipl.-Ing. (BUW)


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org


_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org


--
Hartmut Seichter, PhD (HKU), Dipl.-Ing. (BUW)

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to