File tree Expand file tree Collapse file tree
packages/typegpu/src/core/slot Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313} from '../../shared/symbols.ts' ;
1414import {
1515 getOwnSnippet ,
16+ NormalState ,
1617 type ResolutionCtx ,
1718 type SelfResolvable ,
1819} from '../../types.ts' ;
@@ -94,11 +95,17 @@ export class TgpuAccessorImpl<T extends AnyWgslData>
9495 return ownSnippet ;
9596 }
9697
97- // Doing a deep copy each time so that we don't have to deal with refs
98- return schemaCallWrapper (
99- this . schema ,
100- snip ( value , this . schema , /* origin */ 'constant' ) ,
101- ) ;
98+ ctx . pushMode ( new NormalState ( ) ) ;
99+ try {
100+ // Doing a deep copy each time so that we don't have to deal with refs
101+ const cloned = schemaCallWrapper (
102+ this . schema ,
103+ value ,
104+ ) ;
105+ return snip ( cloned , this . schema , 'constant' ) ;
106+ } finally {
107+ ctx . popMode ( 'normal' ) ;
108+ }
102109 }
103110
104111 $name ( label : string ) {
You can’t perform that action at this time.
0 commit comments