Skip to content

Commit

Permalink
feat: update webgpu windowing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
load1n9 committed Oct 10, 2024
1 parent 0008eb0 commit 99e3b7b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 37 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v2

- name: Setup Deno
uses: denoland/setup-deno@main
with:
deno-version: 'v1.x'

- name: Deno Fmt
run: deno fmt --check

- name: Deno Lint
run: deno lint
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup repo
uses: actions/checkout@v2

- name: Setup Deno
uses: denoland/setup-deno@main
with:
deno-version: "v1.x"

- name: Deno Fmt
run: deno fmt --check

- name: Deno Lint
run: deno lint
2 changes: 0 additions & 2 deletions examples/webgpu-cube-floating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ const context = surface.getContext("webgpu");
context.configure({
device,
format: "bgra8unorm",
width,
height,
});

const verticesBuffer = device.createBuffer({
Expand Down
2 changes: 0 additions & 2 deletions examples/webgpu-cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ const context = surface.getContext("webgpu");
context.configure({
device,
format: "bgra8unorm",
width,
height,
});

const verticesBuffer = device.createBuffer({
Expand Down
4 changes: 1 addition & 3 deletions examples/webgpu-fractal-cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ context.configure({
device,
format: presentationFormat,
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC,
// alphaMode: "premultiplied",
width,
height,
// alphaMode: "premultiplied",
});

const verticesBuffer = device.createBuffer({
Expand Down
2 changes: 0 additions & 2 deletions examples/webgpu-triangle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const context = surface.getContext("webgpu");
context.configure({
device,
format: "bgra8unorm",
width,
height,
});

const shaderCode = `
Expand Down
2 changes: 0 additions & 2 deletions examples/webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const context = surface.getContext("webgpu");
context.configure({
device,
format: "bgra8unorm",
width,
height,
});

await mainloop(() => {
Expand Down
8 changes: 7 additions & 1 deletion src/platform/glfw/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,13 @@ export class WindowGlfw extends DwmWindow {

windowSurface() {
const [platform, handle, display] = this.#rawHandle();
return new Deno.UnsafeWindowSurface(platform, handle, display);
return new Deno.UnsafeWindowSurface({
system: platform,
windowHandle: handle,
displayHandle: display,
width: this.size.width,
height: this.size.height,
});
}

close() {
Expand Down

0 comments on commit 99e3b7b

Please sign in to comment.