Bug 131235

Summary: Keep track of filtered active attribute/uniform indices per shader program
Product: WebKit Reporter: Roger Fong <roger_fong>
Component: WebGLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, dino, esprehn+autocc, gyuyoung.kim, kondapallykalyan, noam, roger_fong, tonikitoo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch dino: review+

Description Roger Fong 2014-04-04 11:31:46 PDT
There are a few important methods to be considered here.

getUniformLocation
getActiveAttrib
getActiveUniform
getProgramParameter (where you query the number of active uniforms or attributes)

These methods should only take into consideration the list of filtered attributes and uniforms per shader program.

The logic to filter these attributes and uniforms exists, but we need to move it to the right place.
Comment 1 Roger Fong 2014-04-04 11:35:52 PDT
<rdar://problem/16371751>
Comment 2 Roger Fong 2014-04-04 12:13:43 PDT
Created attachment 228613 [details]
patch
Comment 3 Brent Fulgham 2014-04-04 13:18:27 PDT
Comment on attachment 228613 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=228613&action=review

Looks good. I think it could be more efficient if we could avoid the double 'find' operation in cases where it is found the first time.

> Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:726
> +    const auto& result = m_shaderProgramSymbolCountMap.find(program);

Aren't we performing the 'find' twice every time? Maybe this could precede the test for end, and only do the lookup once.

> Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:772
> +    const auto& result = m_shaderProgramSymbolCountMap.find(program);

Ditto regarding double-lookup.
Comment 4 Roger Fong 2014-04-04 14:31:08 PDT
*** Bug 130477 has been marked as a duplicate of this bug. ***
Comment 5 Roger Fong 2014-04-04 14:45:41 PDT
Created attachment 228617 [details]
patch
Comment 6 Roger Fong 2014-04-04 15:10:02 PDT
http://trac.webkit.org/changeset/166803