examples: make advanced-gen-texture-light compatible with self-hosted compiler

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-20 12:02:58 -07:00
parent 192de6946e
commit 0e14764ab2

View file

@ -194,7 +194,7 @@ const Camera = struct {
bind_group: *gpu.BindGroup, bind_group: *gpu.BindGroup,
buffer: Buffer, buffer: Buffer,
const Uniform = struct { const Uniform = extern struct {
pos: Vec, pos: Vec,
mat: Mat, mat: Mat,
}; };
@ -214,7 +214,7 @@ const Camera = struct {
const view = self.buildViewProjMatrix(); const view = self.buildViewProjMatrix();
const uniform = .{ const uniform = Uniform{
.pos = self.eye, .pos = self.eye,
.mat = view, .mat = view,
}; };
@ -678,14 +678,14 @@ const Light = struct {
bind_group: *gpu.BindGroup, bind_group: *gpu.BindGroup,
pipeline: *gpu.RenderPipeline, pipeline: *gpu.RenderPipeline,
const Uniform = struct { const Uniform = extern struct {
position: Vec, position: Vec,
color: Vec, color: Vec,
}; };
fn init(core: *mach.Core) Self { fn init(core: *mach.Core) Self {
const device = core.device; const device = core.device;
const uniform = .{ const uniform = Uniform{
.color = vec3u(1, 1, 1), .color = vec3u(1, 1, 1),
.position = vec3u(3, 7, 2), .position = vec3u(3, 7, 2),
}; };