| 691 | |
| 692 | template <typename ShaderStructType, typename HostStructType> |
| 693 | Uint8* 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 | |
| 710 | void* GLTF_PBR_Renderer::WritePBRPrimitiveShaderAttribs(void* pDstShaderAttribs, |
nothing calls this directly
no outgoing calls
no test coverage detected