Skip to content

Commit 2973989

Browse files
committed
Fix types for derivatives with respect to vector parameter elements
1 parent a9cdce1 commit 2973989

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@davepagurek/glsl-autodiff",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"main": "build/autodiff.js",
55
"author": "Dave Pagurek <[email protected]>",
66
"license": "MIT",

src/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ export class Value extends OpLiteral {
181181
export class Param extends OpLiteral {
182182
public name: string
183183

184-
constructor(ad: ADBase, name: string) {
185-
super(ad)
184+
constructor(ad: ADBase, name: string, ...dependsOn: Op[]) {
185+
super(ad, ...dependsOn)
186186
this.name = name
187187
this.ad.registerParam(this, name)
188188
}

src/vecBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export class VecElementRef extends Op {
2222
derivative(param: Param) { return `${this.dependsOn[0].derivRef(param)}.${this.prop}` }
2323
}
2424

25-
export class VecParamElementRef extends OpLiteral {
25+
export class VecParamElementRef extends Param {
2626
public prop: string
2727
public name: string
2828

2929
constructor(ad: ADBase, prop: string, vec: VecOp) {
30-
super(ad, vec)
30+
super(ad, `_glslad_r${vec.id}_${prop}`, vec)
3131
this.prop = prop
3232
this.name = `_glslad_r${vec.id}_${prop}`
3333
this.ad.registerParam(this, this.name)

0 commit comments

Comments
 (0)