mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
gpu/shaders: update piet-gpu
Changes: - fix BeginClip bounding box - replace continue not supported by HLSL Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-3
@@ -4210,16 +4210,15 @@ void main()
|
|||||||
{
|
{
|
||||||
ElementRef param_73 = this_ref;
|
ElementRef param_73 = this_ref;
|
||||||
Clip begin_clip = Element_BeginClip_read(param_73);
|
Clip begin_clip = Element_BeginClip_read(param_73);
|
||||||
|
anno_begin_clip.bbox = begin_clip.bbox;
|
||||||
if (is_stroke)
|
if (is_stroke)
|
||||||
{
|
{
|
||||||
State param_74 = st;
|
State param_74 = st;
|
||||||
vec2 lw_2 = get_linewidth(param_74);
|
vec2 lw_2 = get_linewidth(param_74);
|
||||||
anno_begin_clip.bbox = begin_clip.bbox + vec4(-lw_2, lw_2);
|
|
||||||
anno_begin_clip.linewidth = st.linewidth * sqrt(abs((st.mat.x * st.mat.w) - (st.mat.y * st.mat.z)));
|
anno_begin_clip.linewidth = st.linewidth * sqrt(abs((st.mat.x * st.mat.w) - (st.mat.y * st.mat.z)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
anno_begin_clip.bbox = begin_clip.bbox;
|
|
||||||
anno_fill.linewidth = 0.0;
|
anno_fill.linewidth = 0.0;
|
||||||
}
|
}
|
||||||
out_ref = AnnotatedRef(_2435.conf.anno_alloc.offset + ((st.path_count - 1u) * 32u));
|
out_ref = AnnotatedRef(_2435.conf.anno_alloc.offset + ((st.path_count - 1u) * 32u));
|
||||||
@@ -5121,7 +5120,7 @@ void main()
|
|||||||
CmdRef param_45 = cmd_ref;
|
CmdRef param_45 = cmd_ref;
|
||||||
cmd_ref = CmdRef(Cmd_Jump_read(param_44, param_45).new_ref);
|
cmd_ref = CmdRef(Cmd_Jump_read(param_44, param_45).new_ref);
|
||||||
cmd_alloc.offset = cmd_ref.offset;
|
cmd_alloc.offset = cmd_ref.offset;
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -386,13 +386,12 @@ void main() {
|
|||||||
case Element_BeginClip:
|
case Element_BeginClip:
|
||||||
Clip begin_clip = Element_BeginClip_read(this_ref);
|
Clip begin_clip = Element_BeginClip_read(this_ref);
|
||||||
AnnoBeginClip anno_begin_clip;
|
AnnoBeginClip anno_begin_clip;
|
||||||
|
// This is the absolute bbox, it's been transformed during encoding.
|
||||||
|
anno_begin_clip.bbox = begin_clip.bbox;
|
||||||
if (is_stroke) {
|
if (is_stroke) {
|
||||||
vec2 lw = get_linewidth(st);
|
vec2 lw = get_linewidth(st);
|
||||||
// This is the absolute bbox, it's been transformed during encoding.
|
|
||||||
anno_begin_clip.bbox = begin_clip.bbox + vec4(-lw, lw);
|
|
||||||
anno_begin_clip.linewidth = st.linewidth * sqrt(abs(st.mat.x * st.mat.w - st.mat.y * st.mat.z));
|
anno_begin_clip.linewidth = st.linewidth * sqrt(abs(st.mat.x * st.mat.w - st.mat.y * st.mat.z));
|
||||||
} else {
|
} else {
|
||||||
anno_begin_clip.bbox = begin_clip.bbox;
|
|
||||||
anno_fill.linewidth = 0.0;
|
anno_fill.linewidth = 0.0;
|
||||||
}
|
}
|
||||||
out_ref = AnnotatedRef(conf.anno_alloc.offset + (st.path_count - 1) * Annotated_size);
|
out_ref = AnnotatedRef(conf.anno_alloc.offset + (st.path_count - 1) * Annotated_size);
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ void main() {
|
|||||||
case Cmd_Jump:
|
case Cmd_Jump:
|
||||||
cmd_ref = CmdRef(Cmd_Jump_read(cmd_alloc, cmd_ref).new_ref);
|
cmd_ref = CmdRef(Cmd_Jump_read(cmd_alloc, cmd_ref).new_ref);
|
||||||
cmd_alloc.offset = cmd_ref.offset;
|
cmd_alloc.offset = cmd_ref.offset;
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user