summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
Commit message (Collapse)AuthorAgeFilesLines
* opengl: add debug:gl_debugging (#13183)Tom Englund2026-02-061-5/+10
| | | | | | | | | | | | | add debug:gl_debugging so we can disable gl debugging entirerly, both glGetError and enabling EGL_KHR_debug has its cost, we still have EXT_create_context_robustness and glGetGraphicsResetStatus that should catch context loss, and is generally cheap to call it only checks a flag set. glGetError might cause a implicit flush to get any pending calls sent to the gpu. however to get EGL_KHR_debug back enabled we now require a restart of the compositor after changing debug:gl_debugging
* renderer: fix screen export back to srgb (#13148)UjinT342026-02-021-21/+23
|
* opengl: set EGL_CONTEXT_RELEASE_BEHAVIOR_KHR if supported (#13114)Tom Englund2026-01-301-0/+7
| | | | | | | | | EGL_CONTEXT_RELEASE_BEHAVIOR_KHR determines what happends with implicit flushes when context changes, on multigpu scenario we change context frequently when blitting content. while we still rely on explicit sync fences, the flush is destroying driver optimisations. setting it to EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR essentially mean just swap context and continue processing on the next context.
* opengl: allow texture filter to be changed (#13078)jmanc32026-01-271-4/+4
| | | | | | | | | | | * opengl: allow texture filter to be changed * format * correct filter * Moved from OpenGL.hpp to Texture.hpp * Shortened names
* renderer: add surface shader variants with less branching and uniforms (#13030)UjinT342026-01-211-35/+121
| | | | | | | | | * shader variant features * getSurfaceShader variant with feats * split surface shaders by features * cleanup old shaders
* renderer: optimise shader usage further, split shaders and add more caching ↵Tom Englund2026-01-171-22/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#12992) * shader: split CM rgba/rgbx into discard ones make it branchless if we have no discards. * shader: ensure we dont stall on vbo uv buffer if we render a new texture before the previous was done gpu wise its going to stall until done, call glBufferData to orphan the data. this allows the driver to return a new memory block immediately if the GPU is still reading from the previous one * protocols: ensure we reset GL_PACK_ALIGNMENT reset GL_PACK_ALIGNMENT back to the default initial value of 4 * shader: use unsigned short in VAO loose a tiny bit of precision but gain massive bandwidth reductions. use GL_UNSIGNED_SHORT and set it as normalized. clamp and round the UV for uint16_t in customUv. * shader: interleave vertex buffers use std::array for fullverts, use a single interleaved buffer for position and uv, should in theory improve cache locality. and also remove the need to have two buffers around. * shader: revert precision drop we need the float precision because we might have 1.01 or similiar floats entering CM shader maths, and rounding/clamping those means the maths turns out wrong. so revert back to float, sadly higher bandwidth usage. * update doColorManagement api * convert primaries to XYZ on cpu * remove unused primaries uniform --------- Co-authored-by: UjinT34 <ujint34@mail.ru>
* core: optimize some common branchesVaxry2026-01-161-11/+11
|
* protocols/cm: Fix image description info events (#12781)UjinT342026-01-131-5/+3
| | | | | | | | | | | | | | | | | | | | | | | * fix image description info events * always send some target primaries * set edid values as target primaries and luminances * init monitor image description * set default luminances for tf * fix BT1886 luminances * fix mastering values and overrides * set maxCLL & maxFALL * typo * add FALL & CLL to preferred HDR image description * fix ref luminances
* renderer: shader code refactor (#12926)Tom Englund2026-01-121-548/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * shader: begin the shader refactor make SShader a class and rename it to CShader, move createprogram, compileshader, logshadererror to CShader. * shader: move uniform creation to CShader move uniform creation to CShader, reduces tons of duplicated effort, however forcing uniform names to be same in all shaders. * shader: move to array based frag handling use an array with an enum so it gets easier dealing with multiple shaders, move creating program to a for loop and array, reduces line of code a lot. * shader: use shared ptr for frags with smart pointers we can now rename useProgram to useShader and return the shader directly, means only place we have to decide the shader frag is when calling useShader. easier for future shader splitting to reduce branching. * shader: move unneded public members to private move structs and uniforms to private add a get/set for initialtime and add a getUniformLocation to make the code tell what its doing, instead of direct array getting when all we wanted to get was its value, also limits the setting of uniformLocations to the createProgram as it should be. * shader: fix style nits set first enum member to 0 , remove extra {} * shader: dont show a failed notif on success the logic got inverted in the refactor here. * shader: split CM shader to rgba/rgbx variants split shader to rgba/rgbx variants, use bool, and reduce branching. * shader: split up blurprepare CM and non CM split up blurprepare, remove skipcm, move gain to gain.glsl. remove ternary operator and reduce branching by using step() and mix() use vec3 for gain, make brightness a cheap mulitplication with max. * shader: split up border to CM/noncm variants splitup border shader to CM/noncm variant, move common used things to border.glsl , there is room for optimisations here but its a complex shader im putting it for future PR. * shader: touchup blurfinish make brightness a cheap multiplication instead of branching. mod is redundant, fract in hash already returns a value in [0.0, 1.0]
* renderer/opengl: invalidate intermediate FBs post render, avoid stencil if ↵Vaxry2026-01-051-57/+38
| | | | possible (#12848)
* opengl: properly combine transforms in renderTextureVaxry2025-12-271-4/+5
| | | | ref #12666
* render/cm: various updates, remove old protocols (#12693)UjinT342025-12-271-44/+46
| | | | | | | | | | | | | * fix named primaries * default to gamma22 * mark mastering primaries as supported * remove xx-cm and frog support * immutable primaries and image descriptions * clang-format
* rules/windowRuleApplicator: fix min/max size effects (#12491)Vaxry2025-12-271-22/+22
| | | fixes #12412
* debug: move to hyprutils' logger (#12673)Vaxry2025-12-181-68/+71
|
* renderer: add zoom with detached camera (#12548)jmanc32025-12-141-15/+3
|
* cm: handle CM for SDR content with cm=hdr, cm_sdr_eotf=2 (#12127)Dominick DiMaggio2025-12-111-1/+3
|
* desktop: cleanup, unify desktop elements as views (#12563)Vaxry2025-12-081-3/+3
|
* renderer/cm: higher-quality tonemapping (#12204)Dominick DiMaggio2025-12-071-8/+20
|
* renderer: remove unnecessary assert from renderRoundedShadow (#12540)jmanc32025-12-041-1/+0
|
* compositor: Configurable behavior when window to be focused conflicts with ↵Nikolai Nechaev2025-11-251-1/+2
| | | | | | | | | | fullscreen (#12033) Renames `misc:new_window_takes_over_fullscreen` into `misc:on_focus_under_fullscreen` and implements the following behavior: - By default, when a tiling window is being focused on a workspace where a fullscreen/maximized window exists, respect the `misc:on_focus_under_fullscreen` config variable.
* 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
|