MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ProcessMaterial

Function ProcessMaterial

Source/Editor/Cooker/Steps/CookAssetsStep.cpp:597–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597bool ProcessMaterial(CookAssetsStep::AssetCookData& data)
598{
599 auto asset = static_cast<Material*>(data.Asset);
600
601 // Material is loaded so it has valid source code generated from the Visject Surface.
602 // Material::load performs any required upgrading and conversions.
603
604 // Load material params and source code
605 if (asset->LoadChunks(GET_CHUNK_FLAG(SHADER_FILE_CHUNK_MATERIAL_PARAMS) | GET_CHUNK_FLAG(SHADER_FILE_CHUNK_SOURCE)))
606 return true;
607
608 // Copy material params data
609 const auto paramsChunk = asset->GetChunk(SHADER_FILE_CHUNK_MATERIAL_PARAMS);
610 if (paramsChunk)
611 data.InitData.Header.Chunks[SHADER_FILE_CHUNK_MATERIAL_PARAMS] = paramsChunk->Clone();
612
613 // Compile shader for the target platform rendering devices
614 return ProcessShaderBase(data, asset);
615}
616
617bool ProcessShader(CookAssetsStep::AssetCookData& data)
618{

Callers

nothing calls this directly

Calls 3

ProcessShaderBaseFunction · 0.85
LoadChunksMethod · 0.80
CloneMethod · 0.45

Tested by

no test coverage detected