Skip to content
This repository

Allow running Regal+ES2 with Desktop GLSL #56

Closed
igor-c opened this Issue · 7 comments

2 participants

Igor Chernyshev Nigel Stewart
Igor Chernyshev

This is a very useful debugging tool, which we use to narrow down the problem space. By switching between App+GLX, App+Regal+GLX and App+Regal+PepperGL we can find out the area that's broken - the app, Regal or PepperGL.

We re-used REGAL_FORCE_ES2_PROFILE to simulate ES2 calls on Desktop GL. However, I'm not sure that's the best option. Could you take a look and advise:

igor-c@f1cf280

Nigel Stewart
Collaborator

On the Mac we have some logic to force a core profile, perhaps the ideal thing here is for REGAL_FORCE_ES2_PROFILE on Linux to do a similar thing at context-creation time.

Another possibility is using the Mesa software ES2 implementation on Linux, rather than
libGL.so.1

  • Nigel
Igor Chernyshev

It would be great to figure this out in the context info, but I don't see enough variables for that.

For SL version to switch to 140, iff->gles should become false. Once "gles" is false, we get many other differences in the resulting shader program, which is undesirable for our case. As version 100 on ES closely matches version 140 on Desktop - we did not want to change the program text... we just needed to adjust the version number to match the Desktop reality and leave the rest of the shader program as is. Having said, the re-use of REGAL_FORCE_ES2_PROFILE may be quite suboptimal.

Using Mesa seems to defeat the purpose of the change for us. The purpose of this change is to help debugging Regal by switching the app easily between Pepper and GLX. Adding yet another GL layer (Mesa) instead of using direct access to GLX (which, aside from shader version works fine), would mean we may have to deal with a new source of potential issues.

Nigel Stewart
Collaborator

REGAL_FORCE_ES2_PROFILE is behaving as intended, and it's generally true that ES 2.0 mode will work on a desktop driver, even for a desktop context. (Aside from GLX_EXT_create_context_es2_profile) But clearly from this use-case, GLSL ES 2.0 isn't going to work.

I'd suggest using an actual ES 2.0 context (via GLX_EXT_create_context_es2_profile) if available, as an alternative. That way Regal wouln't need to be forced into ES 2.0 mode.

  • Nigel
Nigel Stewart
Collaborator

From the point of view of merging the change, how about if we #ifdef if with REGAL_FORCE_DESKTOP_GLSL, rather than REGAL_FORCE_ES2_PROFILE?

  • Nigel
Igor Chernyshev

Thanks for the suggestion! I've sent a pull request with the updated patch.

Nigel Stewart
Collaborator

Closing this issue, glad we got it sorted.

  • Nigel
Igor Chernyshev

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.