summaryrefslogtreecommitdiff
path: root/src/render/Shader.hpp
Commit message (Collapse)AuthorAgeFilesLines
* renderer: add more uniforms to the screen shader (#11986)Mozzarella322025-10-201-0/+12
| | | | | | | | | | | | 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 1fv and 2fv uniform support (#12080)Mozzarella322025-10-181-3/+8
|
* renderer: Added a pointer position uniform to the screen shader. (#10821)FrancisTheCat2025-07-081-0/+1
|
* renderer: reduce a lot of glcalls and cache various states (#10757)Tom Englund2025-06-251-70/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* opengl: optimize shaders and reduce unneeded drawcalls (#10364)Tom Englund2025-05-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | * 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.
* refactor: cshader class to sshader struct (#10324)davc0n2025-05-081-3/+2
|
* render: refactor class member vars (#10292)davc0n2025-05-051-3/+0
| | | | | * render: refactor class member vars * render: fix clang format
* cm: Use precomputed primaries conversion (#9814)UjinT342025-04-291-1/+3
|
* renderer/opengl: Extract shaders from source (#9600)UjinT342025-03-291-2/+1
| | | | | --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* opengl: simplify cm pipelineVaxry2025-03-161-1/+0
| | | | | | fixes a few mistakes, and skips the CM shader in cpu instead of adding a costly branch ref #9641
* renderer: add simple color management (#9506)UjinT342025-03-141-0/+11
| | | Adds proper color management and transformations for CM surfaces.
* renderer: Add supercircular window corners (#8943)Pollux2025-01-051-0/+1
| | | | | | | renderer: Add supercircular shadows and borders config: Add rounding_power to default and example configs rule: add `roundingpower` window rule
* core: move colorspace handling to oklab (#8635)Vaxry2024-12-031-3/+7
| | | | | | | | | | | * Meson: add hyprgraphics * Nix: add hyprgraphics * CI/setup_base: get hyprgraphics-git --------- Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
* renderer: Make shader time always count from zero (#6903)Party Wumpus2024-07-161-4/+5
| | | | | | | * testing out an initialtime variable * Make time universally start at zero instead of exposing an initial time * Appease the CI
* screenshader: rename output uniform to wl_output (#4606)JManch2024-02-041-3/+3
| | | | | * screenshader: rename output uniform to monitor * rename to wl_output
* renderer: added new customization options to the blur shaders (#3650)Visual-Dawg2023-11-061-5/+13
| | | Adds to `decoration:blur:` `vibrancy` and `vibrancy_darkness`
* Decos: Window decoration flags, shadow improvements (#3739)Vaxry2023-11-041-5/+8
|
* shaders: support changing the outer radius of borders independentlyVaxry2023-10-191-0/+1
|
* renderer: nuke multisample_edges in favor of a faster algorithmvaxerski2023-09-301-1/+0
|
* renderer: Various Blur Improvements (#2877)Vaxry2023-08-031-0/+4
| | | | | * move blur to its own category * blur improvements, contrast, brightness, noise
* shader: init uniforms to -1vaxerski2023-06-141-35/+35
|
* Allow setting alpha value for ignorezero layer rule (#2477)end-42023-06-111-29/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rename ignorezero to ignorealpha * allow setting ignorealpha value This commit allows setting a float value (0-1) for the ignorealpha layer rule. Does not yet have error handling; invalid ignorealpha layer rule will crash Hyprland. * add brackets i forgot to add * prevent crash with invalid ignorealpha value prevents hyprland from immediately crashing with invalid ignorealpha layer rule does not log * don't try to set ignoreAlphaValue if alpha value not specified * add catch to try, reintroduce ignorezero - added catch after try cuz i was an idiot - re-add ignorezero as an alternative to ignorealpha to not introduce a breaking change * add logging for failed ignorealpha layer rule * fix get ignorealpha's get VALUE * check npos and use empty() * rename VALUE cuz no longer const * format Shader.hpp
* screenshader: add output uniformvaxerski2023-06-101-0/+1
|
* debug: added manual_crashvaxerski2023-04-041-0/+1
|
* LS: add blur and ignorezero rulesvaxerski2023-03-171-0/+1
|
* Optionally expose time to screen shaders (#1700)scorpion-262023-03-051-0/+2
| | | | | | | | | * Optionally expose time to screen shaders Since that collides with damage tracking, it will only be done, when damage tracking is disabled, meaning this comes at no cost for everyone not using time. * Rename m_Timer to m_tGlobalTimer
* Added clang format (#1239)Vaxry2022-12-161-26/+26
| | | * clang-format stuff and format files
* Added screen shadersvaxerski2022-12-011-0/+2
|
* fix transformed border thicknessvaxerski2022-11-261-0/+1
|
* added border gradientsvaxerski2022-11-261-0/+4
|
* Added window dimmingvaxerski2022-08-301-0/+3
|
* destroy program in shader destructorvaxerski2022-08-111-1/+3
|
* Optimize shadersvaxerski2022-07-291-0/+13
|
* added CPU uniform location lookup optimizationvaxerski2022-06-301-8/+7
|
* borders are now gangstavaxerski2022-05-171-0/+1
|
* Don't blur behind opaque pixelsvaxerski2022-04-171-0/+1
|
* progressvaxerski2022-04-041-0/+20