Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提升 Shader 开发体验 #20

Open
xiaoiver opened this issue Jun 8, 2020 · 1 comment
Open

提升 Shader 开发体验 #20

xiaoiver opened this issue Jun 8, 2020 · 1 comment

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Jun 8, 2020

虽然我们的 Shader 代码使用了 TypeScript 语法,但在字符串中写计算逻辑总是不太好的体验。 未来我们希望提供 G 语言的 VS Code 扩展,提供高亮、诊断、自动补全等语言特性,提升开发者的编程体验。

这样开发者可以创建 .g 文件,使用类似 webpack 的 raw-loader 以字符串形式加载:

import myGCode from './my-code.g';

const compute = world.createComputePipeline({
  shader: myGCode,
  dispatch: [1, 1, 1], // 线程网格
  onCompleted: (result) => {},
});
@xiaoiver
Copy link
Contributor Author

发布了 VS Code 扩展:
https://marketplace.visualstudio.com/items?itemName=xiaoiver-antfin.vscode-gwebgpu

目前仅具备语法高亮特性,基于 TypeScript 的 TextMate grammars 裁剪扩展得到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant