diff options
author | 2020-11-23 00:43:59 +0100 | |
---|---|---|
committer | 2020-11-23 00:43:59 +0100 | |
commit | 1916755b6b3f84329c3e3f3e9a4e1b6d2b4e45a4 (patch) | |
tree | d94fda43e3c7037208caf7645f9a9313b6aa02c4 /wgpu | |
parent | f41eacc3dcc849f43c875872259ef8106e10be03 (diff) | |
download | iced-1916755b6b3f84329c3e3f3e9a4e1b6d2b4e45a4.tar.gz iced-1916755b6b3f84329c3e3f3e9a4e1b6d2b4e45a4.tar.bz2 iced-1916755b6b3f84329c3e3f3e9a4e1b6d2b4e45a4.zip |
Limit border radius to max dimension in `quad` pipeline
Diffstat (limited to 'wgpu')
-rw-r--r-- | wgpu/src/shader/quad.vert | 5 | ||||
-rw-r--r-- | wgpu/src/shader/quad.vert.spv | bin | 3372 -> 3604 bytes |
2 files changed, 5 insertions, 0 deletions
diff --git a/wgpu/src/shader/quad.vert b/wgpu/src/shader/quad.vert index 1d9a4fd2..09a278b1 100644 --- a/wgpu/src/shader/quad.vert +++ b/wgpu/src/shader/quad.vert @@ -24,6 +24,11 @@ void main() { vec2 p_Pos = i_Pos * u_Scale; vec2 p_Scale = i_Scale * u_Scale; + float i_BorderRadius = min( + i_BorderRadius, + min(i_Scale.x, i_Scale.y) / 2.0 + ); + mat4 i_Transform = mat4( vec4(p_Scale.x + 1.0, 0.0, 0.0, 0.0), vec4(0.0, p_Scale.y + 1.0, 0.0, 0.0), diff --git a/wgpu/src/shader/quad.vert.spv b/wgpu/src/shader/quad.vert.spv Binary files differindex 7059b51b..fa71ba1e 100644 --- a/wgpu/src/shader/quad.vert.spv +++ b/wgpu/src/shader/quad.vert.spv |