Commit graph

452 commits

Author SHA1 Message Date
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
zacoons
8b1d5560cf
renderer: add wrapping options to renderTextureWithBlur method (#10807) 2025-06-21 19:03:28 +02:00
54ccf9c6b3
renderer: make lock fail textures dynamically loaded
this should reduce idle vram usage by a whopping 16MB, but also might fix the tty unknown issue.
2025-06-19 13:46:42 +02:00
UjinT34
c3894d9288
config/monitor: Add monitor v2 HDR rules (#10623) 2025-06-15 12:15:18 +02:00
3db3baa19e
opengl: use a stack for storing monitor transform enabled
fixes #10487
2025-06-15 12:11:28 +02:00
Kamikadze
16c62a6dbb
internal: Fix HyprError not displaying at startup (#10606) 2025-06-01 21:03:53 +01:00
Kamikadze
69c2b2926e
internal: refactor to use empty() (#10599) 2025-05-31 19:49:50 +01:00
Kamikadze
9190443d95
refactor: use std::ranges whenever possible (#10584) 2025-05-30 14:25:59 +01:00
zacoons
b90910c0dc
renderer: add wrapping options to renderTexture method (#10497) 2025-05-21 16:41:40 +01:00
Tom Englund
5ceb0ec15d
core: drop the legacy renderer (#10408)
* 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>
2025-05-15 10:13:24 +01:00
Tom Englund
59b2340680
opengl: add missing vao for screenshader (#10397)
missed creating vertex array objects in 04124988e8
add it.
2025-05-13 23:46:29 +01:00
Tom Englund
04124988e8
opengl: optimize shaders and reduce unneeded drawcalls (#10364)
* 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.
2025-05-11 18:36:20 +02:00
Vaxry
f58bb72d3a
renderer: render blur on fade out (#10356) 2025-05-10 19:31:26 +02:00
60cd5b7a48 renderer: always render snapshots as 8bit
fixes issues with transparent windows on 10b
2025-05-09 22:16:21 +01:00
f909b0f114
opengl: fix legacyrenderer 2025-05-08 18:22:44 +01:00
davc0n
22b12e3013
refactor: cshader class to sshader struct (#10324) 2025-05-08 00:07:35 +02:00
davc0n
997fefbc11
render: refactor class member vars (#10292)
* render: refactor class member vars

* render: fix clang format
2025-05-05 23:44:49 +02:00
davc0n
d9cad5e1b6
protocols: refactor class member vars (core) (#10259) 2025-05-03 16:02:49 +02:00
davc0n
50e1bec85f
helpers: refactor class member vars (#10218) 2025-04-30 23:45:20 +02:00
Ikalco
2ee5118d7a
render: properly release rendered buffers (#9807)
* cleanup eglSync

* properly release buffers in renderer

* add renderingDoneCallback and use it in screencopy

* use static constructor for CEGLSync
2025-04-30 18:35:25 +02:00
UjinT34
49974d5e34
cm: Use precomputed primaries conversion (#9814) 2025-04-29 21:29:40 +02:00
davc0n
2118440488
windows: refactor class member vars (#10168) 2025-04-28 22:25:22 +02:00
davc0n
02d7badd15
workspaces: refactor class member vars (#10167) 2025-04-25 02:37:12 +02:00
davc0n
0e80ecc534
layers: refactor class member vars (#10149)
* layers: refactor class member vars

* popups: rename m_WLSurface to m_wlSurface
2025-04-24 20:49:49 +02:00
M Matthew Hydock
be6268a7ec
groupbar: Add options for setting group bar title font weight (and indicator gap) (#9617) 2025-04-24 20:48:08 +02:00
davc0n
241a4935a2
compositor: refactor class member vars (#10141) 2025-04-22 15:23:29 +02:00
davc0n
4d14bcb02f
config: Refactor class member vars (#10124)
* Refactor config classes vars

* Fix clang format errors
2025-04-20 20:39:33 +02:00
Lee Bousfield
7631d4c73f
render, helpers: Call OpenGL destroyMonitorResources on disconnect (#10111)
* render, helpers: Call OpenGL destroyMonitorResources on disconnect

* helpers: Add opengl null check
2025-04-18 17:37:51 +02:00
MightyPlaza
ffd6cf65e4
windowrules: allow incrementing window props (#9566) 2025-04-16 01:00:40 +02:00