File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,8 @@ export class Pool2DProgram implements GPGPUProgram {
45
45
46
46
let initializationValue = '0.0' ;
47
47
if ( ! isAvgPool ) {
48
- initializationValue = '-1.0 / 0.0' ;
48
+ // WebGL on Firefox Linux can't compile 1/0 so we do 1/eps.
49
+ initializationValue = '-1.0 / 1e-20' ;
49
50
}
50
51
51
52
if ( computePositions ) {
Original file line number Diff line number Diff line change @@ -38,10 +38,12 @@ export class ReduceProgram implements GPGPUProgram {
38
38
if ( reduceType === 'prod' ) {
39
39
initializationValue = '1.0' ;
40
40
} else if ( reduceType === 'min' ) {
41
- initializationValue = '1.0 / 0.0' ;
41
+ // WebGL on Firefox Linux can't compile 1/0 so we do 1/eps.
42
+ initializationValue = '1.0 / 1e-20' ;
42
43
compareOp = `min` ;
43
44
} else if ( reduceType === 'max' ) {
44
- initializationValue = '-1.0 / 0.0' ;
45
+ // WebGL on Firefox Linux can't compile 1/0 so we do 1/eps.
46
+ initializationValue = '-1.0 / 1e-20' ;
45
47
compareOp = `max` ;
46
48
}
47
49
You can’t perform that action at this time.
0 commit comments