[PR #6] feat(🫐): Use TypeGPU to strengthen the I/O layer between the CPU and GPU #994

Open
opened 2026-03-14 09:12:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/6
Author: @iwoplaza
Created: 7/30/2025
Status: 🔄 Open

Base: mainHead: feat/typegpu-supersampling


📝 Commits (8)

  • a98a8ff Use TypeGPU schemas to strengthen the IO layer between the super-sampling shader and pipeline setup
  • cc77469 Split the shader into TypeGPU functions
  • c955d23 Use TypeGPU pipelines
  • b705866 Update to typegpu 0.7.0
  • 0b4b421 Merge branch 'main' into feat/typegpu-supersampling
  • 8a5aeab Merge branch 'main' into feat/typegpu-supersampling
  • 7b0a243 Remove unused supersampling.wgsl
  • 7a1b3fb Fix package.json after merge

📊 Changes

5 files changed (+267 additions, -278 deletions)

View changed files

📝 bun.lock (+19 -0)
📝 packages/core/package.json (+2 -1)
📝 packages/core/src/3d/canvas.ts (+28 -76)
packages/core/src/3d/shaders/supersampling.ts (+218 -0)
packages/core/src/3d/shaders/supersampling.wgsl (+0 -201)

📄 Description

Hey guys! 👋
Awesome initiative, TUIs are really having a comeback. And when I saw @kommander's involvement, and WebGPU running in the terminal, I had to snoop around the code.

I maintain a TypeScript library that promises better synergy between TypeScript and WebGPU, without getting in the developer's way, called TypeGPU. More TypeScript'y stuff can be sprinkled in where it makes sense, but the rest can be kept vanilla WebGPU. It's still in active development, and I love taking opportunities to see if it can help in projects that already use WebGPU at it's current state. This will help me remove any ['~unstable'] tags from TypeGPU APIs and ensure that what it's providing is actually useful to the community!

If you guys like this direction, we could go further by actually implementing the shader functions in TypeScript, instead of WGSL strings. It's something that my team and I been working on for a couple of months now, where we can compile TypeScript to WGSL at build time*. We can choose the implementation language at the function level, so a shader can be composed of TS and WGSL, no lock in ⛓️💥

    • The compilation process is more precisely:
      At build-time: JavaScript -> tinyest (Tiny Embeddable Syntax Tree™) --(crossing over to runtime)--> WGSL
      We do this to support more dynamic shader linking, while still not having to ship a JS parser to the browser/terminal like we would have to otherwise 🤢

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/6 **Author:** [@iwoplaza](https://github.com/iwoplaza) **Created:** 7/30/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/typegpu-supersampling` --- ### 📝 Commits (8) - [`a98a8ff`](https://github.com/anomalyco/opentui/commit/a98a8ffb6fde11477a7f87a71118a8879898ba9c) Use TypeGPU schemas to strengthen the IO layer between the super-sampling shader and pipeline setup - [`cc77469`](https://github.com/anomalyco/opentui/commit/cc7746924074827b7c05fe8da60f33294fc5feca) Split the shader into TypeGPU functions - [`c955d23`](https://github.com/anomalyco/opentui/commit/c955d23662bb6f2a5a8cda2da62b995c8144d6c2) Use TypeGPU pipelines - [`b705866`](https://github.com/anomalyco/opentui/commit/b705866cf570801ce17dc1075aaf153458b60b58) Update to typegpu 0.7.0 - [`0b4b421`](https://github.com/anomalyco/opentui/commit/0b4b4215568b3ccd96320dbca3f320c71ad97959) Merge branch 'main' into feat/typegpu-supersampling - [`8a5aeab`](https://github.com/anomalyco/opentui/commit/8a5aeab6ec0f1561292ec4b40bc78119a4a4e39f) Merge branch 'main' into feat/typegpu-supersampling - [`7b0a243`](https://github.com/anomalyco/opentui/commit/7b0a24383b7c1a2cffd2c0dfb2df66479d9d5560) Remove unused supersampling.wgsl - [`7a1b3fb`](https://github.com/anomalyco/opentui/commit/7a1b3fb80830a36902d73f5836c4c11fe86b552f) Fix package.json after merge ### 📊 Changes **5 files changed** (+267 additions, -278 deletions) <details> <summary>View changed files</summary> 📝 `bun.lock` (+19 -0) 📝 `packages/core/package.json` (+2 -1) 📝 `packages/core/src/3d/canvas.ts` (+28 -76) ➕ `packages/core/src/3d/shaders/supersampling.ts` (+218 -0) ➖ `packages/core/src/3d/shaders/supersampling.wgsl` (+0 -201) </details> ### 📄 Description Hey guys! 👋 Awesome initiative, TUIs are really having a comeback. And when I saw @kommander's involvement, and WebGPU running in the terminal, I had to snoop around the code. I maintain a TypeScript library that promises better synergy between TypeScript and WebGPU, without getting in the developer's way, called [TypeGPU](https://github.com/software-mansion/TypeGPU). More TypeScript'y stuff can be sprinkled in where it makes sense, but the rest can be kept vanilla WebGPU. It's still in active development, and I love taking opportunities to see if it can help in projects that already use WebGPU at it's current state. This will help me remove any `['~unstable']` tags from TypeGPU APIs and ensure that what it's providing is actually useful to the community! If you guys like this direction, we could go further by actually implementing the shader functions in TypeScript, instead of WGSL strings. It's something that my team and I been working on for a couple of months now, where we can compile TypeScript to WGSL at build time*. We can choose the implementation language at the function level, so a shader can be composed of TS and WGSL, no lock in ⛓️‍💥 * - The compilation process is more precisely: At build-time: JavaScript -> tinyest (Tiny Embeddable Syntax Tree™) --(crossing over to runtime)--> WGSL We do this to support more dynamic shader linking, while still not having to ship a JS parser to the browser/terminal like we would have to otherwise 🤢 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#994
No description provided.