From 7bf8ff6cb13906737829c4aa2d64df287c5d990d Mon Sep 17 00:00:00 2001 From: xiaoiver Date: Fri, 17 Apr 2026 17:24:14 +0800 Subject: [PATCH 1/3] fix: flipY in webgpu renderpass (#211) --- src/webgpu/RenderPass.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/webgpu/RenderPass.ts b/src/webgpu/RenderPass.ts index 659238a..76ae270 100644 --- a/src/webgpu/RenderPass.ts +++ b/src/webgpu/RenderPass.ts @@ -35,6 +35,7 @@ export class RenderPass_WebGPU implements RenderPass { private gfxColorResolveToLevel: number[] = []; private gfxDepthStencilAttachment: TextureShared_WebGPU | null = null; private gfxDepthStencilResolveTo: TextureShared_WebGPU | null = null; + private _viewportFlipHeight: number | undefined; constructor(private device: Device_WebGPU) { this.gpuColorAttachments = []; @@ -205,6 +206,23 @@ export class RenderPass_WebGPU implements RenderPass { ) ? getPlatformQuerySet(descriptor.occlusionQueryPool) : undefined; + + // Viewport/scissor Y flip must use the active render target height. Using swapChainHeight + // for offscreen passes places the viewport outside the attachment (nothing draws). + const firstColor = + this.gfxColorAttachment.length > 0 ? this.gfxColorAttachment[0] : null; + const level0 = + this.gfxColorAttachmentLevel.length > 0 + ? this.gfxColorAttachmentLevel[0] || 0 + : 0; + if (firstColor !== null && firstColor !== undefined) { + this._viewportFlipHeight = Math.max(1, firstColor.height >>> level0); + } else if (descriptor.depthStencilAttachment) { + const ds = descriptor.depthStencilAttachment as unknown as Attachment_WebGPU; + this._viewportFlipHeight = Math.max(1, ds.height >>> 0); + } else { + this._viewportFlipHeight = this.device['swapChainHeight']; + } } beginRenderPass( @@ -220,7 +238,8 @@ export class RenderPass_WebGPU implements RenderPass { } private flipY(y: number, h: number) { - const height = this.gfxColorAttachment[0].height; + const height = + this._viewportFlipHeight ?? this.device['swapChainHeight']; return height - y - h; } From 6d118ff644b03bfe3de7c0ae22066416852b894a Mon Sep 17 00:00:00 2001 From: xiaoiver Date: Fri, 17 Apr 2026 17:28:35 +0800 Subject: [PATCH 2/3] Fix flipy (#212) * fix: flipY in webgpu renderpass * chore: changeset --- .changeset/ten-cougars-live.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/ten-cougars-live.md diff --git a/.changeset/ten-cougars-live.md b/.changeset/ten-cougars-live.md new file mode 100644 index 0000000..64430b3 --- /dev/null +++ b/.changeset/ten-cougars-live.md @@ -0,0 +1,5 @@ +--- +'@antv/g-device-api': patch +--- + +Flip Y in renderpass in webgpu renderer. From 89701181830f28b6472742608d8828792f5ea5a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:29:30 +0800 Subject: [PATCH 3/3] chore(release): bump version (#213) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/ten-cougars-live.md | 5 ----- CHANGELOG.md | 6 ++++++ package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/ten-cougars-live.md diff --git a/.changeset/ten-cougars-live.md b/.changeset/ten-cougars-live.md deleted file mode 100644 index 64430b3..0000000 --- a/.changeset/ten-cougars-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@antv/g-device-api': patch ---- - -Flip Y in renderpass in webgpu renderer. diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b8d1e1..926ac65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # @antv/g-device-api +## 1.6.14 + +### Patch Changes + +- 6d118ff: Flip Y in renderpass in webgpu renderer. + ## 1.6.13 ### Patch Changes diff --git a/package.json b/package.json index 4a4dba9..03fe305 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/g-device-api", - "version": "1.6.13", + "version": "1.6.14", "description": "A Device API references WebGPU implementations", "keywords": [ "antv",