mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 08:55:35 +00:00
gpu: reintroduce reuse of offset-only stenciling
Reintroduce support for offset in stencil vertex so we can reuse cached values if the only difference in transform is offset. Split current transform into a pure-offset part and the rest and use only the complex part as cache key. Signed-off-by: Viktor <viktor.ogeman@gmail.com>
This commit is contained in:
@@ -6,6 +6,7 @@ precision highp float;
|
||||
|
||||
layout(binding = 0) uniform Block {
|
||||
vec4 transform;
|
||||
vec2 pathOffset;
|
||||
};
|
||||
|
||||
layout(location=0) in float corner;
|
||||
@@ -22,10 +23,10 @@ void main() {
|
||||
// Add a one pixel overlap so curve quads cover their
|
||||
// entire curves. Could use conservative rasterization
|
||||
// if available.
|
||||
vec2 from = from;
|
||||
vec2 ctrl = ctrl;
|
||||
vec2 to = to;
|
||||
float maxy = maxy;
|
||||
vec2 from = from + pathOffset;
|
||||
vec2 ctrl = ctrl + pathOffset;
|
||||
vec2 to = to + pathOffset;
|
||||
float maxy = maxy + pathOffset.y;
|
||||
vec2 pos;
|
||||
float c = corner;
|
||||
if (c >= 0.375) {
|
||||
|
||||
Reference in New Issue
Block a user