summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.hpp
Commit message (Collapse)AuthorAgeFilesLines
...
* renderer: don't crash if cm fails to compileVaxry2025-03-141-0/+1
|
* syncobj: use eventfd instead of stalling fd checks (#9437)Tom Englund2025-03-141-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * syncobj: cleanup and use uniqueptrs cleanup a bit missing removals if resource not good, erasing from containers etc. make use of unique ptrs instead. and add default destructors. * syncobj: rework syncobj entirerly remove early buffer release that was breaking explicit sync, the buffer needs to exist until the surface commit event has been emitted and draw calls added egl sync points, move to eventfd signaling instead of stalling sync point checks, and recommit pending commits if waiting on a signal. add a CDRMSyncPointState helper class. move a few weak pointers to shared pointers so they dont destruct before we need to use them. * syncobj: queue pending states for eventfd eventfd requires us to queue pending stats until ready and then apply to current, and also when no ready state exist commit the client commit on the current existing buffer, if there is one. * syncobj: clear current buffer damage clear current buffer damage on current buffer commits. * syncobj: cleanup code and fix hyprlock remove unused code, and ensure we dont commit a empty texture causing locksession protocol and gtk4-layer-shell misbehaving. * syncobj: ensure buffers are cleaned up ensure the containers having the various buffers actually gets cleaned up from their containers, incase the CSignal isnt signaled because of expired smart pointers or just wrong order destruction because mishaps. also move the acquire/point setting to buffer attaching. instead of on precommit. * syncobj: remove unused code, optimize remove unused code and merge sync fds if fence is valid, remove manual directscanout buffer dropping that signals release point on pageflip, it can cause us to signal the release point while still keeping the current buffer and rendering it yet again causing wrong things. * syncobj: delay buffer release on non syncobj delay buffer releases on non syncobj surfaces until next commit, and check on async buffers if syncobj and drop and signal the release point on backend buffer release. * syncobj: ensure we follow protocol ensure we follow protocol by replacing acquire/release points if they arrive late and replace already existing ones. also remove unneded brackets, and dont try to manual lock/release buffers when it comes to explicit protocol. it doesnt care about buffer releases only about acquire and release points and signaling them. * syncobj: lets not complicate things set points in precommit, before checking protocol errors and we catch any pending acquire/release points arriving late. * syncobj: move SSurfaceState to types remove destructor resource destroying, let resources destroys them on their events, and move SSurfaceStates to types/SurfaceState.hpp * syncobj: actually store the merged fd have to actually store the mergedfd to use it. * syncobj: cleanup a bit around fences ensure the current asynchronous buffer is actually released on pageflip not the previous. cleanup a bit FD handling in commitPendingAndDoExplicitSync, and reuse the in fence when syncing surfaces. * syncobjs: ensure fence FD doesnt leak calling resetexplicitfence without properly ensuring the FD is closed before will leak it, store it per monitor and let it close itself with the CFileDescriptor class. * syncobj: ensure buffers are actually released buffers were never being sent released properly. * types: Defer buffer sync releaser until unlock * syncobj: store directscanout fence in monitor ensure the infence fd survives the scope of attemptdirectscanout so it doesnt close before it should have. * syncobj: check if if acquire is expired we might hit a race to finish on exit where the timeline just has destructed but the buffer waiter is still pending. and such we removeAllWaiters null dereferences. * syncobj: code style changes remove quack comment, change to m_foo and use a std::vector and weakpointer in the waiter for removal instead of a std::list. * syncobj: remove unused async buffer drop remove unused async buffer drop, only related to directscanout and is handled elsewhere. --------- Co-authored-by: Lee Bousfield <ljbousfield@gmail.com>
* renderer: add simple color management (#9506)UjinT342025-03-141-32/+34
| | | Adds proper color management and transformations for CM surfaces.
* renderer: various fixes towards improving gpu calls robustness (#9188)Tom Englund2025-02-081-2/+0
| | | | | | | | | | | | | | ensure framebuffer textures are detached and deleted, avoid leaving framebuffers bound when not needed * render: avoid calling glDeleteProgram on no program its safe to do so but it adds a bunch of unnecessery lines in apitrace when tracing. if guard it and return early. * opengl: ensure texture and buffers are unbound ensure bound buffers are unbound after use, also detach textures from framebuffer before deleting it otherwise it will become dangling and essentially leak.
* render: enforce framebuffer offloading and remove introspection toggle (#9217)nyx2025-01-311-3/+0
|
* core: begin using CFileDescriptor from hyprutils (#9122)Tom Englund2025-01-301-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * config: make fd use CFileDescriptor make use of the new hyprutils CFileDescriptor instead of manual FD handling. * hyprctl: make fd use CFileDescriptor make use of the new hyprutils CFileDescriptor instead of manual FD handling. * ikeyboard: make fd use CFileDescriptor make use of the new CFileDescriptor instead of manual FD handling, also in sendKeymap remove dead code, it already early returns if keyboard isnt valid, and dont try to close the FD that ikeyboard owns. * core: make SHMFile functions use CFileDescriptor make SHMFile misc functions use CFileDescriptor and its associated usage in dmabuf and keyboard. * core: make explicit sync use CFileDescriptor begin using CFileDescriptor in explicit sync and its timelines and eglsync usage in opengl, there is still a bit left with manual handling that requires future aquamarine change aswell. * eventmgr: make fd and sockets use CFileDescriptor make use of the hyprutils CFileDescriptor instead of manual FD and socket handling and closing. * eventloopmgr: make timerfd use CFileDescriptor make the timerfd use CFileDescriptor instead of manual fd handling * opengl: make gbm fd use CFileDescriptor make the gbm rendernode fd use CFileDescriptor instead of manual fd handling * core: make selection source/offer use CFileDescriptor make data selection source and offers use CFileDescriptor and its associated use in xwm and protocols * protocols: convert protocols fd to CFileDescriptor make most fd handling use CFileDescriptor in protocols * shm: make SHMPool use CfileDescriptor make SHMPool use CFileDescriptor instead of manual fd handling. * opengl: duplicate fd with CFileDescriptor duplicate fenceFD with CFileDescriptor duplicate instead. * xwayland: make sockets and fds use CFileDescriptor instead of manual opening/closing make sockets and fds use CFileDescriptor * keybindmgr: make sockets and fds use CFileDescriptor make sockets and fds use CFileDescriptor instead of manual handling.
* renderer/internal: stop using box pointersVaxry2025-01-261-65/+65
| | | | in favor of const refs
* protocols: add hyprland_surface_v1.set_visible_region implementation (#9120)outfoxxed2025-01-231-0/+1
|
* core: move all shared_ptrs from the STL to hyprutils (#9143)Vaxry2025-01-231-1/+1
|
* core: cleanup header includes (#9088)user1111111111111111111111111111111112025-01-171-1/+0
| | | Cleanup some unneeded includes to speed up compilation
* renderer: unload background texture if it's disabledvaxerski2025-01-141-1/+3
| | | | ref #9031
* renderer: Add supercircular window corners (#8943)Pollux2025-01-051-59/+60
| | | | | | | renderer: Add supercircular shadows and borders config: Add rounding_power to default and example configs rule: add `roundingpower` window rule
* groupbar: fix missing ellipsize for textvaxerski2025-01-041-19/+19
| | | | fixes #8938
* groupbar: unify title renderingvaxerski2025-01-021-1/+1
| | | | moves the text renderer to the unified opengl impl
* protocols: add hyprland_surface_v1 implementation (#8877)outfoxxed2025-01-011-1/+2
|
* pass: improve pass debuggingvaxerski2025-01-011-41/+42
|
* renderer: use a render pass for render modif in client rendervaxerski2025-01-011-1/+0
| | | | fixes #8918
* Renderer: rewrite render scheduling (#8683)Vaxry2024-12-221-13/+26
| | | This rewrites renderer scheduling. Occlusion is now unified in a new Pass type.
* core: Add clang-tidy (#8664)Vaxry2024-12-071-2/+2
| | | | | This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright.
* core: move colorspace handling to oklab (#8635)Vaxry2024-12-031-6/+7
| | | | | | | | | | | * Meson: add hyprgraphics * Nix: add hyprgraphics * CI/setup_base: get hyprgraphics-git --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* renderer: Add a missing texture asset and a user checkVaxry2024-11-011-6/+8
| | | | | | | | When an asset is missing, instead of a black screen, render an obnoxious, yet standard, missing texture. Additionally, warn the user assets failed to load. Shoutout to Arch for having their assets broken for months. Fix your shit. I am tired of it, and it's negatively impacting users.
* internal: cleanup CMonitor usage and fix a few ref hogsVaxry2024-10-261-18/+18
| | | | ref #8221
* internal: Move CMonitor to SP (#8178)Vaxry2024-10-191-27/+27
| | | | | * move monitors to sp * XD
* Internal: move to Mat3x3 from hyprutils (#7902)Vaxry2024-09-251-29/+29
| | | | | | | | | * Meson: require hyprutils >= 0.2.3 * flake.lock: update hyprutils --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* renderer: better lockscreen dead behavior (#7574)Vaxry2024-08-291-2/+4
| | | | | --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* renderer: Explicit sync fixes (#7151)Vaxry2024-08-061-1/+3
| | | | | Enables explicit sync by default for most platforms `misc:no_direct_scanout` -> `render:direct_scanout`
* core: add a destructor to CHyprOpenglImpl and avoid wl_container_of ↵Tom Englund2024-07-291-0/+1
| | | | | | | | | | | | | | | undefined behaviour (#7101) * protocols: avoid undefined behaviour in C macro to safely use wl_container_of with a class the class has to be no virtual functions, no inheritance, and uniform access control (e.g all public) work around this by putting this into a destroywrapper struct. * opengl: clean memory on destruction add a destructor and free the allocated memory and close the fd
* renderer: drastically optimize bg texture creationvaxerski2024-07-261-0/+3
| | | | stop loading 20MB images every time, dumbass
* egl: support getting the device via platform_deviceVaxry2024-07-241-0/+2
| | | | a neat EXT
* Core: Move to aquamarine (#6608)Vaxry2024-07-211-5/+47
| | | | | | | | | | | | | | Moves Hyprland from wlroots to aquamarine for the backend. --------- Signed-off-by: Vaxry <vaxry@vaxry.net> Co-authored-by: Mihai Fufezan <mihai@fufexan.net> Co-authored-by: Jan Beich <jbeich@FreeBSD.org> Co-authored-by: vaxerski <vaxerski@users.noreply.github.com> Co-authored-by: UjinT34 <41110182+UjinT34@users.noreply.github.com> Co-authored-by: Tom Englund <tomenglund26@gmail.com> Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com> Co-authored-by: diniamo <diniamo53@gmail.com>
* core: Move to hyprutils for MathVaxry2024-06-191-1/+1
| | | | | | Moves CRegion, CBox and Vector2D over to hyprutils. Requires hyprutils>=0.1.4
* egl: fixup format modifier lookups with implicit modifiersVaxry2024-06-141-1/+3
| | | | ref #6485
* wayland/core: move to new impl (#6268)Vaxry2024-06-081-78/+81
| | | | | * wayland/core/dmabuf: move to new impl it's the final countdown
* cursor: move to a hyprland implVaxry2024-05-091-27/+32
| | | | | | | This moves wlr_cursor to a completely new impl mostly under CPointerManager Also adds beginSimple to OpenGL for simple render passes (e.g. cursor)
* internal: new shared_ptr and weak_ptr implementation (#5883)Vaxry2024-05-051-4/+4
| | | | | | | | | | | moves std::shared_ptrs to a new implementation Advantages: - you can dereference a weak_ptr directly. This will obviously segfault on a nullptr deref if it's expired. - this is useful to avoid the .lock() hell where we are 100% sure the pointer _should_ be valid. (and if it isn't, it should throw.) - weak_ptrs are still valid while the SP is being destroyed. - reasoning: while an object (e.g. CWindow) is being destroyed, its `weak_ptr self` should be accessible (the sp is still alive, and so is CWindow), but it's not because by stl it's already expired (to prevent resurrection) - this impl solves it differently. w_p is expired, but can still be dereferenced and used. Creating `s_p`s is not possible anymore, though. - this is useful in destructors and callbacks.
* layerSurface: refactor/move to a memory-safe implVaxry2024-04-301-6/+6
| | | | | Makes all the pointers smart to avoid memory issues Refactors layerSurface code to live inside desktop/layersurface
* internal: Window storage rework - part 1 (#5762)Vaxry2024-04-271-10/+11
| | | | | | | | | | | | | | | | | * Window storage rework - part 1 * format * remove useless include * fix pch * format * fix crash in dwindle * fix vram leak * prefer .expired() for bool checks
* renderer: Fix mirrored displays when transformed and preserve aspect ratio ↵Virt2024-04-241-2/+2
| | | | | | | | | | | | | (#5697) * renderer: transform mirror buffer and preserve mirror aspect ratio * renderer: render mirrors directly from offloadFB * renderer: fix formatting * renderer: use monitorMirrorFB again, but properly damage mirrors * renderer: clean mirrors after reload and support cursor zoom mirroring
* renderer: block screen shader on screencopyVaxry2024-04-031-0/+1
|
* renderer: some fixes for renderModifVaxry2024-04-031-0/+5
|
* Workspace/core: Refactor workspace storage (#5380)Vaxry2024-04-021-1/+1
| | | | | * refactor workspaces to use ptrs * clang-format
* opengl: report shader compilation errors from screen_shader (#5138)jill2024-03-211-0/+1
| | | | | | | | | | | | | | | | | * opengl: report shader compilation errors from screen_shader * opengl: prefer .data() * opengl: move shader error logging to logError * opengl: quick glGetShaderiv -> glGetProgramiv fix * opengl: typo fix * opengl: format fixes * opengl: minor compile fixes * opengl: logError -> logShaderError
* layers: add fully featured animationsVaxry2024-02-281-1/+1
| | | | | | | | Adds configs and layerrules to handle them alas fixes #981 I have cooked
* renderer: nuke lastFrameDamage and rework finalDamageVaxry2024-02-231-1/+4
| | | | this fucking SUCKED
* renderer: Add new background infrastructureVaxry2024-01-291-4/+2
| | | | | | | | Adds new backgrounds from the winners of the contest Rewrites how it works Allows high color precision PNGs (RGB32F precisely) Fixes a small bug in renderTextureInternalWithDamage Nukes misc:force_hypr_chan
* opengl: add renderdata.forceIntrospectionvaxerski2024-01-071-0/+1
|
* renderer: overhaul renderModifDatavaxerski2024-01-071-2/+11
|
* style/ci: apply clang-format and verify it in ci (#4039)François Conzelmann2023-12-061-2/+1
| | | | | * style: apply clang-format * ci: add new clang-format job to CI
* renderer: use xray for background blur on small() surfacesVaxry2023-12-061-3/+2
| | | | ref #4050
* screencopy: use buffer format for glReadPixelsVaxry2023-12-041-43/+52
| | | | fixes #4029