examples/custom-renderer: correct packed struct -> extern struct
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
8bd822c35d
commit
a7a6ecdd45
2 changed files with 4 additions and 5 deletions
|
|
@ -33,9 +33,8 @@ pub const global_events = .{
|
|||
.tick = .{ .handler = tick },
|
||||
};
|
||||
|
||||
// TODO(important): this shouldn't be a packed struct, it should be extern.
|
||||
const UniformBufferObject = packed struct {
|
||||
offset: Vec3.Vector,
|
||||
const UniformBufferObject = extern struct {
|
||||
offset: Vec3,
|
||||
scale: f32,
|
||||
};
|
||||
|
||||
|
|
@ -146,7 +145,7 @@ fn tick(
|
|||
_ = id;
|
||||
|
||||
const ubo = UniformBufferObject{
|
||||
.offset = position.v,
|
||||
.offset = position,
|
||||
.scale = scale,
|
||||
};
|
||||
encoder.writeBuffer(renderer.state().uniform_buffer, uniform_offset * num_entities, &[_]UniformBufferObject{ubo});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// TODO(important): docs
|
||||
struct Uniform {
|
||||
pos: vec3<f32>,
|
||||
pos: vec4<f32>,
|
||||
scale: f32,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue