Skip to content

[Part 0] Shader variants refactor#13434

Open
UjinT34 wants to merge 12 commits intohyprwm:mainfrom
UjinT34:shader-variants-refactor
Open

[Part 0] Shader variants refactor#13434
UjinT34 wants to merge 12 commits intohyprwm:mainfrom
UjinT34:shader-variants-refactor

Conversation

@UjinT34
Copy link
Contributor

@UjinT34 UjinT34 commented Feb 28, 2026

Describe your PR, what does it fix/add?

Use glslang preprocessor for shaders.
Use #if to handle shader variants.
Adds variants to all shaders.
Adds experimental render:use_shader_blur_blend to render texture with blur and ignore alpha as a single draw call.

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

render:use_shader_blur_blend doesn't work on rotated monitors atm.
Initial part of #13272 refactors.
May fail to compile shaders if GL_ARB_shading_language_include isn't supported for ES

Is it ready for merging, or does it need work?

Requires glslang deps to build.
Ready

@UjinT34 UjinT34 changed the title Shader variants refactor [Part 0] Shader variants refactor Feb 28, 2026
@UjinT34 UjinT34 mentioned this pull request Mar 2, 2026
76 tasks
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm

@vaxerski
Copy link
Member

vaxerski commented Mar 2, 2026

also c-f + ci fix needed, likely the deps (glslang, spirv)

@UjinT34 UjinT34 force-pushed the shader-variants-refactor branch from 1fd9786 to 9c2df18 Compare March 2, 2026 12:25
@vaxerski
Copy link
Member

vaxerski commented Mar 2, 2026

well no dont move the enums inside the class just namespace Render{} it all. Bot hclass and enums.

As we move with the refactors ideally we'd move everything into Render:: and then have Render::GL::CRenderer and Render::Vk::CRenderer

@UjinT34
Copy link
Contributor Author

UjinT34 commented Mar 2, 2026

well no dont move the enums inside the class just namespace Render{} it all. Bot hclass and enums.

As we move with the refactors ideally we'd move everything into Render:: and then have Render::GL::CRenderer and Render::Vk::CRenderer

Both GL and VK use the same CShaderLoader for source loading and preprocessing. Compilers are different and don't poison ns. #13488 has all the Renderer API/namespace bits. In general CHyprGLRenderer shouldn't be used directly by anything except CHyprOpenGLImpl and other GL internals. Any other stuff should use g_pHyprRenderer (UP<IHyprRenderer>) more or less as usual. It should have all the necessary public facing bits.

@vaxerski
Copy link
Member

vaxerski commented Mar 2, 2026

this is more or less just a housekeeping preference. That's why I ask the loader to be in Render:: because it's generic. You can see all my new code is in namespaces (e.g. Event::, Layout::, etc)

it just makes the code more tidy

@UjinT34 UjinT34 force-pushed the shader-variants-refactor branch from 9c2df18 to 4b7a01e Compare March 2, 2026 12:57
@vaxerski
Copy link
Member

vaxerski commented Mar 2, 2026

@fufexan nix?

@github-actions github-actions bot added the nix label Mar 2, 2026
@UjinT34 UjinT34 force-pushed the shader-variants-refactor branch 2 times, most recently from 1b5467b to bdabf9e Compare March 4, 2026 22:09
@vaxerski
Copy link
Member

vaxerski commented Mar 5, 2026

I think the rebase was messy, doesn't render for me anymore
image

@UjinT34
Copy link
Contributor Author

UjinT34 commented Mar 5, 2026

Might be fixed now. I'll grab some ICC profile and test it myself later.
Should work without ICC profile as is.

@vaxerski
Copy link
Member

vaxerski commented Mar 5, 2026

no icc looks acceptable, icc broken.

image

@UjinT34 UjinT34 force-pushed the shader-variants-refactor branch from 6a0c6c4 to 1c9a7be Compare March 5, 2026 21:07
@UjinT34
Copy link
Contributor Author

UjinT34 commented Mar 5, 2026

Should have working CM in general with ICC stuff. Screen sharing copies the buffer as is or with incorrect CM. Haven't tested mirrors.
fp16 is WIP and broken atm.

@vaxerski
Copy link
Member

vaxerski commented Mar 5, 2026

will that be fixed with the fb refactor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants