summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
Commit message (Collapse)AuthorAgeFilesLines
* windowrules: rewrite completely (#12269)Vaxry2025-11-171-8/+8
| | | | | | | Reworks the window rule syntax completely --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* i18n: init localization for ANR, Permissions and Notifications (#12316)Vaxry2025-11-161-1/+2
| | | | | | | | Adds localization support for en, it, pl and jp --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net> Co-authored-by: Aaron Blasko <blaskoazzolaaaron@gmail.com>
* cm: follow preferred srgb eotf for screencopy (#12230)Dominick DiMaggio2025-11-071-1/+3
|
* renderer/cm: allow gamma 2.2 instead of sRGB EOTF (#12094)Dominick DiMaggio2025-10-291-2/+12
|
* EGL: minor egl changes (#12132)Tom Englund2025-10-251-5/+5
| | | | | | | | | | | * opengl: use EGLint and we dont have to cast data use EGLint in the attrib array and we dont have to cast the resulting data. * opengl: add linear to correct vector drop empty check, what if we get mods that isnt linear. then it wont be added, also add it to the result vector that we actually return.
* screencopy: fix missing XBGR2101010 format with screencopy_force_8b (#12125)ccos892025-10-251-1/+1
| | | | | | | | | Adds missing DRM_FORMAT_XBGR2101010 to screencopy_force_8b that leads to "no more input formats" Pipewire error for monitors set to 10-bit color depth/where currentFormat is XBGR2101010. Fixes implementation of #11623 Fixes hyprwm/xdg-desktop-portal-hyprland#270 Fixes hyprwm/xdg-desktop-portal-hyprland#102
* renderer: add more uniforms to the screen shader (#11986)Mozzarella322025-10-201-19/+135
| | | | | | | | | | | | These are: pointer_shape from the cursor-shape-v1 protocol prepared for v2, along with left_ptr...bottom_right_corner and killing (Hyprland specific) pointer_shape_previous with pointer_switch_time to blend between shapes pointer_size scaled size as used by the normal cursor pointer_pressed_positions[32] with pointer_pressed_times[32] and pointer_pressed_killed(32 bits) for click/touch animations and if they killed something pointer_inactive_timeout with pointer_last_active to smoothly fade the pointer out pointer_hidden to hide it when the cursor is hidden (excluding by cursor:invisible as this config value can be used to turn off the normal cursor, which is useful when drawing it with the screen shader)
* renderer: add cursor:zoom_disable_aa for controlling AA on zoom (#12025)Vaxry2025-10-151-2/+3
|
* renderer: optimize border drawcalls (#11891)Vaxry2025-10-011-22/+18
| | | calculates the specific border region to avoid sampling on regions where the border cannot be at
* internal: fix clang-tidy "errors" (#11862)UjinT342025-09-291-4/+4
|
* opengl: move from unordered_set to arrayTom Englund2025-09-281-8/+26
| | | | | | | setCapStatus is a a heavy used function in hot rendering paths, it shows up in profiling as using a bit of cpu just because of unordered_set hashing etc, move to a enum and array and cache only the heavily used ones.
* renderer: disable anti-aliasing on cursor:zoom_factor (#6135) (#11828)João V. Farias2025-09-251-0/+10
| | | use nearest-neighbor filtering for cursor scaling to avoid blurriness
* renderer: asynchronously load background tex (#11749)Vaxry2025-09-181-32/+92
| | | | | | | Bumps required hyprgraphics to 0.1.6 --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* core: fix clang-formatVaxry2025-09-171-1/+1
|
* renderer: clamp blur:passes 1-8Vaxry2025-09-151-4/+6
| | | | | | fixes some UB and dumb things ref #11707
* render/OpenGL: fix compilation for 32bit systems (#11667)Florian "sp1rit2025-09-111-1/+1
|
* screencopy: add force 8 bit to fix 10b screensharing (#11623)Vaxry2025-09-081-1/+11
| | | ref https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/270
* renderer: Fix CM for DS and SDR passthrough (#11503)UjinT342025-08-291-8/+8
|
* syncobj: use rendernode for timelines (#11087)Tom Englund2025-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * syncobj: use rendernode for timelines use rendernode for timelines instead of the drmfd, some devices dont support to use the drmfd for this. * opengl: use rendernode if available use rendernode if available for CHyprOpenglImpl * MesaDRM: use the m_drmRenderNodeFD if it exist try use the rendernode we got from AQ if it exist. * linuxdmabuf: use rendernode if available use the rendernode if available already from AQ * syncobj: prefer rendernode over displaynode prefer the rendernode over the displaynode, and log a error if attempting to use the protocol without explicit sync support on any of the nodes. * syncobj: check support on both nodes always check support on both nodes always so it can be used later for preferring rendernode if possible in syncobj protocol. * syncobj: remove old var in non linux if else case remove old m_bDrmSyncobjTimelineSupported from non linux if else case that will fail to compile on non linux. the nodes sets support by default to false, and if non linux it wont check for support and set it to true. * build: bump aq requirement bump to 0.9.3 where rendernode support got added. * flake.lock: update * renderer: glfinish on software renderer software renderers apparently bug out on implicit sync, use glfinish as with nvidia case on implicit paths. * flake.lock: update --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* hdr: scRGB, HLG and SDR -> HDR fixes (#11499)UjinT342025-08-221-17/+22
|
* render: include numbers header (#11475)Linux User2025-08-191-0/+1
| | | Fixes error `no member named 'numbers' in namespace 'std'` on llvm/musl
* internal: unify VT gettingvaxerski2025-08-141-5/+3
|
* refactor: Use new hyprutils casts (#11377)Kamikadze2025-08-141-34/+34
|
* renderer: apply default luma for reverting back to srgbVaxry2025-08-021-5/+8
| | | | fixes #11315
* screencopy: un-hdr screencopy buffers for cm-unaware clients (#11294)Vaxry2025-07-311-5/+9
|
* opengl: improve render fn arg clarity (#11286)Vaxry2025-07-311-88/+126
|
* renderer: use CRegion foreach over getRects (#10980)Tom Englund2025-07-301-32/+32
| | | | instead of allocating and returning a vector, use forEach to directly call a function on the rects.
* core: disable esync for non-linux kernelsVaxry2025-07-291-0/+5
| | | | ref #10437, BSD doesn't support timeline fds
* ci: correct tar command for xz compression & fix typos (#11213)xqso2025-07-251-1/+1
|
* internal: replace unsafe strcpy with snprintf (#11128)MirzaSamadAhmedBaig2025-07-201-2/+1
|
* 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