mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
don't use position name twice to prevent collision on macos metal
This commit is contained in:
parent
b1245ffd7f
commit
50928d8578
3 changed files with 4 additions and 4 deletions
|
@ -90,7 +90,7 @@ pub fn create_rect_buffers(
|
|||
|
||||
pub fn to_quad(rect_elt: &RectElt) -> Quad {
|
||||
Quad {
|
||||
position: rect_elt.rect.top_left_coords.into(),
|
||||
pos: rect_elt.rect.top_left_coords.into(),
|
||||
width: rect_elt.rect.width,
|
||||
height: rect_elt.rect.height,
|
||||
color: to_slice(rect_elt.color),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
/// A polygon with 4 corners
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Quad {
|
||||
pub position: [f32; 2],
|
||||
pub pos: [f32; 2],
|
||||
pub width: f32,
|
||||
pub height: f32,
|
||||
pub color: [f32; 4],
|
||||
|
|
|
@ -13,7 +13,7 @@ struct VertexInput {
|
|||
};
|
||||
|
||||
struct Quad {
|
||||
@location(1) position: vec2<f32>;
|
||||
@location(1) pos: vec2<f32>; // can't use the name "position" twice for compatibility with metal on MacOS
|
||||
@location(2) width: f32;
|
||||
@location(3) height: f32;
|
||||
@location(4) color: vec4<f32>;
|
||||
|
@ -38,7 +38,7 @@ fn vs_main(
|
|||
vec4<f32>(quad.width, 0.0, 0.0, 0.0),
|
||||
vec4<f32>(0.0, quad.height, 0.0, 0.0),
|
||||
vec4<f32>(0.0, 0.0, 1.0, 0.0),
|
||||
vec4<f32>(quad.position, 0.0, 1.0)
|
||||
vec4<f32>(quad.pos, 0.0, 1.0)
|
||||
);
|
||||
|
||||
var out: VertexOutput;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue