summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* opengl: detect android fence support and disable explicit if it's missing ↵Vaxry2025-07-191-1/+16
| | | | | (#11077) Checks for explicit sync support via the android fences, and falls back to implicit sync if it isn't
* renderpass: use unique ptr instead of shared ptrTom Englund2025-07-101-4/+4
| | | | | lets use unique ptrs instead of refcounting shared ptr when its not needed, use rvalue reference to construct in vector directly.
* renderer: Added a pointer position uniform to the screen shader. (#10821)FrancisTheCat2025-07-081-3/+19
|
* opengl: avoid reallocations in EGLImage (#10960)Tom Englund2025-07-071-21/+24
| | | | | use a std::array instead of vector and avoid reallocations. it should at most be 49 entries, so make the array 50. and RASSERT check it incase more entries gets added in the future.
* pass: overload TexPass constructorTom Englund2025-07-071-2/+2
| | | | | overload it with a rvalue to allow us to move the data directly avoiding an extra copy. because SRenderData is not trivially copyable.
* opengl: add missing skipcm if case (#10888)Tom Englund2025-07-011-0/+6
| | | | | missing skipcm if case so the CM uniforms where never added on the gradient2 renderBorder case, until the non gradient2 one had run atleast once. causing it to not render on first launch/delayed.
* renderer: reduce a lot of glcalls and cache various states (#10757)Tom Englund2025-06-251-378/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * opengl: cache viewport state according to nvidia docs calling glViewPort unnecessarily on the same already set viewport is wasteful and can cause state changes when not needed. cache it in a struct and only call it when the viewport is actually changing. * opengl: cache glenable/gldisable state avoid making multiple glenable/gldisable calls on already set caps, can cause state changes and incur driver overhead. * opengl: cache glscissor box only call glscissor if the box actually has changed, try to avoid state changes. * opengl: cache gluniform calls cache the gluniform calls, the uniform values are cached in driver per program only the drawcalls setting the uniform yet again with the same value on same location is causing more overhead then caching it ourself and just no oping on it if no changes. * shader: rewrite handling of uniforms and state this is way faster as we don't need to mess with maps (hashing, etc) and instead can just use an array * opengl: stuff and 300 shaders * opengl: typo * opengl: get the uniform locations properly now that the legacy shaders are gone get the uniformlocations for SKIP_CM etc, so they can be properly set and used depending on if cm_enabled is set to false or true, before it was falling back to a legacy shader that didnt even have those uniforms. * opengl: check epsilon on float and remove extra glcall seems an extra unset glcall was added, remove it. and check the float epsilon on the glfloat. * opengl: remove instanced shader draw remove the instanced boolean from the vertex shader, might be neglible differences, needs more benchmark/work to see if its even worth it. * texture: cache texture paramaters parameters where occasionally set twice or more on same texture, short version wrap it and cache it. and move gpu churn to cpu churn. add a bind/unbind to texture aswell. * texture: use fast std::array caching cache the texparameter values in fast array lookups and incase we dont want it cached, apply it anyways. * shader: fix typo and hdr typo actually use Matrix4x2fv in the 4x2fv cache function, and send the proper float array for hdr. * texture: make caching not linear lookup make caching of texture params not linear. * minor style changes * opengl: revert drawarrays revert the mostly code style reduce loc change of drawarrays, and focus on the caching. its a if else case going wrong here breaking blur/contrast amongst others drawing. --------- Co-authored-by: Vaxry <vaxry@vaxry.net>
* renderer: add wrapping options to renderTextureWithBlur method (#10807)zacoons2025-06-211-5/+6
|
* renderer: make lock fail textures dynamically loadedVaxry2025-06-191-8/+26
| | | | this should reduce idle vram usage by a whopping 16MB, but also might fix the tty unknown issue.
* config/monitor: Add monitor v2 HDR rules (#10623)UjinT342025-06-151-4/+4
|
* opengl: use a stack for storing monitor transform enabledVaxry2025-06-151-18/+31
| | | | fixes #10487
* internal: Fix HyprError not displaying at startup (#10606)Kamikadze2025-06-011-1/+0
|
* internal: refactor to use empty() (#10599)Kamikadze2025-05-311-6/+6
|
* refactor: use std::ranges whenever possible (#10584)Kamikadze2025-05-301-4/+4
|
* renderer: add wrapping options to renderTexture method (#10497)zacoons2025-05-211-5/+6
|
* core: drop the legacy renderer (#10408)Tom Englund2025-05-151-101/+6
| | | | | | | | | | | * core: drop the legacy renderer the legacy renderer is broken and barely used, drop it. * Nix: drop support for legacyRenderer --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* opengl: add missing vao for screenshader (#10397)Tom Englund2025-05-131-0/+1
| | | | missed creating vertex array objects in 04124988e8b4a9cdfc5995388ebfaad0005b4b31 add it.
* opengl: optimize shaders and reduce unneeded drawcalls (#10364)Tom Englund2025-05-111-93/+66
| | | | | | | | | | | | | | | | | | | | | | | * opengl: remove unnecessery glflush calls glflushing forces the driver to break batching and issue commands prematurely and prevents optimisations like command reordering and merging. many glFunctions already internally glflushes and eglsync creation still has a glflush at end render. so lets reduce the overhead of these calls. * opengl: reduce glUseProgram calls apitrace shows cases where the same program gets called multiple times, add a helper function that keeps track of current program and only call it once on same program. reduces slight overhead. * opengl: use more efficient vertex array object use a more modern vertex array object approach with the shaders, makes it a onetime setup on shader creation instead of once per drawcall, also should make the driver not have to revalidate the vertex format on each call.
* renderer: render blur on fade out (#10356)Vaxry2025-05-101-5/+7
|
* renderer: always render snapshots as 8bitvaxerski2025-05-091-4/+6
| | | | fixes issues with transparent windows on 10b
* opengl: fix legacyrendererVaxry2025-05-081-2/+2
|
* refactor: cshader class to sshader struct (#10324)davc0n2025-05-081-8/+8
|
* render: refactor class member vars (#10292)davc0n2025-05-051-501/+501
| | | | | * render: refactor class member vars * render: fix clang format
* protocols: refactor class member vars (core) (#10259)davc0n2025-05-031-9/+9
|
* helpers: refactor class member vars (#10218)davc0n2025-04-301-117/+120
|
* render: properly release rendered buffers (#9807)Ikalco2025-04-301-44/+35
| | | | | | | | | * cleanup eglSync * properly release buffers in renderer * add renderingDoneCallback and use it in screencopy * use static constructor for CEGLSync
* cm: Use precomputed primaries conversion (#9814)UjinT342025-04-291-8/+23
|
* windows: refactor class member vars (#10168)davc0n2025-04-281-14/+14
|
* workspaces: refactor class member vars (#10167)davc0n2025-04-251-4/+4
|
* layers: refactor class member vars (#10149)davc0n2025-04-241-3/+3
| | | | | * layers: refactor class member vars * popups: rename m_WLSurface to m_wlSurface
* groupbar: Add options for setting group bar title font weight (and indicator ↵M Matthew Hydock2025-04-241-3/+3
| | | | gap) (#9617)
* compositor: refactor class member vars (#10141)davc0n2025-04-221-9/+8
|
* config: Refactor class member vars (#10124)davc0n2025-04-201-10/+10
| | | | | * Refactor config classes vars * Fix clang format errors
* render, helpers: Call OpenGL destroyMonitorResources on disconnect (#10111)Lee Bousfield2025-04-181-2/+3
| | | | | * render, helpers: Call OpenGL destroyMonitorResources on disconnect * helpers: Add opengl null check
* windowrules: allow incrementing window props (#9566)MightyPlaza2025-04-161-0/+1
|
* pass: revert "remove renderer finalDamage since it's unused (#9996)" (#10039)Vaxry2025-04-111-3/+7
| | | This reverts commit 0a7e2cb152a11db35aa134fad0919bc939f16bae.
* pass: remove renderer finalDamage since it's unused (#9996)Ikalco2025-04-091-7/+3
|
* Permission Manager: add permission management for screencopy (#9930)Vaxry2025-04-081-0/+2
|
* opengl: check for g_pHyprOpengl pointer (#9791)Tom Englund2025-03-291-1/+1
| | | | restore the pointer check to avoid null ptr dereference on compositor destruction.
* renderer/opengl: Extract shaders from source (#9600)UjinT342025-03-291-366/+520
| | | | | --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* internal: fix minor ubsan errors (#9743)Tom Englund2025-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | * opengl: check if g_pHyprOpengl exist on compositor destruction we can hit a race where a CEGLSync destructs and tries to call eglDestroySyncKHR on a null g_pHyprOpengl. /src/render/OpenGL.cpp:3019:32: runtime error: member access within null pointer of type 'struct CHyprOpenGLImpl' #0 0x555565eed979 in CEGLSync::~CEGLSync() /src/render/OpenGL.cpp:3019 #1 0x555565f6271e in std::default_delete<CEGLSync>::operator()(CEGLSync*) const /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/unique_ptr.h:93 * xdgshell: dont apply state on empty states setsize can be called before a state has been added to pending, resulting in calling ApplyState with a empty state. /src/protocols/XDGShell.cpp:323:11: runtime error: null pointer passed as argument 2, which is declared to never be null #0 0x5555659bf67e in CXDGToplevelResource::applyState() /src/protocols/XDGShell.cpp:323 #1 0x5555659bcedc in CXDGToplevelResource::setSize(Hyprutils::Math::Vector2D const&) /src/protocols/XDGShell.cpp: 256 #2 0x555563eed0ef in Events::listener_commitWindow(void*, void*) /src/events/Windows.cpp:841
* opengl: don't attempt to compile cm on gles3.0Vaxry2025-03-261-44/+49
| | | | | | also disable the error for the cm shader fixes #9738
* renderer: Simplify and fix hdr metadata setting (#9706)UjinT342025-03-241-3/+3
| | | | | * simplify and fix hdr metadata setting * keep incorrect(?) cm skip till #9600
* renderer: fix cm_fs_passthrough (#9698)UjinT342025-03-221-7/+9
|
* renderer: add an option to disable cm and auto-skip cm if not necessaryvaxerski2025-03-181-5/+10
| | | | | | fixes #9641 adds render:cm_enabled default true
* opengl: simplify cm pipelineVaxry2025-03-161-60/+53
| | | | | | fixes a few mistakes, and skips the CM shader in cpu instead of adding a costly branch ref #9641
* renderer: don't crash if cm fails to compileVaxry2025-03-141-45/+50
|
* syncobj: use eventfd instead of stalling fd checks (#9437)Tom Englund2025-03-141-47/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-3/+95
| | | Adds proper color management and transformations for CM surfaces.
* hyprctl/config: fixup config descriptions, fill out missing ones, provide ↵Vaxry2025-02-251-9/+1
| | | | | | more data adds current and explicit, better parsing, and fixes missing / invalid ones