File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
packages/paddlejs-core/src/transform Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1-
2- import { GLOBALS } from '../globals' ;
31import TexturePacking from './texturePacking' ;
42import FormatInputsX from './formatInputsX' ;
53import type Transformer from './transformer' ;
@@ -16,14 +14,10 @@ const actions: TransformerAction = {
1614 new SplitOp ( )
1715 ] ,
1816 transforms : [
19- new FormatInputsX ( )
17+ new FormatInputsX ( ) ,
18+ new TexturePacking ( )
2019 ] ,
2120 postTransforms : [ ]
2221} ;
2322
24- // wegbl backend单独处理, 在第一个transform后面添加texturePacking
25- if ( GLOBALS . backend === 'webgl' ) {
26- actions . transforms . splice ( 1 , 0 , new TexturePacking ( ) ) ;
27- }
28-
2923export default actions ;
Original file line number Diff line number Diff line change 11/**
22 * @file texture_packing
33 */
4+
5+ import { GLOBALS } from '../globals' ;
46import OpExecutor from '../opFactory/opExecutor' ;
57import Transformer from './transformer' ;
68
@@ -107,6 +109,10 @@ export default class TexturePacking extends Transformer {
107109 }
108110
109111 transform ( ...args : any ) {
112+ // wegbl backend 单独处理
113+ if ( GLOBALS . backend !== 'webgl' ) {
114+ return ;
115+ }
110116 const [ originOp , vars , opsMap ] = args ;
111117
112118 if ( ! ( packedOpConditions [ originOp . type ] && packedOpConditions [ originOp . type ] ( originOp , vars ) ) ) {
You can’t perform that action at this time.
0 commit comments