Bug 131235 - Keep track of filtered active attribute/uniform indices per shader program
Summary: Keep track of filtered active attribute/uniform indices per shader program
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 130477 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-04-04 11:31 PDT by Roger Fong
Modified: 2014-04-04 15:10 PDT (History)
9 users (show)

See Also:


Attachments
patch (8.95 KB, patch)
2014-04-04 12:13 PDT, Roger Fong
no flags Details | Formatted Diff | Diff
patch (8.99 KB, patch)
2014-04-04 14:45 PDT, Roger Fong
dino: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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