@@ -60,7 +60,7 @@ class WebGPURenderPipelines {
6060
6161 // determine render pipeline
6262
63- currentPipeline = this . _acquirePipeline ( stageVertex , stageFragment , renderObject . object , nodeBuilder ) ;
63+ currentPipeline = this . _acquirePipeline ( stageVertex , stageFragment , renderObject ) ;
6464 cache . currentPipeline = currentPipeline ;
6565
6666 // keep track of all used times
@@ -92,14 +92,14 @@ class WebGPURenderPipelines {
9292
9393 }
9494
95- _acquirePipeline ( stageVertex , stageFragment , object , nodeBuilder ) {
95+ _acquirePipeline ( stageVertex , stageFragment , renderObject ) {
9696
9797 let pipeline ;
9898 const pipelines = this . pipelines ;
9999
100100 // check for existing pipeline
101101
102- const cacheKey = this . _computeCacheKey ( stageVertex , stageFragment , object ) ;
102+ const cacheKey = this . _computeCacheKey ( stageVertex , stageFragment , renderObject ) ;
103103
104104 for ( let i = 0 , il = pipelines . length ; i < il ; i ++ ) {
105105
@@ -117,7 +117,7 @@ class WebGPURenderPipelines {
117117 if ( pipeline === undefined ) {
118118
119119 pipeline = new WebGPURenderPipeline ( this . device , this . utils ) ;
120- pipeline . init ( cacheKey , stageVertex , stageFragment , object , nodeBuilder ) ;
120+ pipeline . init ( cacheKey , stageVertex , stageFragment , renderObject , this . nodes . get ( renderObject ) ) ;
121121
122122 pipelines . push ( pipeline ) ;
123123
@@ -127,9 +127,9 @@ class WebGPURenderPipelines {
127127
128128 }
129129
130- _computeCacheKey ( stageVertex , stageFragment , object ) {
130+ _computeCacheKey ( stageVertex , stageFragment , renderObject ) {
131131
132- const material = object . material ;
132+ const { object , material } = renderObject ;
133133 const utils = this . utils ;
134134
135135 const parameters = [
@@ -145,7 +145,7 @@ class WebGPURenderPipelines {
145145 material . side ,
146146 utils . getSampleCount ( ) ,
147147 utils . getCurrentEncoding ( ) , utils . getCurrentColorFormat ( ) , utils . getCurrentDepthStencilFormat ( ) ,
148- utils . getPrimitiveTopology ( object )
148+ utils . getPrimitiveTopology ( object , material )
149149 ] ;
150150
151151 return parameters . join ( ) ;
0 commit comments