1 /* 2 * Copyright (C) 2023 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_MAX_MORPH_TARGET_COUNT (256) 22 #define CORE_MORPH_USE_PACKED_NOR_TAN 23 #define CORE_MORPH_USE_16BIT_NOR_TAN 24 25 struct MorphTargetInfoStruct { 26 uvec4 target; // contains 4 targets. 27 vec4 weight; // contains 4 weights. 28 }; 29 30 struct MorphInputData { 31 vec4 pos; 32 #if defined(CORE_MORPH_USE_PACKED_NOR_TAN) 33 uvec4 nortan; 34 #else 35 vec4 nor; 36 vec4 tan; 37 #endif 38 }; 39 40 struct MorphObjectPushConstantStruct { 41 uint morphSet; // Index to morphDataStruct.data. start of id / weight information for submesh. 42 uint vertexCount; // Number of vertices in submesh 43 uint morphTargetCount; // Total count of targets in targetBuffer. 44 uint activeTargets; // Active targets (count of data in morphDataStruct.data) 45 }; 46 #endif 47