44 *
55 * GPU Accelerated JavaScript
66 *
7- * @version 2.9.1
8- * @date Tue Mar 24 2020 07:52:55 GMT-0400 (Eastern Daylight Time)
7+ * @version 2.9.2
8+ * @date Mon Mar 30 2020 08:17:24 GMT-0400 (Eastern Daylight Time)
99 *
1010 * @license MIT
1111 * The MIT License
@@ -4615,6 +4615,29 @@ class GLKernel extends Kernel {
46154615 return result [ 0 ] === 2 && result [ 1 ] === 1511 ;
46164616 }
46174617
4618+ static getIsSpeedTacticSupported ( ) {
4619+ function kernelFunction ( value ) {
4620+ return value [ this . thread . x ] ;
4621+ }
4622+ const kernel = new this ( kernelFunction . toString ( ) , {
4623+ context : this . testContext ,
4624+ canvas : this . testCanvas ,
4625+ validate : false ,
4626+ output : [ 4 ] ,
4627+ returnType : 'Number' ,
4628+ precision : 'unsigned' ,
4629+ tactic : 'speed' ,
4630+ } ) ;
4631+ const args = [
4632+ [ 0 , 1 , 2 , 3 ]
4633+ ] ;
4634+ kernel . build . apply ( kernel , args ) ;
4635+ kernel . run . apply ( kernel , args ) ;
4636+ const result = kernel . renderOutput ( ) ;
4637+ kernel . destroy ( true ) ;
4638+ return Math . round ( result [ 0 ] ) === 0 && Math . round ( result [ 1 ] ) === 1 && Math . round ( result [ 2 ] ) === 2 && Math . round ( result [ 3 ] ) === 3 ;
4639+ }
4640+
46184641 static get testCanvas ( ) {
46194642 throw new Error ( `"testCanvas" not defined on ${ this . name } ` ) ;
46204643 }
@@ -4629,6 +4652,7 @@ class GLKernel extends Kernel {
46294652 return Object . freeze ( {
46304653 isFloatRead : this . getIsFloatRead ( ) ,
46314654 isIntegerDivisionAccurate : this . getIsIntegerDivisionAccurate ( ) ,
4655+ isSpeedTacticSupported : this . getIsSpeedTacticSupported ( ) ,
46324656 isTextureFloat : this . getIsTextureFloat ( ) ,
46334657 isDrawBuffers,
46344658 kernelMap : isDrawBuffers ,
@@ -5371,6 +5395,7 @@ class GLKernel extends Kernel {
53715395 }
53725396 getVariablePrecisionString ( textureSize = this . texSize , tactic = this . tactic , isInt = false ) {
53735397 if ( ! tactic ) {
5398+ if ( ! this . constructor . features . isSpeedTacticSupported ) return 'highp' ;
53745399 const low = this . constructor . features [ isInt ? 'lowIntPrecision' : 'lowFloatPrecision' ] ;
53755400 const medium = this . constructor . features [ isInt ? 'mediumIntPrecision' : 'mediumFloatPrecision' ] ;
53765401 const high = this . constructor . features [ isInt ? 'highIntPrecision' : 'highFloatPrecision' ] ;
@@ -12749,6 +12774,7 @@ class WebGL2Kernel extends WebGLKernel {
1274912774 return Object . freeze ( {
1275012775 isFloatRead : this . getIsFloatRead ( ) ,
1275112776 isIntegerDivisionAccurate : this . getIsIntegerDivisionAccurate ( ) ,
12777+ isSpeedTacticSupported : this . getIsSpeedTacticSupported ( ) ,
1275212778 kernelMap : true ,
1275312779 isTextureFloat : true ,
1275412780 isDrawBuffers : true ,
@@ -12767,10 +12793,6 @@ class WebGL2Kernel extends WebGLKernel {
1276712793 return true ;
1276812794 }
1276912795
12770- static getIsIntegerDivisionAccurate ( ) {
12771- return super . getIsIntegerDivisionAccurate ( ) ;
12772- }
12773-
1277412796 static getChannelCount ( ) {
1277512797 return testContext . getParameter ( testContext . MAX_DRAW_BUFFERS ) ;
1277612798 }
0 commit comments