MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / WriteShaderAttribs

Function WriteShaderAttribs

PBR/src/GLTF_PBR_Renderer.cpp:693–707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691
692template <typename ShaderStructType, typename HostStructType>
693Uint8* WriteShaderAttribs(Uint8* pDstPtr, HostStructType* pSrc, const char* DebugName)
694{
695 static_assert(sizeof(ShaderStructType) == sizeof(HostStructType), "Size of HLSL and C++ structures must be the same");
696 if (pSrc != nullptr)
697 {
698 memcpy(pDstPtr, pSrc, sizeof(ShaderStructType));
699 }
700 else
701 {
702 UNEXPECTED("Shader attribute ", DebugName, " is not initialized in the material");
703 memset(pDstPtr, 0, sizeof(ShaderStructType));
704 }
705 static_assert(sizeof(ShaderStructType) % 16 == 0, "Size structure must be a multiple of 16");
706 return pDstPtr + sizeof(ShaderStructType);
707}
708
709
710void* GLTF_PBR_Renderer::WritePBRPrimitiveShaderAttribs(void* pDstShaderAttribs,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected