Skip to content

perf: vectorize corner shaders - #178

Open
WillPower3309 wants to merge 5 commits into
mainfrom
fast_corners
Open

perf: vectorize corner shaders#178
WillPower3309 wants to merge 5 commits into
mainfrom
fast_corners

Conversation

@WillPower3309

@WillPower3309 WillPower3309 commented Mar 14, 2026

Copy link
Copy Markdown
Member

based on my tinkering in https://www.shadertoy.com/view/sfs3DX

@WillPower3309
WillPower3309 marked this pull request as draft March 14, 2026 03:37
@WillPower3309

Copy link
Copy Markdown
Member Author

having some weird graphical issues right now, missing something

@WillPower3309

Copy link
Copy Markdown
Member Author

@ErikReider Can I ask you a huge favor? I'm really curious on how this compares to the current solution as far as tracy is considered. Would you mind checking for me?

@WillPower3309
WillPower3309 marked this pull request as ready for review March 16, 2026 22:15
Comment on lines +1 to +2
// TODO: remove relative pos - can do this via vertex shader
// we can then do vx and vy precomputed + on the vertex shader

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should in theory also help with the float16 issues on Nvidia if I'm not mistaken

// we can then do vx and vy precomputed + on the vertex shader

vec2 relative_pos = (gl_FragCoord.xy - position);
// radii is vec4(radius_tr, radius_br, radius_tl, radius_bl)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just curious, but is there a reason for this radius "winding order"?

}
return 1.0;
}
vec4 dists = sqrt(x_max*x_max + y_max*y_max) + min(max(vx, vy), 0.0) - radii;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if caching these in a LUT would help?

Comment on lines -813 to +870
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(texture->target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit:

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.

2 participants