GithubHelp home page GithubHelp logo

Comments (13)

alexhuntley avatar alexhuntley commented on August 23, 2024

I've added some debug information, please could you check what the latest version (0.8.3) prints when run in a terminal?

from plots.

Newbytee avatar Newbytee commented on August 23, 2024

This is what I'm getting:

$ flatpak run app/com.github.alexhuntley.Plots/x86_64/master
OpenGL version: 3.2

from plots.

alexhuntley avatar alexhuntley commented on August 23, 2024

Looks like you aren't using OpenGL ES then.

So either I could lower the minimum version for the warning (assuming the app still works for you?), or remove it completely. I imagine on GTK 4 it's safe to assume we have a relatively modern OpenGL.

from plots.

Newbytee avatar Newbytee commented on August 23, 2024

So either I could lower the minimum version for the warning (assuming the app still works for you?)

It still works as far as I can tell

or remove it completely. I imagine on GTK 4 it's safe to assume we have a relatively modern OpenGL.

Not necessarily. GTK 4 supports OpenGL ES 2.0 as its minimum. Not sure about "desktop" OpenGL.

from plots.

Newbytee avatar Newbytee commented on August 23, 2024

It seems like OpenGL 3.0 is the lowest "legacy" OpenGL version GTK 4 tries to pick (not sure what legacy means), OpenGL 3.2 is the lowest OpenGL version it tries to pick, and OpenGL ES 2.0 is the lowest OpenGL ES version: https://gitlab.gnome.org/GNOME/gtk/-/blob/cefb0a3eb8f9a52283ce4368ccc78425db0914b0/gdk/gdkglcontextprivate.h#L36-50

from plots.

Newbytee avatar Newbytee commented on August 23, 2024

Okay, so I tried building GTK with this stupid patch applied: 4.6-required-opengl.patch.txt

And after applying this, lo and behold:

$ flatpak run app/com.github.alexhuntley.Plots/x86_64/master
OpenGL version: 4.6

As well as no warning in Plots:

image

So I guess GTK just picks the lowest supported non-legacy version on my system. I really wonder why it wouldn't do this on other systems.

from plots.

alexhuntley avatar alexhuntley commented on August 23, 2024

Very interesting. Presumably it's due to some quirk in the NVIDIA driver.

So I need to look into whether Plots really needs 3.3, or whether a lower version would be acceptable.

We could also try using GLArea.set_required_version to request a more recent context. What happens if you add a call to it in GraphArea.__init__ in graph.py? (with the unpatched GTK)

from plots.

Newbytee avatar Newbytee commented on August 23, 2024

Does this look like what you had in mind:

diff --git a/plots/graph.py b/plots/graph.py
index 9605bdb..2243584 100644
--- a/plots/graph.py
+++ b/plots/graph.py
@@ -35,6 +35,7 @@ class GraphArea(Gtk.GLArea):
 
     def __init__(self):
         super().__init__()
+        self.set_required_version(3, 3)
         self.scale = self._target_scale = self.INIT_SCALE
         self._translation = np.array([0, 0], 'f')
         self.vertex_template = jinja_env.get_template('vertex.glsl')

It does not seem to help unfortunately:

$ python3 -m plots
OpenGL version: 3.2

from plots.

alexhuntley avatar alexhuntley commented on August 23, 2024

That's surprising. What if you request 4.6?

from plots.

Newbytee avatar Newbytee commented on August 23, 2024

That's surprising. What if you request 4.6?

Same result. Could it be that it has no affect since the Area already is realised when this is called?

from plots.

alexhuntley avatar alexhuntley commented on August 23, 2024

It's possible. Try printing self.get_realized()?

from plots.

Newbytee avatar Newbytee commented on August 23, 2024
diff --git a/plots/graph.py b/plots/graph.py
index 9605bdb..ec0d499 100644
--- a/plots/graph.py
+++ b/plots/graph.py
@@ -35,6 +35,8 @@ class GraphArea(Gtk.GLArea):
 
     def __init__(self):
         super().__init__()
+        self.set_required_version(4, 6)
+        print(self.get_realized())
         self.scale = self._target_scale = self.INIT_SCALE
         self._translation = np.array([0, 0], 'f')
         self.vertex_template = jinja_env.get_template('vertex.glsl')
$ python3 -m plots
False
OpenGL version: 3.2

So I guess it isn't realised when this happens. Wonder what it could be then.

from plots.

 avatar commented on August 23, 2024

I'm getting this issue myself on ubuntu (22.10) using the flatpak install.
image
Anyone know the fix?
OpenGL version string: 4.6.0 NVIDIA 530.41.03
this an nwidia probwem?

from plots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.