I have an HTML5 2D engine ( www.scirra.com ) and really want to determine if WebGL will render the software renderer with Chrome 18 'Swiftshader'. If so, we would prefer to return to the normal 2D canvas context, as is the case in other browsers. A lot of people have low-performance machines with weak processors that turn the game into a slide show when rendering programs, and I think that in many cases a 2D canvas would be hardware acceleration. However, WebGL context creation is never interrupted in Chrome, and there is no obvious way to detect SwiftShader.
Things I tried:
// Always returns "WebKit WebGL" regardless of SwiftShader
gl.getParameter(gl.RENDERER)
// Always returns "WebKit" regardless of SwiftShader
gl.getParameter(gl.VENDOR)
I could try to take into account things like the maximum texture size or other MAX_ * properties, but how do I know that they do not change between machines even with SwiftShader? And since I assume that SwiftShader aims to simulate common hardware, using this approach can still get a lot of false positives.
I do not want to write a performance test at startup because:
- we just create an engine, not a specific game, so I donβt know how we will write an honest test that works in the general case for any game of any performance profile with a high degree of accuracy.
- A good test will probably take a second or two to finish the job, which can interrupt the userβs work or make them watch some squares move around or something like
- , , , , ?
, WebGL Chrome, WebGL , 2D! , .
, ? , , , . " , - ". , , , ", , " 2D "..."
- gl.getSupportedExtensions(). , SwiftShader :
OES_texture_float,OES_standard_derivatives,WEBKIT_WEBGL_lose_context
... :
OES_texture_float,OES_standard_derivatives,WEBKIT_WEBGL_lose_context,WEBKIT_WEBGL_compressed_textures
WEBKIT_WEBGL_compressed_textures. , . . - GL_EXT_texture_compression_s3tc GL_ARB_texture_compression . , , -, , , WEBKIT_WEBGL_compressed_textures... SwiftShader :
- Windows
- Google Chrome
- WebGL
WEBKIT_WEBGL_compressed_textures - : Canvas 2D
, SwiftShader , . ! , , , WEBKIT_WEBGL_compressed_textures!
SwiftShader?