Flatten uniform arrays
This checkin adds a --flatten-uniform-arrays option which can break uniform arrays of samplers, textures, or UBOs up into individual scalars named (e.g) myarray[0], myarray[1], etc. These appear as individual linkage objects. Code notes: - shouldFlatten internally calls shouldFlattenIO, and shouldFlattenUniform, but is the only flattening query directly called. - flattenVariable will handle structs or arrays (but not yet arrayed structs; this is tested an an error is generated). - There's some error checking around unhandled situations. E.g, flattening uniform arrays with initializer lists is not implemented. - This piggybacks on as much of the existing mechanism for struct flattening as it can. E.g, it uses the same flattenMap, and the same flattenAccess() method. - handleAssign() has been generalized to cope with either structs or arrays. - Extended test infrastructure to test flattening ability.
Showing
- StandAlone/StandAlone.cpp 13 additions, 0 deletionsStandAlone/StandAlone.cpp
- Test/baseResults/hlsl.array.flatten.frag.out 588 additions, 0 deletionsTest/baseResults/hlsl.array.flatten.frag.out
- Test/hlsl.array.flatten.frag 38 additions, 0 deletionsTest/hlsl.array.flatten.frag
- glslang/MachineIndependent/Intermediate.cpp 5 additions, 0 deletionsglslang/MachineIndependent/Intermediate.cpp
- glslang/MachineIndependent/ShaderLang.cpp 2 additions, 0 deletionsglslang/MachineIndependent/ShaderLang.cpp
- glslang/MachineIndependent/localintermediate.h 5 additions, 1 deletionglslang/MachineIndependent/localintermediate.h
- glslang/Public/ShaderLang.h 1 addition, 0 deletionsglslang/Public/ShaderLang.h
- gtests/Hlsl.FromFile.cpp 18 additions, 0 deletionsgtests/Hlsl.FromFile.cpp
- gtests/TestFixture.h 30 additions, 1 deletiongtests/TestFixture.h
- hlsl/hlslParseHelper.cpp 160 additions, 38 deletionshlsl/hlslParseHelper.cpp
- hlsl/hlslParseHelper.h 9 additions, 3 deletionshlsl/hlslParseHelper.h
Loading
Please register or sign in to comment