1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef SHADERS__COMMON__MORPHTARGET_STRUCTURES_COMMON_H 17 #define SHADERS__COMMON__MORPHTARGET_STRUCTURES_COMMON_H 18 19 #include "render/shaders/common/render_compatibility_common.h" 20 21 #define CORE_MORPH_USE_PACKED_NOR_TAN 22 #define CORE_MORPH_USE_16BIT_NOR_TAN 23 24 struct MorphTargetInfoStruct { 25 uvec4 target; // contains 4 targets. 26 vec4 weight; // contains 4 weights. 27 }; 28 29 struct MorphInputData { 30 vec4 pos; 31 #if defined(CORE_MORPH_USE_PACKED_NOR_TAN) 32 uvec4 nortan; 33 #else 34 vec4 nor; 35 vec4 tan; 36 #endif 37 }; 38 39 struct MorphObjectPushConstantStruct { 40 uint morphSet; // Index to morphDataStruct.data. start of id / weight information for submesh. 41 uint vertexCount; // Number of vertices in submesh 42 uint morphTargetCount; // Total count of targets in targetBuffer. 43 uint activeTargets; // Active targets (count of data in morphDataStruct.data) 44 }; 45 #endif 46