Skip to content

Opengl location automapping#1777

Closed
pRuoyu wants to merge 11 commits intoKhronosGroup:masterfrom
pRuoyu:opengl-location-automapping
Closed

Opengl location automapping#1777
pRuoyu wants to merge 11 commits intoKhronosGroup:masterfrom
pRuoyu:opengl-location-automapping

Conversation

@pRuoyu
Copy link
Copy Markdown
Contributor

@pRuoyu pRuoyu commented May 29, 2019

This change for OpenGL shader in/out symbol and uniform symbol location Auto mapping. [issue]#1747

1. Background.

In OpenGL shader, user are not required to declare location explicit. so we need do a auto slot allocate in mapIO.
In old implementation, when declare a implicit location symbol, resolver will only make a location self grow, and it will be reset at add stage. That makes it‘s difficult for us to refer to the declare of in/out between two shader stage and refer to the uniform in other shader stage.

relative issue : GLSL vertex attribute overlap

2. New Implementation.

To reduce the complexity of new code and reduce the impact on OpenGL ES and Vulcan shader compiler.
We base the code on TDefaultIoResolverBaseand and TIoMapper, and derived TDefaultGlslIoResolver, TGlslIoMapper to detach logic.
In new Implementation, we move the resolver to then end of mapIO in function doMap, and add two new step —— slot collect(TSlotCollector) and symbol validater(TSymbolValidater). At slot collect we collect symbol info and compute the free slot. At symbol validater, we check symbol type is matched. after that all, wo do resolver and set traverser.

3. Test.

This code can pass the glslangtests both on windows and linux.

4. Subsequent

Now, the test of OpenGL shader in/out mapper is missing, need add more test in glslangtest. I want it can be a option on glslangValidor. if it's possiable, we will do this two task next.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 29, 2019

CLA assistant check
All committers have signed the CLA.

@pRuoyu pRuoyu closed this May 29, 2019
@pRuoyu pRuoyu reopened this May 29, 2019
@pRuoyu pRuoyu closed this May 29, 2019
@pRuoyu pRuoyu reopened this May 29, 2019
@pRuoyu pRuoyu closed this May 29, 2019
@pRuoyu pRuoyu reopened this May 29, 2019
@pRuoyu pRuoyu closed this May 29, 2019
St0fF-NPL-ToM pushed a commit to St0fF-NPL-ToM/glslang that referenced this pull request Jul 22, 2019
Includes:

    Update OpPhi instructions after splitting block. (KhronosGroup#1783)
    Don't change decorations and names in merge return. (KhronosGroup#1777)
    Transform to combine consecutive access chains
    Handle undef literal value in vector shuffle
    Fix block ordering in dead branch elim
    Fix finding constant with particular type. (KhronosGroup#1724)
    Fix infinite loop while folding OpVectorShuffle (KhronosGroup#1722)
    Fix size error when folding vector shuffle. (KhronosGroup#1721)
    Layout validation: Permit {vec3; float} tight packing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants