Commit graph

480 commits

Author SHA1 Message Date
UjinT34
e0cf88809d
protocols/cm: Fix image description info events (#12781)
* 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
2026-01-13 16:44:36 +01:00
Tom Englund
5e18111121
renderer: shader code refactor (#12926)
* 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]
2026-01-12 18:27:16 +01:00
Vaxry
6fce2d7288
renderer/opengl: invalidate intermediate FBs post render, avoid stencil if possible (#12848) 2026-01-05 22:37:54 +01:00
610c59dc34
opengl: properly combine transforms in renderTexture
ref #12666
2025-12-27 20:18:57 +01:00
UjinT34
6d3b17ee83
render/cm: various updates, remove old protocols (#12693)
* fix named primaries

* default to gamma22

* mark mastering primaries as supported

* remove xx-cm and frog support

* immutable primaries and image descriptions

* clang-format
2025-12-27 18:01:46 +01:00
Vaxry
42447a50d6
rules/windowRuleApplicator: fix min/max size effects (#12491)
fixes #12412
2025-12-27 12:43:45 +01:00
Vaxry
6175ecd4c4
debug: move to hyprutils' logger (#12673) 2025-12-18 17:23:24 +00:00
jmanc3
e4a8f2b14f
renderer: add zoom with detached camera (#12548) 2025-12-14 19:42:02 +00:00
Dominick DiMaggio
5700736505
cm: handle CM for SDR content with cm=hdr, cm_sdr_eotf=2 (#12127) 2025-12-11 23:50:57 +00:00
Vaxry
920353370b
desktop: cleanup, unify desktop elements as views (#12563) 2025-12-08 15:04:40 +00:00
Dominick DiMaggio
532ca053d6
renderer/cm: higher-quality tonemapping (#12204) 2025-12-07 17:58:49 +00:00
jmanc3
38f912c401
renderer: remove unnecessary assert from renderRoundedShadow (#12540) 2025-12-04 18:03:12 +00:00
Nikolai Nechaev
40d8fa8491
compositor: Configurable behavior when window to be focused conflicts with 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.
2025-11-25 22:44:26 +00:00
Vaxry
c2670e9ab9
windowrules: rewrite completely (#12269)
Reworks the window rule syntax completely

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2025-11-17 18:34:02 +00:00
Vaxry
e616e595ae
i18n: init localization for ANR, Permissions and Notifications (#12316)
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>
2025-11-16 14:51:14 +00:00
Dominick DiMaggio
3fc8cb828c
cm: follow preferred srgb eotf for screencopy (#12230) 2025-11-07 14:02:26 +00:00
Dominick DiMaggio
ff50dc36e9
renderer/cm: allow gamma 2.2 instead of sRGB EOTF (#12094) 2025-10-29 12:53:42 +00:00
Tom Englund
6ea4769b39
EGL: minor egl changes (#12132)
* 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.
2025-10-25 20:36:02 +01:00
ccos89
b10b966000
screencopy: fix missing XBGR2101010 format with screencopy_force_8b (#12125)
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
2025-10-25 11:57:46 +01:00
Mozzarella32
46dab01bcc
renderer: add more uniforms to the screen shader (#11986)
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)
2025-10-20 12:22:50 +01:00
Vaxry
e40873be51
renderer: add cursor:zoom_disable_aa for controlling AA on zoom (#12025) 2025-10-15 14:08:34 +02:00
Vaxry
e0c96276df
renderer: optimize border drawcalls (#11891)
calculates the specific border region to avoid sampling on regions where the border cannot be at
2025-10-01 12:38:17 +01:00
UjinT34
4d82cc5957
internal: fix clang-tidy "errors" (#11862) 2025-09-29 13:10:15 +01:00
Tom Englund
eb25dfd399 opengl: move from unordered_set to array
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.
2025-09-28 23:20:52 +02:00
João V. Farias
7ce451d20c
renderer: disable anti-aliasing on cursor:zoom_factor (#6135) (#11828)
use nearest-neighbor filtering for cursor scaling to avoid blurriness
2025-09-25 21:14:04 +02:00
Vaxry
4fc95d646d
renderer: asynchronously load background tex (#11749)
Bumps required hyprgraphics to 0.1.6

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2025-09-18 22:10:30 +02:00
7fd6998f7c
core: fix clang-format 2025-09-17 13:02:56 +01:00
9e74d0aea7
renderer: clamp blur:passes 1-8
fixes some UB and dumb things

ref #11707
2025-09-15 12:44:12 +01:00
Florian "sp1rit
c7b9969129
render/OpenGL: fix compilation for 32bit systems (#11667) 2025-09-11 19:41:33 +02:00
Vaxry
02bb350bb3
screencopy: add force 8 bit to fix 10b screensharing (#11623)
ref https://github.com/hyprwm/xdg-desktop-portal-hyprland/issues/270
2025-09-08 11:07:04 +02:00
UjinT34
05a1c0aa73
renderer: Fix CM for DS and SDR passthrough (#11503) 2025-08-29 13:31:07 +02:00
Tom Englund
b329ea8e96
syncobj: use rendernode for timelines (#11087)
* 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>
2025-08-24 22:32:13 +02:00
UjinT34
4e8875b5e9
hdr: scRGB, HLG and SDR -> HDR fixes (#11499) 2025-08-22 11:13:55 +01:00
Linux User
d0d728c6a6
render: include numbers header (#11475)
Fixes error `no member named 'numbers' in namespace 'std'` on llvm/musl
2025-08-19 19:31:01 +01:00
60d769a899 internal: unify VT getting 2025-08-14 17:13:23 +02:00
Kamikadze
beee22a95e
refactor: Use new hyprutils casts (#11377) 2025-08-14 15:44:56 +01:00
824438949e
renderer: apply default luma for reverting back to srgb
fixes #11315
2025-08-02 16:21:08 +02:00
Vaxry
9607e3b5a8
screencopy: un-hdr screencopy buffers for cm-unaware clients (#11294) 2025-07-31 18:07:59 +02:00
Vaxry
a907ecd4ff
opengl: improve render fn arg clarity (#11286) 2025-07-31 16:23:09 +02:00
Tom Englund
36a8b2226f
renderer: use CRegion foreach over getRects (#10980)
instead of allocating and returning a vector, use forEach to directly
call a function on the rects.
2025-07-30 11:54:09 +02:00
66a6ef3859
core: disable esync for non-linux kernels
ref #10437, BSD doesn't support timeline fds
2025-07-29 17:55:56 +02:00
xqso
5c8d675eed
ci: correct tar command for xz compression & fix typos (#11213) 2025-07-25 17:19:23 +02:00
MirzaSamadAhmedBaig
503fc458d8
internal: replace unsafe strcpy with snprintf (#11128) 2025-07-20 15:31:53 +02:00
Vaxry
d84699d8e5
opengl: detect android fence support and disable explicit if it's missing (#11077)
Checks for explicit sync support via the android fences, and falls back to implicit sync if it isn't
2025-07-19 12:38:41 +02:00
Tom Englund
f5af40afce renderpass: use unique ptr instead of shared ptr
lets use unique ptrs instead of refcounting shared ptr when its not
needed, use rvalue reference to construct in vector directly.
2025-07-10 14:09:00 +02:00
FrancisTheCat
9517d0eaa4
renderer: Added a pointer position uniform to the screen shader. (#10821) 2025-07-08 19:31:15 +02:00
Tom Englund
9856563f89
opengl: avoid reallocations in EGLImage (#10960)
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.
2025-07-07 23:44:35 +02:00
Tom Englund
bb958a9e13 pass: overload TexPass constructor
overload it with a rvalue to allow us to move the data directly avoiding
an extra copy. because SRenderData is not trivially copyable.
2025-07-07 18:09:34 +02:00
Tom Englund
e827b75e22
opengl: add missing skipcm if case (#10888)
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.
2025-07-01 11:32:49 +02:00
Tom Englund
f4f090e4b2
renderer: reduce a lot of glcalls and cache various states (#10757)
* 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>
2025-06-25 12:42:32 +02:00