mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
gpu: [compute] fix path gaps by eliminating redundant path points
See https://github.com/linebender/piet-gpu/issues/62 for description of the issue. The fix is the Gio copy of the piet-gpu fix. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+13
-9
@@ -10,13 +10,14 @@ struct State {
|
||||
vec4 mat;
|
||||
vec2 translate;
|
||||
vec4 bbox;
|
||||
uint tail;
|
||||
float linewidth;
|
||||
uint flags;
|
||||
uint path_count;
|
||||
uint pathseg_count;
|
||||
};
|
||||
|
||||
#define State_size 56
|
||||
#define State_size 60
|
||||
|
||||
StateRef State_index(StateRef ref, uint index) {
|
||||
return StateRef(ref.offset + index * State_size);
|
||||
@@ -38,14 +39,16 @@ State State_read(StateRef ref) {
|
||||
uint raw11 = state[ix + 11];
|
||||
uint raw12 = state[ix + 12];
|
||||
uint raw13 = state[ix + 13];
|
||||
uint raw14 = state[ix + 14];
|
||||
State s;
|
||||
s.mat = vec4(uintBitsToFloat(raw0), uintBitsToFloat(raw1), uintBitsToFloat(raw2), uintBitsToFloat(raw3));
|
||||
s.translate = vec2(uintBitsToFloat(raw4), uintBitsToFloat(raw5));
|
||||
s.bbox = vec4(uintBitsToFloat(raw6), uintBitsToFloat(raw7), uintBitsToFloat(raw8), uintBitsToFloat(raw9));
|
||||
s.linewidth = uintBitsToFloat(raw10);
|
||||
s.flags = raw11;
|
||||
s.path_count = raw12;
|
||||
s.pathseg_count = raw13;
|
||||
s.tail = raw10;
|
||||
s.linewidth = uintBitsToFloat(raw11);
|
||||
s.flags = raw12;
|
||||
s.path_count = raw13;
|
||||
s.pathseg_count = raw14;
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -61,9 +64,10 @@ void State_write(StateRef ref, State s) {
|
||||
state[ix + 7] = floatBitsToUint(s.bbox.y);
|
||||
state[ix + 8] = floatBitsToUint(s.bbox.z);
|
||||
state[ix + 9] = floatBitsToUint(s.bbox.w);
|
||||
state[ix + 10] = floatBitsToUint(s.linewidth);
|
||||
state[ix + 11] = s.flags;
|
||||
state[ix + 12] = s.path_count;
|
||||
state[ix + 13] = s.pathseg_count;
|
||||
state[ix + 10] = s.tail;
|
||||
state[ix + 11] = floatBitsToUint(s.linewidth);
|
||||
state[ix + 12] = s.flags;
|
||||
state[ix + 13] = s.path_count;
|
||||
state[ix + 14] = s.pathseg_count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user