diff --git a/glow/src/shader/quad.vert b/glow/src/shader/quad.vert index d37b5c8d..82417856 100644 --- a/glow/src/shader/quad.vert +++ b/glow/src/shader/quad.vert @@ -29,6 +29,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 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 index 7059b51b..fa71ba1e 100644 Binary files a/wgpu/src/shader/quad.vert.spv and b/wgpu/src/shader/quad.vert.spv differ