MCPcopy Create free account
hub / github.com/Unity-Technologies/HLSLcc / PruneConstArrays

Method PruneConstArrays

src/Shader.cpp:591–734  ·  view source on GitHub ↗

In DX bytecode, all const arrays are vec4's, and all arrays are stuffed to one large array. Luckily, each chunk is always accessed with suboperand plus (in ui32RegisterNumber) So do an analysis pass. Also trim the vec4's into smaller formats if the extra components are never read.

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

TranslateMethod · 0.80

Calls 3

ForEachOperandFunction · 0.85
ConstantArrayChunkClass · 0.85
GetAccessMaskMethod · 0.80

Tested by

no test coverage detected