MCPcopy Create free account
hub / github.com/carbonengine/trinity / ReadPipelineInputs

Function ReadPipelineInputs

trinity/Shader/Tr2EffectDescription.cpp:234–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void ReadPipelineInputs( std::vector<Tr2ShaderPipelineInputAL>& pipelineInputs, EffectStream& stream, unsigned version )
235{
236 uint8_t inputCount = SanityCheck( stream.Read<uint8_t>(), 64 );
237 pipelineInputs.resize( inputCount );
238 for( int inputIx = 0; inputIx < inputCount; ++inputIx )
239 {
240 auto& element = pipelineInputs[inputIx];
241 element.usage = Tr2VertexDefinition::UsageCode( stream.Read<uint8_t>() );
242 element.registerIndex = stream.Read<uint8_t>();
243 element.usageIndex = stream.Read<uint8_t>();
244 element.usedMask = stream.Read<uint8_t>();
245 if( version > 10 )
246 {
247 element.type = Tr2ShaderPipelineInputAL::Type( stream.Read<uint8_t>() );
248 element.dimension = stream.Read<uint8_t>();
249 }
250 else
251 {
252 element.type = element.usage == Tr2VertexDefinition::BLENDINDICES ? Tr2ShaderPipelineInputAL::UINT : Tr2ShaderPipelineInputAL::FLOAT;
253 element.dimension = 4;
254 }
255 }
256}
257// CHECK
258void ReadRegisters( Tr2ShaderSignatureAL& signature, EffectStream& stream, unsigned version, uint32_t type )
259{

Callers 1

ReadMethod · 0.85

Calls 3

SanityCheckFunction · 0.85
TypeEnum · 0.70
UsageCodeEnum · 0.50

Tested by

no test coverage detected