Skip to content

docs: add compute shader definition types#9067

Merged
mvaligursky merged 1 commit into
mainfrom
codex/issue-9060-shader-types
Jul 17, 2026
Merged

docs: add compute shader definition types#9067
mvaligursky merged 1 commit into
mainfrom
codex/issue-9060-shader-types

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Summary

  • Document computeBindGroupFormat and computeUniformBufferFormats on the public Shader definition.
  • Ensure generated TypeScript declarations accept both properties in inline shader definition objects.
  • Document that caller-provided compute resources use bind group 0 and that uniform buffer formats require the corresponding bind group format.

Fixes #9060

Public API changes

The generated Shader definition type now includes the existing WebGPU compute options.

Before:

new Shader(device, {
    cshader,
    computeBindGroupFormat // TypeScript excess-property error
});

After:

new Shader(device, {
    cshader,
    computeBindGroupFormat,
    computeUniformBufferFormats
});

This corrects the type declarations only; runtime behavior is unchanged.

Testing

  • npm run build:types
  • npm run test:types
  • npm run lint

Performance considerations

None. This is a JSDoc/type declaration correction with no runtime changes.

@github-actions

Copy link
Copy Markdown

Build size report

This PR does not change the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2279.9 KB — 587.6 KB — 456.9 KB —
playcanvas.min.mjs 2277.3 KB — 586.7 KB — 456.6 KB —

@github-actions

Copy link
Copy Markdown

Public API report

This PR changes the public API surface (+1 / −1), per the docs' rules (@ignore / @Private / undocumented are excluded).

Show API diff
-Shader.constructor(graphicsDevice: GraphicsDevice, definition: { attributes: object; cdefines: Map<string, string>; cincludes: Map<string, string>; computeEntryPoint: string; cshader: string; feedbackVaryings: string[]; fincludes: Map<string, string>; fragmentOutputTypes: string | string[]; fshader: string; name: string; shaderLanguage: string; useTransformFeedback: boolean; vincludes: Map<string, string>; vshader: string })
+Shader.constructor(graphicsDevice: GraphicsDevice, definition: { attributes: object; cdefines: Map<string, string>; cincludes: Map<string, string>; computeBindGroupFormat: BindGroupFormat; computeEntryPoint: string; computeUniformBufferFormats: object; cshader: string; feedbackVaryings: string[]; fincludes: Map<string, string>; fragmentOutputTypes: string | string[]; fshader: string; name: string; shaderLanguage: string; useTransformFeedback: boolean; vincludes: Map<string, string>; vshader: string })

Informational only — this never fails the build.

@mvaligursky
mvaligursky merged commit d7cc823 into main Jul 17, 2026
10 checks passed
@mvaligursky
mvaligursky deleted the codex/issue-9060-shader-types branch July 17, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

computeBindGroupFormat is accepted at runtime but missing from the Shader constructor definition type

1 participant