Giter Site home page Giter Site logo

Comments (6)

Drakulix avatar Drakulix commented on September 22, 2024 1

I propose an API change, that makes it possible to query supported capabilities and to initialize the GlesRenderer with a set of requested capabilities (which fails if the requested ones aren't available).
If you are not using color transformations and you are never dealing with anything else, but 8-bit buffers, or your hardware is simply too slow, you can just drop the capability. But especially the types of buffers the compositor advertises or "too slow" implementations of set apis are nothing the renderer can figure out itself, so a user-driven approach seems to make sense here.

from smithay.

chrisduerr avatar chrisduerr commented on September 22, 2024

I've been able to confirm that this line causes the performance issues:

capabilities.push(Capability::ColorTransformations);

from smithay.

chrisduerr avatar chrisduerr commented on September 22, 2024

That would work fine for me. I don't care manual configuration of this.

from smithay.

chrisduerr avatar chrisduerr commented on September 22, 2024

@Drakulix I was hoping you'd have some time to implement this, but if this is not the case could you go into some more detail of what you'd expect the changes to look like so I can fix these performance issues?

from smithay.

Drakulix avatar Drakulix commented on September 22, 2024

@Drakulix I was hoping you'd have some time to implement this, but if this is not the case could you go into some more detail of what you'd expect the changes to look like so I can fix these performance issues?

Sure thing, so the main thing to do here is splitting up GlesRenderer::new into two functions.

The current function is evaluating the feature-set to be used in this part of the code: https://github.com/Smithay/smithay/blob/master/src/backend/renderer/gles/mod.rs#L515-L603.

A new function (evaluate_capabilities? possibly a method of the Capability-type) would do essentially this and just return the capabilities array.

The new function would take a new capabilities-argument and compare the requested capabilities with the ones available. (So initializing the renderer in anvil would now evaluate the capabilities twice, but I don't think that is a huge issue. If one would want to avoid that, the new argument could be an Option, where None essentially means the previous behaviour of enabling everything possible.)

If the requested capabilities are not available, this has to throw a new error. Compositors like catacomb could then either hard-code as set of capabilities or dynamically drop the ColorTransformation-cap from the listed set for better performance.

This has a few remarks for the remaining renderers, that can wrap the GlesRenderer:

  • The GlowRenderer needs to pass-through the capability arguments.
  • The MultiRenderers EglGlesBackend and GbmGlesBackend platforms initialize GlesRenderers internally. They would probably need to take closure on construction and store that boxed, that returns a set of capabilities for maximum flexibility. Failing to request a given set of capabilities should likely not bring the whole MultiRenderer down, but simply log a warning and skip over the failed device in the platforms enumerate functions.

from smithay.

cmeissl avatar cmeissl commented on September 22, 2024

fixed by #1055

from smithay.

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.