Skip to content

Fix invert system icons when using software rendering#701

Merged
dremin merged 1 commit intodremin:masterfrom
xoascf:fix-software-acc-invert-shader
Oct 15, 2023
Merged

Fix invert system icons when using software rendering#701
dremin merged 1 commit intodremin:masterfrom
xoascf:fix-software-acc-invert-shader

Conversation

@xoascf
Copy link
Collaborator

@xoascf xoascf commented Oct 15, 2023

Downgrades the shader_invert.ps shader version from 3.0 to 2.0, which is required for software rendering (Rendering Tier 0).

Closes #700

Comment on lines +13 to +15
float3 notAlpha = color.rgb * (1.0 / max(0.0001, alpha));
notAlpha = 1 - notAlpha;
color.rgb = notAlpha * alpha;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without using notAlpha it gives exactly the same result, since the generated shader only preserves the logic, so I didn't bother to change it to how it was before but being more explicit, this was before for PS 2.0:

    color.rgb = color.rgb * (1.0 / max(0.0001, alpha));
    color.rgb = 1 - color.rgb;
    color.rgb *= alpha;

Copy link
Owner

@dremin dremin left a comment

Choose a reason for hiding this comment

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

This looks great! I had attempted to use PS 2.0 originally but didn't adjust the shader code properly. Thanks!

@dremin dremin merged commit 096788d into dremin:master Oct 15, 2023
@xoascf xoascf deleted the fix-software-acc-invert-shader branch October 15, 2023 23:19
dremin added a commit to cairoshell/cairoshell that referenced this pull request Feb 22, 2024
dremin added a commit to cairoshell/cairoshell that referenced this pull request Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System Icons Not Inverting on System XP Theme

2 participants