gpu,gpu/shaders: revert attempt to fix path gaps

This is effectively a revert of [0], reintroducing the path gaps
described in [1]. A follow-up change will implement another attempt.

[0] https://gioui.org/commit/2feec23561cd84d6b8ddbab84a202df66b123208
[1] https://github.com/linebender/piet-gpu/issues/62

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-03-13 10:09:40 +01:00
parent 65a2410bb9
commit 2b21b48a7c
9 changed files with 59 additions and 133 deletions
+9 -13
View File
@@ -10,14 +10,13 @@ struct State {
vec4 mat;
vec2 translate;
vec4 bbox;
uint tail;
float linewidth;
uint flags;
uint path_count;
uint pathseg_count;
};
#define State_size 60
#define State_size 56
StateRef State_index(StateRef ref, uint index) {
return StateRef(ref.offset + index * State_size);
@@ -39,16 +38,14 @@ 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.tail = raw10;
s.linewidth = uintBitsToFloat(raw11);
s.flags = raw12;
s.path_count = raw13;
s.pathseg_count = raw14;
s.linewidth = uintBitsToFloat(raw10);
s.flags = raw11;
s.path_count = raw12;
s.pathseg_count = raw13;
return s;
}
@@ -64,10 +61,9 @@ 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] = 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;
state[ix + 10] = floatBitsToUint(s.linewidth);
state[ix + 11] = s.flags;
state[ix + 12] = s.path_count;
state[ix + 13] = s.pathseg_count;
}