[Webkit-unassigned] [Bug 118409] New: Non-power-of-two texture handle optimization

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 5 02:03:09 PDT 2013


           Summary: Non-power-of-two texture handle optimization
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebGL
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: p.szymanski3 at samsung.com

WebKit sets a black texture (with color: 0,0,0,255) instead of a regular texture if some texture parameters are invalid.
It has to be done because drivers sets the black texture with color 0,0,0,0 and OpenGL ES specification requires 0,0,0,1 (in float) as invalid texture.
But method to handle this case is named as handleNPOTTTextures which in my opinion is wrong. This method handles not only invalid non-power-of-two
textures but also power-of-two with invalid texture parameters. So I propose to change its name to handleInvalidTextures.

Additionally in WebGLRenderingContext there is a variable m_isNPOTStrict that is a negation of OpenGL NPOT extension existing. 
Usage of this variable in my opinion is not easy to understand. I propose to change its name to m_isNPOTTSupport which means
that OpenGL supports NPOT extension and usage of this variable should be more clear then.

And the last one is a little optimization. On modern hardware with OpenGL 4 there can be up to 160 texture units supported. 
handleNPOTTextures is called two times for each draw call (first call sets a black texture and second call sets a regular texture) for each texture unit (so up to 160x2 iterations!)
and checks some conditions. For a number of drawcalls it can cause some performance loss. 
In a perfect case there should be no invalid textures in WebGL application so method handleNPOTTextures should set no
black textures. It is not need to do any additionally iterations if there was not any black texture set.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list