[virglrenderer-devel] Cap bits for OpenGL ES hosts
Jakob Bornecrantz
jakob.bornecrantz at collabora.com
Fri Dec 22 16:04:17 UTC 2017
On 2017-12-20 22:34, Dave Airlie wrote:
> On 20 December 2017 at 21:20, Jakob Bornecrantz
> <jakob.bornecrantz at collabora.com> wrote:
>> Hello Dave et al,
>>
>> We are working on using OpenGL ES as a host driver. The current status is
>> that we can run a gnome-shell session[1] (Ubuntu 17.10) just fine and run
>> the piglit gpu testsuit with 501 fails[2]. But as we are bringing up this we
>> are running into some cases where GLES is less feature-full then Desktop GL.
>> So the guest driver is assuming that certain functionality is always
>> available or the cap bits are not fine grained enough. For instance, GLES
>> does not support timestamp but the guest driver will unconditionally enable
>> GL_ARB_timer_query (because PIPE_CAP_QUERY_TIMESTAMP is hardcoded to 1). Or
>> that occlusion query implies accurate number of pixels rendered.
>>
>> Other missing functionality include: 1D Textures; Texture Rectangle; and
>> reading back texture data. This list is not exhaustive. For some like 1D
>> Texture support we can work around it fairly easy in the host. Texture
>> rectangle is harder, while timestamp query and accurate occlusion query is
>> impossible.
>
> I think at least 1D texture should be worked around. Reading back texture
> data is going to be a bit of a mess, at you can't always generate an FBO
> and read from it, (like for compressed textures and wierd formats).
Yeah 1D textures are simple enough (knock on wood).
The only option here is to just keep a copy around for non-renderable
textures (we can't stuff them into a FBO). I guess we could add a
NO_READBACK/BLACKHOLE usage bit for GLES guest drivers to tell the host
that it doesn't need to keep a copy around.
>
> I'm happy to add more caps for timer query and occulsion query
> There is actually an occulsion query cap already, we just always set it to 1
> and I'm not sure anyone uses it.
The guest actually uses it, it stops advertising OpenGL 2.1 if it's not
set, causing Wayland to switch to llvmpipe.
>
>>
>> So I'm suggesting as a way forward that we add one or more cap bits that
>> says the host is GLES. For desktop GL we only expose OpenGL 2.1 and turn a
>> blind eye to the missing features, like the i915g driver does. Since this is
>> what old guests will do anyways. And for GLES we can expose 3.0 and above.
>>
>> Thoughts and comments please?
>
> Sounds like a good plan. I'm not sure we want a catch all is GLES bit,
> rather than a per-feature bit, I suppose aligning as much as we can with
> gallium caps is probably the most sustainable.
Awesome, I'll sit down and look at what caps we might want.
Ok, I guess per feature cap is better. How should we do with caps that
we add for features already assumed there? Say for instance timestamp, a
new guest running on a old host will get 0 for that bit if it is
HAS_TIMESTAMP. We could negate it DONT_HAVE_TIMESTAMP, but that might be
confusing.
Cheers, Jakob.
More information about the virglrenderer-devel
mailing list