Skip to content

Commit

Permalink
sokol: don't draw from offscreen texture at all; merge shaders
Browse files Browse the repository at this point in the history
we don't want multisampling when drawing to the picking texture,
but we can't simultaneously draw with multisampling to another
texture, so instead just don't do anything BUT drawing to the
picking texture, before doing the rest anyway. with msaa
enabled, this reduces performance somewhat, but is still much
smoother and avoids both all the complication and drawing
issues.

- up to date sokol-shdc output, consolidate edge/node shaders
  into the same module, avoiding redundant uniform declarations
  • Loading branch information
qwx9 committed Jan 24, 2025
1 parent 8ba7d7a commit 2b5c1a7
Show file tree
Hide file tree
Showing 15 changed files with 1,619 additions and 2,514 deletions.
37 changes: 33 additions & 4 deletions glsl/edge.glsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@module e
@module edge

@vs vs
@glsl_options fixup_clipspace
Expand All @@ -21,11 +21,40 @@ precision mediump float;
layout(binding=1) uniform Fparam {
vec4 color;
};
out vec4 fc;
out vec4 c;

void main(){
fc = color;
c = color;
}
@end

@program edge vs fs
@vs vsoff
@glsl_options fixup_clipspace

precision mediump float;

layout(binding=0) uniform Vparam {
mat4 mvp;
};
in vec3 pos;
flat out uint idx;

void main(){
gl_Position = mvp * vec4(pos, 1.0);
idx = (gl_VertexIndex >> 1) + 1 | 1<<31;
}
@end

@fs fsoff
precision mediump float;

flat in uint idx;
out uint fc;

void main(){
fc = idx;
}
@end

@program idx vsoff fsoff
@program s vs fs
632 changes: 553 additions & 79 deletions glsl/edge.h

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions glsl/edgeidx.glsl

This file was deleted.

Loading

0 comments on commit 2b5c1a7

Please sign in to comment.