Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to opengl core profile #2467

Closed
totaam opened this issue Oct 31, 2019 · 15 comments
Closed

move to opengl core profile #2467

totaam opened this issue Oct 31, 2019 · 15 comments
Labels
client help wanted Extra attention is needed
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Oct 31, 2019

More "modern" opengl.

Means using VBO for vertices, glVertexPointer etc
This may help with #2466, see also #3064

Links:

@totaam totaam added v3.0.x client help wanted Extra attention is needed and removed v3.0.x labels Jan 22, 2021
@totaam totaam added this to the 5.0 milestone Jan 23, 2021
@totaam
Copy link
Collaborator Author

totaam commented Apr 5, 2023

Some links that might be useful:
https://github.com/vanrez-nez/awesome-glsl
https://github.com/eug/awesome-opengl

We may want to tackle webgl around the same time:
Xpra-org/xpra-html5#238
And perhaps look into vulkan too: #3064

@totaam
Copy link
Collaborator Author

totaam commented Oct 20, 2023

92f0e86 was meant to help but triggered a NullFunctionError on glXCreateContextAttribsARB.

Perhaps the quads can be replaced with glBlitNamedFramebuffer: guide to modern opengl: glBlitNamedFramebuffer

totaam added a commit that referenced this issue Oct 22, 2023
painting rgb from a core context works now
@totaam
Copy link
Collaborator Author

totaam commented Oct 22, 2023

Much progress thanks to A guide to using modern OpenGL functions : glBlitFramebuffer, as of 8b73c2b, we can paint rgb from a core context:

XPRA_OPENGL_CORE_PROFILE=1 xpra attach --encodings=rgb

Still TODO:

  • the fake pointer in draw_pointer will need to load an rgb image into the cursor texture
  • blend_texture (used by fps counter and pointer) will need to use a texture
  • draw_border and paint_box: use a texture since lines don't exist any more, then blit it 4 times?
  • paint_nvjpeg: pbo to fbo should be easy?
  • video: render_planar_update uses shaders, so use a vertex array?
  • pyopengl's detection of wayland isn't good enough: Attempt to auto-detect wayland vs. x11 (egl vs. glx) on linux mcfletch/pyopengl#41 (comment) so we have to set PYOPENGL_PLATFORM=egl if we are certain we want wayland (instead of going through xwayland - which may or may not work)

totaam added a commit that referenced this issue Oct 25, 2023
so it can stop processing of the event, or let it continue
totaam added a commit that referenced this issue Oct 25, 2023
@totaam
Copy link
Collaborator Author

totaam commented Oct 25, 2023

As of 345a1cc, the experimental gtk opengl backend can be enabled with:

xpra attach --opengl=gtk

TODO:

totaam added a commit that referenced this issue Oct 26, 2023
totaam added a commit that referenced this issue Oct 27, 2023
totaam added a commit that referenced this issue Oct 27, 2023
totaam added a commit that referenced this issue Oct 27, 2023
until it is fixed, don't use it on Wayland
totaam added a commit that referenced this issue Oct 27, 2023
totaam added a commit that referenced this issue Oct 27, 2023
which returns full details info
totaam added a commit that referenced this issue Nov 3, 2023
 the callers to 'do_present_fbo' must set the rendering target
@totaam
Copy link
Collaborator Author

totaam commented Nov 3, 2023

New items:

  • colorspace issues: some decoders do / don't need "narrow range" bt.601?
  • compile the shaders just once
    • SVGA3D: can't call glDeleteProgram or glDeleteShader or glDeleteVertexArray!
  • SVGA3D has transparency issues - otherwise works? (move to grey list?)
  • upload cursor and border textures only when they change
  • vao: can keep just one, load it up early
  • fps not showing under wayland
  • play with Gtk.GLArea.set_auto_render

totaam added a commit that referenced this issue Nov 5, 2023
totaam added a commit that referenced this issue Nov 5, 2023
also fix lots of linter warnings
totaam added a commit that referenced this issue Nov 5, 2023
also fix call to glDeleteBuffers when cleaning up
totaam added a commit that referenced this issue Nov 9, 2023
totaam added a commit that referenced this issue Nov 9, 2023
so no need to use 'auto-render'
@totaam
Copy link
Collaborator Author

totaam commented Nov 14, 2023

Telling MacOS that we want a core profile is obviously non-trivial..

MS Windows looks easier:

totaam added a commit that referenced this issue Dec 24, 2023
totaam added a commit that referenced this issue Apr 4, 2024
* revert 28eaf57: a warning is better than a crash
* add option to require accelerated GL: 'XPRA_OPENGL_ACCELERATED=1' (defaults to 0)
* no need to specify 'NSOpenGLPFAWindow' (it is the default)
* only add 'NSOpenGLPFAAlphaSize' if we do need alpha,
* move scale factor to the window context, since that's where it will be queried,
* prefer 'native' to 'glarea' backend on MacOS
@totaam
Copy link
Collaborator Author

totaam commented Apr 4, 2024

At last, c372a0a fixes MacOS the 'native' OpenGL backend.
(the GTK one is still buggy - doesn't seem to render at all..)
I'm not sure if the scaling problems are fixed, but this is tracked here: #4167

@totaam totaam closed this as completed Apr 4, 2024
totaam added a commit that referenced this issue Apr 5, 2024
totaam added a commit that referenced this issue Apr 30, 2024
it's ugly, but at least it doesn't break the rendering like glBegin / glEnd
@totaam
Copy link
Collaborator Author

totaam commented Jul 10, 2024

See also #4167 and scaling: 854f012 and 121df4c

@totaam
Copy link
Collaborator Author

totaam commented Aug 13, 2024

It looks like using blit causes problems with scaling: #4324 (comment)

@totaam
Copy link
Collaborator Author

totaam commented Aug 13, 2024

Important fixes related to FBOs and scaling: 32d9008, 617aa2e, 342dfa0 - for #4201 and #4324

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant