Skip to content

Commit a9efe22

Browse files
committed
fix(strands): register augmented functions and uniformStorage in FES signatures
1 parent d80ada9 commit a9efe22

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/strands/strands_api.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ function installInstanceIndexAccessor(strandsContext) {
251251
*/
252252
function augmentFn(fn, p5, name, value) {
253253
fn[name] = value;
254+
p5?._strandsSignatures?.set(name, true);
255+
p5?._strandsSignatures?.set(`p5.${name}`, true);
254256
const GraphicsProto = p5?.Graphics?.prototype;
255257
if (GraphicsProto) {
256258
GraphicsProto[name] = value;
@@ -397,6 +399,7 @@ export function initGlobalStrandsAPI(p5, fn, strandsContext) {
397399
p5._strandsSignatures.set('discard', true);
398400
augmentFn(fn, p5, 'discard', function () {
399401
build.statementNode(strandsContext, StatementType.DISCARD);
402+
});
400403
// Early exits would skip helper-state writes at the end of the loop.
401404
// The generated loop-exit break bypasses this check.
402405
function rejectLoopExitWithHelpers(statement) {
@@ -1682,6 +1685,8 @@ export function initGlobalStrandsAPI(p5, fn, strandsContext) {
16821685
}
16831686

16841687
// Storage buffer uniform function for compute shaders
1688+
p5?._strandsSignatures?.set('uniformStorage', true);
1689+
p5?._strandsSignatures?.set('p5.uniformStorage', true);
16851690
fn.uniformStorage = function (name, bufferOrSchema) {
16861691
const shaderName = resolveShaderName(
16871692
strandsContext,

0 commit comments

Comments
 (0)