diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/module/iofx | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/module/iofx')
121 files changed, 38832 insertions, 0 deletions
diff --git a/APEX_1.4/module/iofx/cuda/include/actorRanges.h b/APEX_1.4/module/iofx/cuda/include/actorRanges.h new file mode 100644 index 00000000..57271da6 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/actorRanges.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_BOUND_KERNEL(ACTOR_RANGE_KERNEL_CONFIG, actorRangeKernel, + ((const unsigned int*, sortedActorID))((unsigned int, maxActorID)) + ((unsigned int*, actorStart))((unsigned int*, actorEnd))((unsigned int*, actorVisibleEnd)) + ((const uint32_t*, sortedStateID)) + ) diff --git a/APEX_1.4/module/iofx/cuda/include/bbox.h b/APEX_1.4/module/iofx/cuda/include/bbox.h new file mode 100644 index 00000000..e58df0d6 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/bbox.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_TEXTURE_1D(texRefBBoxPositions, float4) + +APEX_CUDA_SYNC_KERNEL(BBOX_KERNEL_CONFIG, bboxSyncKernel, ((unsigned int, count)) + ((unsigned int*, g_actorID)) + ((unsigned int*, stateToInput)) + ((const float4*, g_positionMass)) + ((float4*, g_outMinBounds))((float4*, g_outMaxBounds)) + ((unsigned int*, g_tmpActorID)) + ((float4*, g_tmpMinBounds))((float4*, g_tmpMaxBounds)) + ) + +APEX_CUDA_BOUND_KERNEL(BBOX_KERNEL_CONFIG, bboxKernel, + ((unsigned int*, g_actorID)) + ((unsigned int*, stateToInput)) + ((const float4*, g_positionMass)) + ((float4*, g_outMinBounds))((float4*, g_outMaxBounds)) + ((unsigned int*, g_tmpActorID)) + ((float4*, g_tmpMinBounds))((float4*, g_tmpMaxBounds)) + ((unsigned int, phase))((unsigned int, gridSize)) + ) diff --git a/APEX_1.4/module/iofx/cuda/include/common.h b/APEX_1.4/module/iofx/cuda/include/common.h new file mode 100644 index 00000000..6e7d6a8d --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/common.h @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __COMMON_H__ +#define __COMMON_H__ + +#define APEX_CUDA_MODULE_PREFIX IOFX_ + +#include "ApexCuda.h" +#include "InplaceTypes.h" +#include "IofxManagerIntl.h" +#include "PxBounds3.h" +#include <float.h> + +#if PX_WINDOWS_FAMILY +#pragma warning(push) +#pragma warning(disable:4201) +#pragma warning(disable:4408) +#endif + +#include <vector_types.h> + +#if PX_WINDOWS_FAMILY +#pragma warning(pop) +#endif + +/* Reduce functions assume warps per block <= 32 !! */ + + +#define ACTOR_RANGE_KERNEL_CONFIG (2, WARP_SIZE * 2) + +const unsigned int BBOX_BLOCK_BOUNDS_PAD = 1; +const unsigned int BBOX_WARP_BOUNDS_PAD = 1; +#define BBOX_KERNEL_CONFIG (BBOX_BLOCK_BOUNDS_PAD * 6, WARP_SIZE * 7, 0, 1, WARP_SIZE) + +const unsigned int SPRITE_MAX_DWORDS_PER_OUTPUT = 18; +const unsigned int MESH_MAX_DWORDS_PER_OUTPUT = 22; + +#define SPRITE_TEXTURE_MODIFIER_KERNEL_CONFIG (0, WARP_SIZE * 4) + +const unsigned int RADIX_SORT_NBITS = 4; + +#define SORT_KERNEL_CONFIG (0, WARP_SIZE * 2) + +//+1 here is to avoid shared memory bank conflicts +const unsigned int NEW_SORT_WARP_STRIDE_PAD = 1; +const unsigned int NEW_SORT_KEY_DIGITS = (1U << RADIX_SORT_NBITS); +const unsigned int NEW_SORT_VECTOR_SIZE = 4; + +/* step 1: (NEW_SORT_KEY_DIGITS * NEW_SORT_WARP_STRIDE_PAD, WARP_SIZE * 2 + NEW_SORT_KEY_DIGITS) */ +/* step 2: (0, WARP_SIZE * 2) +/* step 3 & block: (1 + NEW_SORT_KEY_DIGITS * NEW_SORT_WARP_STRIDE_PAD, WARP_SIZE * 2 + WARP_SIZE * NEW_SORT_VECTOR_SIZE * 2 + NEW_SORT_KEY_DIGITS) */ +#define NEW_SORT_KERNEL_CONFIG (1 + NEW_SORT_KEY_DIGITS * NEW_SORT_WARP_STRIDE_PAD, WARP_SIZE * 2 + WARP_SIZE * NEW_SORT_VECTOR_SIZE * 2 + NEW_SORT_KEY_DIGITS, 0, (NEW_SORT_KEY_DIGITS * MAX_BOUND_BLOCKS / 4) / WARP_SIZE) + + +const unsigned int STATE_ID_MASK = 0x7FFFFFFFu; +const unsigned int STATE_ID_DIST_SIGN = 0x80000000u; + + +namespace nvidia +{ +namespace iofx +{ + +#ifdef __CUDACC__ + +APEX_CUDA_CALLABLE PX_INLINE IofxSlice uint4_to_IofxSlice(uint4 v) +{ + IofxSlice ret; + ret.x = v.x; + ret.y = v.y; + ret.z = v.z; + ret.w = v.w; + return ret; +} + +APEX_CUDA_CALLABLE PX_INLINE uint4 IofxSlice_to_uint4(IofxSlice s) +{ + return make_uint4(s.x, s.y, s.z, s.w); +} +#endif + + +//struct VolumeParams +#define INPLACE_TYPE_STRUCT_NAME VolumeParams +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(PxBounds3, bounds) \ + INPLACE_TYPE_FIELD(uint32_t, priority) +#include INPLACE_TYPE_BUILD() + +typedef InplaceArray<VolumeParams> VolumeParamsArray; +typedef InplaceArray<uint32_t> ActorClassIDBitmapArray; + +typedef InplaceArray<uint32_t> ActorIDRemapArray; + +//struct ModifierListElem +#define INPLACE_TYPE_STRUCT_NAME ModifierListElem +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, type) \ + INPLACE_TYPE_FIELD(InplaceHandleBase, paramsHandle) +#include INPLACE_TYPE_BUILD() + +typedef InplaceArray<ModifierListElem> ModifierList; + +//struct AssetParams +#define INPLACE_TYPE_STRUCT_NAME AssetParams +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(ModifierList, spawnModifierList) \ + INPLACE_TYPE_FIELD(ModifierList, continuousModifierList) +#include INPLACE_TYPE_BUILD() + +//struct ClientParams +#define INPLACE_TYPE_STRUCT_NAME ClientParams +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, objectScale) \ + INPLACE_TYPE_FIELD(InplaceHandle<AssetParams>, assetParamsHandle) +#include INPLACE_TYPE_BUILD() + +typedef InplaceArray< InplaceHandle<ClientParams> > ClientParamsHandleArray; + +struct SpritePrivateState; + +struct SpritePrivateStateArgs +{ + IofxSlice* g_state[1]; + +#ifdef __CUDACC__ + static __device__ void read(const SpritePrivateStateArgs& args, SpritePrivateState& state, unsigned int pos); + static __device__ void write(SpritePrivateStateArgs& args, const SpritePrivateState& state, unsigned int pos); +#endif +}; + +struct MeshPrivateState; + +struct MeshPrivateStateArgs +{ + IofxSlice* g_state[3]; + +#ifdef __CUDACC__ + static __device__ void read(const MeshPrivateStateArgs& args, MeshPrivateState& state, unsigned int pos); + static __device__ void write(MeshPrivateStateArgs& args, const MeshPrivateState& state, unsigned int pos); +#endif +}; + +} +} // namespace nvidia + +#endif diff --git a/APEX_1.4/module/iofx/cuda/include/migration.h b/APEX_1.4/module/iofx/cuda/include/migration.h new file mode 100644 index 00000000..3204d79d --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/migration.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_STORAGE(migrationStorage) + + +APEX_CUDA_BOUND_KERNEL((), volumeMigrationKernel, + ((InplaceHandle<VolumeParamsArray>, volumeParamsArrayHandle)) + ((InplaceHandle<ActorClassIDBitmapArray>, actorClassIDBitmapArrayHandle)) + ((uint32_t, numActorClasses))((uint32_t, numVolumes))((uint32_t, numActorIDValues)) + ((IofxActorIDIntl*, actorID))((uint32_t, maxInputID)) + ((const float4*, positionMass)) + ((uint32_t*, actorStart))((uint32_t*, actorEnd))((uint32_t*, actorVisibleEnd)) + ) diff --git a/APEX_1.4/module/iofx/cuda/include/modifier.h b/APEX_1.4/module/iofx/cuda/include/modifier.h new file mode 100644 index 00000000..fc0127e8 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/modifier.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_STORAGE_SIZE(modifierStorage, MAX_CONST_MEM_SIZE - 32) + + +APEX_CUDA_TEXTURE_1D(texRefPositionMass, float4) +APEX_CUDA_TEXTURE_1D(texRefVelocityLife, float4) +APEX_CUDA_TEXTURE_1D(texRefCollisionNormalFlags, float4) +APEX_CUDA_TEXTURE_1D(texRefDensity, float) +APEX_CUDA_TEXTURE_1D(texRefActorIDs, unsigned int) +APEX_CUDA_TEXTURE_1D(texRefUserData, unsigned int) + +APEX_CUDA_TEXTURE_1D(texRefSpritePrivState0, uint4) + +APEX_CUDA_TEXTURE_1D(texRefMeshPrivState0, uint4) +APEX_CUDA_TEXTURE_1D(texRefMeshPrivState1, uint4) +APEX_CUDA_TEXTURE_1D(texRefMeshPrivState2, uint4) + +APEX_CUDA_TEXTURE_1D(texRefInStateToInput, unsigned int) +APEX_CUDA_TEXTURE_1D(texRefStateSpawnSeed, unsigned int) +APEX_CUDA_TEXTURE_1D(texRefStateSpawnScale, float) + +APEX_CUDA_TEXTURE_2D(texRefCurveSamples, float) + +#ifndef SKIP_OUTPUT_SURFACES_DEF +APEX_CUDA_SURFACE_2D(surfRefOutput0) +APEX_CUDA_SURFACE_2D(surfRefOutput1) +APEX_CUDA_SURFACE_2D(surfRefOutput2) +APEX_CUDA_SURFACE_2D(surfRefOutput3) +#else +#undef SKIP_OUTPUT_SURFACES_DEF +#endif + +APEX_CUDA_BOUND_KERNEL((), spriteModifiersKernel, + ((unsigned int, inStateOffset))((unsigned int, outStateOffset)) + ((InplaceHandle<ClientParamsHandleArray>, clientParamsHandleArrayHandle)) + ((ModifierCommonParams, commonParams)) + ((unsigned int*, g_sortedActorIDs))((unsigned int*, g_sortedStateIDs))((unsigned int*, g_outStateToInput)) + ((SpritePrivateStateArgs, privStateArgs))((float*, g_stateSpawnScale)) + ((PRNGInfo, rand))((unsigned int*, g_outputBuffer)) + ((InplaceHandle<SpriteOutputLayout>, outputLayoutHandle)) + ) + +APEX_CUDA_BOUND_KERNEL(SPRITE_TEXTURE_MODIFIER_KERNEL_CONFIG, spriteTextureModifiersKernel, + ((unsigned int, inStateOffset))((unsigned int, outStateOffset)) + ((InplaceHandle<ClientParamsHandleArray>, clientParamsHandleArrayHandle)) + ((ModifierCommonParams, commonParams)) + ((unsigned int*, g_sortedActorIDs))((unsigned int*, g_sortedStateIDs))((unsigned int*, g_outStateToInput)) + ((SpritePrivateStateArgs, privStateArgs))((float*, g_stateSpawnScale)) + ((PRNGInfo, rand))((SpriteTextureOutputLayout, outputLayout)) + ) + +APEX_CUDA_BOUND_KERNEL((), meshModifiersKernel, + ((unsigned int, inStateOffset))((unsigned int, outStateOffset)) + ((InplaceHandle<ClientParamsHandleArray>, clientParamsHandleArrayHandle)) + ((ModifierCommonParams, commonParams)) + ((unsigned int*, g_sortedActorIDs))((unsigned int*, g_sortedStateIDs))((unsigned int*, g_outStateToInput)) + ((MeshPrivateStateArgs, privStateArgs))((float*, g_stateSpawnScale)) + ((PRNGInfo, rand))((unsigned int*, g_outputBuffer)) + ((InplaceHandle<MeshOutputLayout>, outputLayoutHandle)) + ) diff --git a/APEX_1.4/module/iofx/cuda/include/moduleList.h b/APEX_1.4/module/iofx/cuda/include/moduleList.h new file mode 100644 index 00000000..2bcceed1 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/moduleList.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "actorRanges.h" +#include "bbox.h" +#include "migration.h" +#include "modifier.h" +#include "remap.h" +#include "sort.h" +#include "sortNew.h" diff --git a/APEX_1.4/module/iofx/cuda/include/remap.h b/APEX_1.4/module/iofx/cuda/include/remap.h new file mode 100644 index 00000000..d57fb441 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/remap.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_STORAGE(remapStorage) + + +APEX_CUDA_TEXTURE_1D(texRefRemapPositions, float4) +APEX_CUDA_TEXTURE_1D(texRefRemapActorIDs, unsigned int) +APEX_CUDA_TEXTURE_1D(texRefRemapInStateToInput, unsigned int) + + +APEX_CUDA_BOUND_KERNEL((), makeSortKeys, + ((const uint32_t*, inStateToInput))((uint32_t, maxInputID)) + ((uint32_t, numActorsPerVolume))((uint32_t, numActorIDs)) + ((InplaceHandle<ActorIDRemapArray>, actorIDRemapArrayHandle)) + ((const float4*, positionMass))((bool, outputDensityKeys)) + ((PxVec3, eyePos))((PxVec3, eyeDir))((float, zNear)) + ((uint32_t*, sortKey))((uint32_t*, sortValue)) + ) + +APEX_CUDA_BOUND_KERNEL((), remapKernel, + ((const uint32_t*, inStateToInput))((uint32_t, maxInputID)) + ((uint32_t, numActorsPerVolume))((uint32_t, numActorIDs)) + ((InplaceHandle<ActorIDRemapArray>, actorIDRemapArrayHandle)) + ((const unsigned int*, inSortedValue))((unsigned int*, outSortKey)) + ) diff --git a/APEX_1.4/module/iofx/cuda/include/sort.h b/APEX_1.4/module/iofx/cuda/include/sort.h new file mode 100644 index 00000000..283e2884 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/sort.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_SYNC_KERNEL(SORT_KERNEL_CONFIG, radixSortSyncKernel, ((unsigned int, numElements)) + ((unsigned int*, keys))((unsigned int*, values)) + ((unsigned int*, tempKeys))((unsigned int*, tempValues)) + ((unsigned int*, g_temp))((unsigned int, keyBits))((unsigned int, startbit)) + ) + +APEX_CUDA_BOUND_KERNEL(SORT_KERNEL_CONFIG, radixSortStepKernel, + ((unsigned int*, keys))((unsigned int*, values)) + ((unsigned int*, tempKeys))((unsigned int*, tempValues)) + ((unsigned int*, g_temp))((unsigned int, startbit)) + ((unsigned int, phase))((unsigned int, gridSize)) + ) diff --git a/APEX_1.4/module/iofx/cuda/include/sortNew.h b/APEX_1.4/module/iofx/cuda/include/sortNew.h new file mode 100644 index 00000000..70c56315 --- /dev/null +++ b/APEX_1.4/module/iofx/cuda/include/sortNew.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +APEX_CUDA_BOUND_KERNEL(NEW_SORT_KERNEL_CONFIG, newRadixSortBlockKernel, + ((unsigned int, count))((unsigned int, bitCount))((unsigned int, startBit)) + ((unsigned int*, inpKeys))((unsigned int*, inpValues)) + ) + +APEX_CUDA_BOUND_KERNEL(NEW_SORT_KERNEL_CONFIG, newRadixSortStepKernel, + ((unsigned int, count))((unsigned int, startBit)) + ((unsigned int*, inpKeys))((unsigned int*, inpValues)) + ((unsigned int*, outKeys))((unsigned int*, outValues)) + ((unsigned int*, tempScan)) + ((unsigned int, phase))((unsigned int, gridSize)) + ) diff --git a/APEX_1.4/module/iofx/include/ARLSort.h b/APEX_1.4/module/iofx/include/ARLSort.h new file mode 100644 index 00000000..265fe1b2 --- /dev/null +++ b/APEX_1.4/module/iofx/include/ARLSort.h @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __ARL_SORT_H__ +#define __ARL_SORT_H__ + +namespace nvidia +{ +namespace iofx +{ + +template <typename TKey, typename TValue> +class ARLSort +{ + static const int MAX_NUM_BIT = 8; // largest bit num in sorting digit(might bast be tuned between 6 and 12) + static const int MIN_NUM_BIT = 4; + static const int INSERT_MAX = 64; // any value below this, use Insertion sort + +public: + + static void sort(TKey* keys, TValue* values, int numElems) + { + if (numElems >= INSERT_MAX) + { + TKey max = keys[0]; + for (int i = 1; i < numElems; ++i) + { + TKey key = keys[i]; + if (key > max) + { + max = key; + } + } + if (max > 0) + { + max >>= 1; + int leftBitNo = 0; + // find highest bit set + while (max > 0) + { + max >>= 1; + leftBitNo++; + } + sortARLwithBorders(keys, values, 0, numElems - 1, leftBitNo); + } + } + else + { + insertSort(keys, values, 0, numElems - 1); + } + } + + +private: + static void insertSort(TKey* keys, TValue* values, int left, int right) + { + for (int k = left; k < right; ++k) + { + if (keys[k] > keys[k + 1]) + { + TKey tmpKey = keys[k + 1]; + TValue tmpValue = values[k + 1]; + int i = k; + do + { + keys[i + 1] = keys[i]; + values[i + 1] = values[i]; + --i; + } + while (i >= left && keys[i] > tmpKey); + keys[i + 1] = tmpKey; + values[i + 1] = tmpValue; + } + } + } + + /** + * ARL sort with border array, The 2002 version Adaptive Left Radix with Insert-sort as a subalgorithm. + * Sorts positive integers from a[start] 'up to and including' a[end] + * on bits: leftBitNo, leftBitNo-1,..,leftBitNo -numBit+1 (31..0) + * Uses only internal moves by shifting along permutation cycles <br> + * UNSTABLE + * + * @Author: Arne Maus, Dept.of Informatics,Univ. of Oslo, 2002-2009 + Copyright (c) 2000,2009, Arne Maus, Dept. of Informatics, Univ. of Oslo, Norway. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the <organization> nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY ARNE MAUS, DEPT. OF INFORMATICS, UNIV. OF OSLO, NORWAY ''AS + IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL ARNE MAUS, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + + static void sortARLwithBorders(TKey* keys, TValue* values, int start, int end, int leftBitNo) + { + int num = end - start + 1; + + int point[(1 << MAX_NUM_BIT) + 1]; + int border[(1 << MAX_NUM_BIT) + 1]; + + // adaptive part - adjust numBit : number of bits to sort on in this pass + // a) adapts to bits left to sort to sort AND cache-size level 1 (8-32KB) + int numBit = leftBitNo + 1; + if (numBit > MAX_NUM_BIT) + { + numBit = MAX_NUM_BIT; + } + // b) adapts to 'sparse' distribution + while ((1 << (numBit - 1)) > num && numBit > MIN_NUM_BIT) + { + --numBit; + } + if (numBit == leftBitNo) + { + ++numBit; // eventually, do the last bit + } + + // sort on leftmost 'numBits' starting at bit no: leftBitNo + // setting constants + int rBitNo = leftBitNo - numBit + 1; + int lim = 1 << numBit; + TKey mask = TKey(lim - 1) << rBitNo; + + // sort on 'numBit' bits, from: leftBitNo'to 'rBitNo+1' in a[start..end] + + // c) count-scan 'numBit' bits + memset(point, 0, sizeof(point)); + for (int i = start; i <= end ; i++) + { + point[(keys[i] & mask) >> rBitNo ]++; + } + + int t1, t2 = point[0]; + point[0] = start; + + for (int i = 1; i <= lim; i++) + { + // d) point [i] points to where bundle 'i' starts, stopvalue in borders[lim-1] + t1 = t2; + t2 = point[i]; + border[i - 1] = point[i] = point[i - 1] + t1; + } + + border[lim - 1] = point[lim]; + border[lim] = end + 1; + + int currentBox = 0, pos = start; + + // find next element to move in permtation cycles + // skip cycles of length =1 + + while (point[currentBox] == border[currentBox]) + { + currentBox++; + } + + while (currentBox < lim) + { + // find next cycle, skip (most)cycles of length =1 + pos = point[currentBox]; + TKey key = keys[pos]; + TValue value = values[pos]; + + // start of new permutation cycle + int adr2 = point[(key & mask) >> rBitNo]++; + + if (adr2 > pos) + { + // permuttion cycle longer than 1 element + do + { + TKey key2 = keys[adr2]; + TValue value2 = values[adr2]; + // central loop + keys[adr2] = key; + values[adr2] = value; + + adr2 = point[(key2 & mask) >> rBitNo]++; + + key = key2; + value = value2; + } + while (adr2 > pos); + + keys[pos] = key; + values[pos] = value; + }// end perm cycle + + // find box where to find start of new permutation cycle + while (currentBox < lim && point[currentBox] == border[currentBox]) + { + currentBox++; + } + + } // end more to sort + + leftBitNo = leftBitNo - numBit; + + if (leftBitNo >= 0) + { + // more to sort - recursively + t2 = start; + for (int i = 0; i < lim; i++) + { + t1 = t2; + t2 = point[i]; + int newNum = t2 - t1; + + // call each cell if more than one number + if (newNum > 1) + { + if (newNum <= INSERT_MAX) + { + insertSort(keys, values, t1, t2 - 1); + } + else + { + sortARLwithBorders(keys, values, t1, t2 - 1, leftBitNo); + } + } // if newNum > 1 + } // end for + } // end if leftBitNo + + }// end sortARLwithBorders + +}; + +} +} // namespace nvidia + +#endif // __ARL_SORT_H__ diff --git a/APEX_1.4/module/iofx/include/IofxActorCPU.h b/APEX_1.4/module/iofx/include/IofxActorCPU.h new file mode 100644 index 00000000..b83f5afc --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxActorCPU.h @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_ACTOR_CPU_H__ +#define __IOFX_ACTOR_CPU_H__ + +#include "Apex.h" +#include "IofxActor.h" +#include "InstancedObjectSimulationIntl.h" +#include "ResourceProviderIntl.h" +#include "ApexActor.h" +#include "IofxActorImpl.h" +#include "IofxSceneCPU.h" + +#include "ModifierData.h" + +namespace nvidia +{ +namespace iofx +{ + +class Modifier; +class IofxAssetImpl; +class IofxManager; +class IofxActorCPU; +class IosObjectCpuData; + +class TaskModifiers : public PxLightCpuTask +{ +public: + TaskModifiers(IofxActorCPU& owner) : mOwner(owner) {} + const char* getName() const + { + return "IofxActorCPU::Modifiers"; + } + void run(); + +protected: + IofxActorCPU& mOwner; + +private: + TaskModifiers& operator=(const TaskModifiers&); +}; + +class IofxActorCPU : public IofxActorImpl +{ +public: + IofxActorCPU(ResID, IofxScene*, IofxManager& ); + ~IofxActorCPU() {} + + void updateBounds(); + + void runModifiers(); + + + template <typename Input, typename PublicState, typename PrivateState, typename OutputLayout> + void updateParticles(const IosObjectCpuData& objData, const OutputLayout& outputLayout, const uint8_t* ptr); + + + TaskModifiers mModifierTask; + + PxBounds3 mWorkingBounds; + ObjectRange mWorkingRange; + uint32_t mWorkingVisibleCount; +}; + +template <typename T> +void FromSlices(IofxSlice** slices, uint32_t idx, T& val) +{ + size_t i = 0; + IofxSlice* data = (IofxSlice*)&val; + for (; i != sizeof(T) / sizeof(IofxSlice); ++i, ++data) + { + *data = slices[i][idx]; + } + + uint32_t tail = sizeof(T) % sizeof(IofxSlice); + if (!tail) + { + return; + } + + uint32_t* u32s = (uint32_t*)data; + + if (4 == tail) + { + u32s[0] = slices[i][idx].x; + } + else if (8 == tail) + { + u32s[0] = slices[i][idx].x; + u32s[1] = slices[i][idx].y; + } + else if (12 == tail) + { + u32s[0] = slices[i][idx].x; + u32s[1] = slices[i][idx].y; + u32s[2] = slices[i][idx].z; + } + else + { + PX_ALWAYS_ASSERT(); + } +} + +template <typename T> +void ToSlices(IofxSlice** slices, uint32_t idx, const T& val) +{ + size_t i = 0; + const IofxSlice* data = (const IofxSlice*)&val; + for (; i != sizeof(T) / sizeof(IofxSlice); ++i, ++data) + { + slices[i][idx] = *data; + } + + uint32_t tail = sizeof(T) % sizeof(IofxSlice); + if (!tail) + { + return; + } + + const uint32_t* u32s = (const uint32_t*)data; + + if (4 == tail) + { + slices[i][idx].x = u32s[0]; + } + else if (8 == tail) + { + slices[i][idx].x = u32s[0]; + slices[i][idx].y = u32s[1]; + } + else if (12 == tail) + { + slices[i][idx].x = u32s[0]; + slices[i][idx].y = u32s[1]; + slices[i][idx].z = u32s[2]; + } + else + { + PX_ALWAYS_ASSERT(); + } +} + +template <typename Input, typename PublicState, typename PrivateState, typename OutputLayout> +void IofxActorCPU::updateParticles(const IosObjectCpuData& objData, const OutputLayout& outputLayout, const uint8_t* ptr) +{ + IofxSlice** inPubState = objData.inPubState; + IofxSlice** inPrivState = objData.inPrivState; + IofxSlice** outPubState = objData.outPubState; + IofxSlice** outPrivState = objData.outPrivState; + + ModifierCommonParams common = objData.getCommonParams(); + + RandState randState(mIofxScene->mApexScene->getSeed()); + + for (uint32_t id = 0; id < mWorkingRange.objectCount; id++) + { + uint32_t outputID = mWorkingRange.startIndex + id; + uint32_t stateID = objData.outputToState[ outputID ]; + PX_ASSERT(stateID != IosBufferDescIntl::NOT_A_PARTICLE); + PX_ASSERT(stateID < objData.maxStateID); + uint32_t inputID = objData.pmaInStateToInput->get(stateID); + + bool newParticle = false; + if (inputID & IosBufferDescIntl::NEW_PARTICLE_FLAG) + { + newParticle = true; + inputID &= ~IosBufferDescIntl::NEW_PARTICLE_FLAG; + } + + const IofxActorIDIntl actorId = objData.pmaActorIdentifiers->get(inputID); + const uint16_t actorClassId = actorId.getActorClassID(); + PX_ASSERT(actorClassId < mMgr.mActorClassTable.size()); + + IofxManagerClient* iofxClient = mMgr.mActorClassTable[ actorClassId ].client; + PX_ASSERT(iofxClient != NULL); + IofxAssetSceneInstCPU* iofxAssetSceneInst = static_cast<IofxAssetSceneInstCPU*>(iofxClient->getAssetSceneInst()); + PX_ASSERT(iofxAssetSceneInst != NULL); + + Input input; + input.load(objData, inputID); + + PublicState pubState; + PrivateState privState; + + if (newParticle) + { + PublicState::initDefault(pubState, iofxClient->getParams().objectScale); + PrivateState::initDefault(privState); + + for (uint32_t j = 0; j < iofxAssetSceneInst->mSpawnModifiersList.size(); j++) + { + const void* params = &iofxAssetSceneInst->mModifiersParamsBuffer[ iofxAssetSceneInst->mSpawnModifiersList[j].paramsOffset ]; + iofxAssetSceneInst->mSpawnModifiersList[j].updateFunc(params, input, pubState, privState, common, randState); + } + } + else + { + PX_ASSERT(stateID < objData.maxObjectCount); + + FromSlices(inPubState, stateID, pubState); + FromSlices(inPrivState, stateID, privState); + } + + ToSlices(outPubState, outputID, pubState); + + for (uint32_t j = 0; j < iofxAssetSceneInst->mContinuousModifiersList.size(); j++) + { + const void* params = &iofxAssetSceneInst->mModifiersParamsBuffer[ iofxAssetSceneInst->mContinuousModifiersList[j].paramsOffset ]; + iofxAssetSceneInst->mContinuousModifiersList[j].updateFunc(params, input, pubState, privState, common, randState); + } + + objData.pmaOutStateToInput->get(outputID) = inputID; + ToSlices(outPrivState, outputID, privState); + + outputLayout.write(outputID, input, pubState, ptr); + } +} + +class ModifierParamsMapperCPUimpl; + +class IofxAssetSceneInstCPU : public IofxAssetSceneInst +{ +public: + IofxAssetSceneInstCPU(IofxAssetImpl* asset, uint32_t semantics, IofxScene* scene); + virtual ~IofxAssetSceneInstCPU() {} + + struct ModifierInfo + { + union + { + ModifierImpl::updateSpriteFunc updateSpriteFunc; + ModifierImpl::updateMeshFunc updateMeshFunc; + }; + void updateFunc(const void* params, const SpriteInput& input, SpritePublicState& pubState, SpritePrivateState& privState, const ModifierCommonParams& common, RandState& randState) + { + updateSpriteFunc(params, input, pubState, privState, common, randState); + } + void updateFunc(const void* params, const MeshInput& input, MeshPublicState& pubState, MeshPrivateState& privState, const ModifierCommonParams& common, RandState& randState) + { + updateMeshFunc(params, input, pubState, privState, common, randState); + } + + uint32_t paramsOffset; + }; + + uint32_t introspectModifiers(ModifierParamsMapperCPUimpl& introspector, ModifierInfo* list, const ModifierStack& stack, ModifierStage stage, uint32_t usageClass); + + physx::Array<ModifierInfo> mSpawnModifiersList; + physx::Array<ModifierInfo> mContinuousModifiersList; + physx::Array<uint8_t> mModifiersParamsBuffer; +}; + + +} +} // namespace nvidia + +#endif // __IOFX_ACTOR_CPU_H__ diff --git a/APEX_1.4/module/iofx/include/IofxActorGPU.h b/APEX_1.4/module/iofx/include/IofxActorGPU.h new file mode 100644 index 00000000..07165d8e --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxActorGPU.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_ACTOR_GPU_H__ +#define __IOFX_ACTOR_GPU_H__ + +#include "Apex.h" +#include "IofxActor.h" +#include "ApexActor.h" +#include "IofxActorImpl.h" + +namespace nvidia +{ +namespace apex +{ +class SceneIntl; +} +namespace iofx +{ + + +class Modifier; +class IofxAssetImpl; +class IofxScene; +class IofxManager; + +class IofxActorGPU : public IofxActorImpl +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + IofxActorGPU(ResID renderResID, IofxScene* iscene, IofxManager& mgr) + : IofxActorImpl(renderResID, iscene, mgr) + { + } + ~IofxActorGPU() + { + } +}; + + +} +} // namespace nvidia + +#endif // __IOFX_ACTOR_GPU_H__ diff --git a/APEX_1.4/module/iofx/include/IofxActorImpl.h b/APEX_1.4/module/iofx/include/IofxActorImpl.h new file mode 100644 index 00000000..818a51a9 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxActorImpl.h @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_ACTOR_IMPL_H__ +#define __IOFX_ACTOR_IMPL_H__ + +#include "Apex.h" +#include "IofxActor.h" +#include "InstancedObjectSimulationIntl.h" +#include "ResourceProviderIntl.h" +#include "ApexActor.h" +#include "IofxAssetImpl.h" +#include "IofxManagerIntl.h" +#include "IofxManager.h" +#include "ModifierImpl.h" +#include "ApexRWLockable.h" + +namespace nvidia +{ +namespace apex +{ +class SceneIntl; +class Modifier; +} +namespace iofx +{ + +class IofxScene; +class RenderVolumeImpl; + +struct ObjectRange +{ + ObjectRange() : startIndex(0), objectCount(0) {} + + uint32_t startIndex; //!< start index for this IOFX actor + uint32_t objectCount; //!< count of object instances this frame +}; + + +class IofxRenderableImpl; + +class IofxActorImpl : + public IofxActor, + public ApexResourceInterface, + public ApexActor, + public ApexResource, + public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + IofxActorImpl(ResID, IofxScene*, IofxManager&); + ~IofxActorImpl(); + + // Actor methods + void setPhysXScene(PxScene*) { } + PxScene* getPhysXScene() const + { + return NULL; + } + Asset* getOwner() const + { + READ_ZONE(); + return NULL; + } + Actor* getActor() + { + return this; + } + const char* getIosAssetName() const + { + READ_ZONE(); + return mMgr.mIosAssetName.c_str(); + } + IofxRenderable* acquireRenderableReference(); + + void getLodRange(float& min, float& max, bool& intOnly) const; + float getActiveLod() const; + void forceLod(float lod); + /** + \brief Selectively enables/disables debug visualization of a specific APEX actor. Default value it true. + */ + virtual void setEnableDebugVisualization(bool state) + { + WRITE_ZONE(); + ApexActor::setEnableDebugVisualization(state); + } + + // ApexResourceInterface methods + void release(); + void destroy(); + + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + + virtual float getObjectRadius() const + { + READ_ZONE(); + return mMgr.getObjectRadius(); + } + virtual uint32_t getObjectCount() const + { + READ_ZONE(); + return mResultRange.objectCount; + } + virtual uint32_t getVisibleCount() const + { + READ_ZONE(); + return mResultVisibleCount; + } + virtual physx::PxBounds3 getBounds() const + { + READ_ZONE(); + return mResultBounds; + } + + bool prepareRenderables(IosObjectBaseData* obj); + + + ResID mRenderResID; + IofxScene* mIofxScene; + IofxManager& mMgr; + RenderVolumeImpl* mRenderVolume; + + /* Set by IOFX Manager at creation time, immutable */ + uint32_t mActorID; + + PxBounds3 mResultBounds; + ObjectRange mResultRange; + uint32_t mResultVisibleCount; + + physx::Array<IofxRenderableImpl*> mRenderableArray; + + uint32_t mSemantics; + IofxRenderableImpl* mActiveRenderable; + + bool mDistanceSortingEnabled; + + friend class IofxManager; + friend class IofxManagerGPU; +}; + +} +} // namespace nvidia + +#endif // __IOFX_ACTOR_IMPL_H__ diff --git a/APEX_1.4/module/iofx/include/IofxAssetImpl.h b/APEX_1.4/module/iofx/include/IofxAssetImpl.h new file mode 100644 index 00000000..00abc577 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxAssetImpl.h @@ -0,0 +1,504 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef IOFX_ASSET_IMPL_H +#define IOFX_ASSET_IMPL_H + +#include "Apex.h" +#include "ApexUsingNamespace.h" +#include "ApexSDKHelpers.h" +#include "ApexAssetAuthoring.h" +#include "ApexAssetTracker.h" +#include "ApexContext.h" +#include "IofxAsset.h" +#include "Modifier.h" +#include "ApexString.h" +#include "ResourceProviderIntl.h" +#include "ApexAuthorableObject.h" +#include "IofxAssetParameters.h" +#include "MeshIofxParameters.h" +#include "SpriteIofxParameters.h" +#include "ParamArray.h" +#include "ModifierImpl.h" +#include "ApexRWLockable.h" +#include "ReadCheck.h" +#include "WriteCheck.h" +#include "ApexAuthorableObject.h" + +// instead of having an initial color modifier, just drop +// in 4 color vs life modifiers instead +#define IOFX_SLOW_COMPOSITE_MODIFIERS 1 + +namespace nvidia +{ +namespace iofx +{ + +typedef physx::Array<Modifier*> ModifierStack; + +class ModuleIofxImpl; + +class IofxAssetImpl : public IofxAsset, + public ResourceList, + public ApexResourceInterface, + public ApexResource, + public NvParameterized::SerializationCallback, + public ApexContext, + public ApexRWLockable +{ + friend class IofxAssetDummyAuthoring; +protected: + IofxAssetImpl(ModuleIofxImpl* module, ResourceList& list, const char* name); + IofxAssetImpl(ModuleIofxImpl* module, + ResourceList& list, + NvParameterized::Interface* params, + const char* name); + +public: + APEX_RW_LOCKABLE_BOILERPLATE + + ~IofxAssetImpl(); + + // Asset + virtual void release(); + virtual const char* getName(void) const + { + READ_ZONE(); + return mName.c_str(); + } + virtual AuthObjTypeID getObjTypeID() const + { + READ_ZONE(); + return mAssetTypeID; + } + virtual const char* getObjTypeName() const + { + READ_ZONE(); + return getClassName(); + } + virtual uint32_t forceLoadAssets(); + // ApexResourceInterface + virtual void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + virtual uint32_t getListIndex() const + { + return m_listIndex; + } + + // Context + virtual void removeAllActors(); + RenderableIterator* createRenderableIterator() + { + return ApexContext::createRenderableIterator(); + } + void releaseRenderableIterator(RenderableIterator& iter) + { + ApexContext::releaseRenderableIterator(iter); + } + + void addDependentActor(ApexActor* actor); + + bool isOpaqueMesh(uint32_t index) const; + + virtual uint32_t getMeshAssetCount() const + { + READ_ZONE(); + return mRenderMeshList ? mRenderMeshList->size() : 0; + } + virtual const char* getMeshAssetName(uint32_t index) const; + virtual uint32_t getMeshAssetWeight(uint32_t index) const; + virtual const char* getSpriteMaterialName() const; + virtual uint32_t getContinuousModifierCount() const + { + return mContinuousModifierStack.size(); + } + virtual const Modifier* getSpawnModifiers(uint32_t& outCount) const + { + READ_ZONE(); + outCount = mSpawnModifierStack.size(); + return mSpawnModifierStack.front(); + } + virtual const Modifier* getContinuousModifiers(uint32_t& outCount) const + { + READ_ZONE(); + outCount = mContinuousModifierStack.size(); + return mContinuousModifierStack.front(); + } + + template<class ModifierType> + PX_INLINE float getMaxYFromCurveModifier(Modifier* modifier) const + { + float maxScale = 0.0f; + ModifierType* m = DYNAMIC_CAST(ModifierType*)(modifier); + const nvidia::apex::Curve* curve = m->getFunction(); + uint32_t numControlPoints = 0; + const Vec2R* controlPoints = curve->getControlPoints(numControlPoints); + for (uint32_t j = 0; j < numControlPoints; ++j) + { + maxScale = PxMax(maxScale, controlPoints->y); + ++controlPoints; + } + return maxScale; + } + + virtual float getScaleUpperBound(float maxVelocity) const + { + // check all modifiers and return the biggest scale they can produce + READ_ZONE(); + float scale = 1.0f; + + for (uint32_t i = 0; i < mSpawnModifierStack.size(); ++i) + { + Modifier* modifier = mSpawnModifierStack[i]; + + switch (modifier->getModifierType()) + { + case ModifierType_SimpleScale: + { + SimpleScaleModifierImpl* m = DYNAMIC_CAST(SimpleScaleModifierImpl*)(modifier); + scale *= m->getScaleFactor().maxElement(); + break; + } + case ModifierType_RandomScale: + { + RandomScaleModifierImpl* m = DYNAMIC_CAST(RandomScaleModifierImpl*)(modifier); + scale *= m->getScaleFactor().maximum; + break; + } + default: + break; + } + + } + for (uint32_t i = 0; i < mContinuousModifierStack.size(); ++i) + { + Modifier* modifier = mContinuousModifierStack[i]; + switch (mContinuousModifierStack[i]->getModifierType()) + { + case ModifierType_ScaleAlongVelocity: + { + ScaleAlongVelocityModifierImpl* m = DYNAMIC_CAST(ScaleAlongVelocityModifierImpl*)(modifier); + scale *= m->getScaleFactor() * maxVelocity; + break; + } + case ModifierType_ScaleVsLife: + { + float maxScale = getMaxYFromCurveModifier<ScaleVsLifeModifierImpl>(modifier); + if (maxScale != 0.0f) + { + scale *= maxScale; + } + break; + } + case ModifierType_ScaleVsDensity: + { + float maxScale = getMaxYFromCurveModifier<ScaleVsDensityModifierImpl>(modifier); + if (maxScale != 0.0f) + { + scale *= maxScale; + } + break; + } + case ModifierType_ScaleVsCameraDistance: + { + float maxScale = getMaxYFromCurveModifier<ScaleVsCameraDistanceModifierImpl>(modifier); + if (maxScale != 0.0f) + { + scale *= maxScale; + } + break; + } + case ModifierType_OrientScaleAlongScreenVelocity: + { + OrientScaleAlongScreenVelocityModifierImpl* m = DYNAMIC_CAST(OrientScaleAlongScreenVelocityModifierImpl*)(modifier); + scale *= m->getScalePerVelocity() * maxVelocity; + break; + } + default: + break; + } + } + + return scale; + } + + uint32_t getSpriteSemanticsBitmap() const + { + return mSpriteSemanticBitmap; + } + PX_INLINE bool isSpriteSemanticUsed(IofxRenderSemantic::Enum semantic) + { + return (((1 << semantic) & mSpriteSemanticBitmap) ? true : false); + } + void setSpriteSemanticsUsed(uint32_t spriteSemanticsBitmap); + + uint32_t getMeshSemanticsBitmap() const + { + return mMeshSemanticBitmap; + } + PX_INLINE bool isMeshSemanticUsed(IofxRenderSemantic::Enum semantic) + { + return (((1 << semantic) & mMeshSemanticBitmap) ? true : false); + } + void setMeshSemanticsUsed(uint32_t meshSemanticsBitmap); + + /* objects that assist in force loading and proper "assets own assets" behavior */ + ApexAssetTracker mRenderMeshAssetTracker; + ApexAssetTracker mSpriteMaterialAssetTracker; + + const NvParameterized::Interface* getAssetNvParameterized() const + { + return mParams; + } + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + NvParameterized::Interface* getDefaultActorDesc() + { + READ_ZONE(); + APEX_INVALID_OPERATION("Not yet implemented!"); + return NULL; + }; + + NvParameterized::Interface* getDefaultAssetPreviewDesc() + { + READ_ZONE(); + APEX_INVALID_OPERATION("Not yet implemented!"); + return NULL; + } + + virtual Actor* createApexActor(const NvParameterized::Interface& /*parms*/, Scene& /*apexScene*/) + { + READ_ZONE(); + APEX_INVALID_OPERATION("Not yet implemented!"); + return NULL; + } + + virtual AssetPreview* createApexAssetPreview(const NvParameterized::Interface& /*params*/, AssetPreviewScene* /*previewScene*/) + { + READ_ZONE(); + APEX_INVALID_OPERATION("Not yet implemented!"); + return NULL; + } + + virtual bool isValidForActorCreation(const ::NvParameterized::Interface& /*parms*/, Scene& /*apexScene*/) const + { + READ_ZONE(); + return true; // todo, implement! + } + + virtual bool isDirty() const + { + READ_ZONE(); + return false; + } + + void destroy(); + static const char* getClassName() + { + return IOFX_AUTHORING_TYPE_NAME; + } + static AuthObjTypeID mAssetTypeID; + + struct RenderMesh + { + uint32_t mWeight; + ApexSimpleString mMeshAssetName; + }; + + // authorable data + IofxAssetParameters* mParams; + physx::Array<RenderMesh> mRenderMeshes; + ModifierStack mSpawnModifierStack; + ModifierStack mContinuousModifierStack; + ParamArray<MeshIofxParametersNS::meshProperties_Type> *mRenderMeshList; + SpriteIofxParameters* mSpriteParams; + + // runtime data + ModuleIofxImpl* mModule; + ApexSimpleString mName; + uint32_t mSpriteSemanticBitmap; + uint32_t mMeshSemanticBitmap; + +#if IOFX_SLOW_COMPOSITE_MODIFIERS + physx::Array<NvParameterized::Interface*> mCompositeParams; +#endif + + PX_INLINE ModifierStack& getModifierStack(uint32_t modStage) + { + switch (modStage) + { + case ModifierStage_Spawn: + return mSpawnModifierStack; + case ModifierStage_Continuous: + return mContinuousModifierStack; + default: + PX_ALWAYS_ASSERT(); + }; + return mSpawnModifierStack; // should never get here. + } + + PX_INLINE const ModifierStack& getModifierStack(uint32_t modStage) const + { + switch (modStage) + { + case ModifierStage_Spawn: + return mSpawnModifierStack; + case ModifierStage_Continuous: + return mContinuousModifierStack; + default: + PX_ALWAYS_ASSERT(); + }; + return mSpawnModifierStack; // should never get here. + } + + PX_INLINE NvParameterized::ErrorType getModifierStack(uint32_t modStage, NvParameterized::Handle& h) + { + switch (modStage) + { + case ModifierStage_Spawn: + return mParams->getParameterHandle("spawnModifierList", h); + case ModifierStage_Continuous: + return mParams->getParameterHandle("continuousModifierList", h); + default: + PX_ALWAYS_ASSERT(); + }; + return NvParameterized::ERROR_INDEX_OUT_OF_RANGE; // should never get here. + } + + PX_INLINE NvParameterized::ErrorType getModifierStack(uint32_t modStage, NvParameterized::Handle& h) const + { + switch (modStage) + { + case ModifierStage_Spawn: + return mParams->getParameterHandle("spawnModifierList", h); + case ModifierStage_Continuous: + return mParams->getParameterHandle("continuousModifierList", h); + default: + PX_ALWAYS_ASSERT(); + }; + return NvParameterized::ERROR_INDEX_OUT_OF_RANGE; // should never get here. + } + + bool isSortingEnabled() const; + + /* NvParameterized Serialization callbacks */ + void preSerialize(void* userData_ = NULL); + void postDeserialize(void* userData_ = NULL); + + // initialize a table of assets and resource IDs for resource tracking + void initializeAssetNameTable(); + + uint32_t getPubStateSize() const; + uint32_t getPrivStateSize() const; + + friend class ModuleIofxImpl; + template <class T_Module, class T_Asset, class T_AssetAuthoring> friend class nvidia::apex::ApexAuthorableObject; +}; + +#ifndef WITHOUT_APEX_AUTHORING +class IofxAssetAuthoringImpl : public IofxAssetAuthoring, public IofxAssetImpl, public ApexAssetAuthoring +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + IofxAssetAuthoringImpl(ModuleIofxImpl* module, ResourceList& list) : + IofxAssetImpl(module, list, "IofxAssetAuthoringImpl") {} + + IofxAssetAuthoringImpl(ModuleIofxImpl* module, ResourceList& list, const char* name) : + IofxAssetImpl(module, list, name) {} + + IofxAssetAuthoringImpl(ModuleIofxImpl* module, ResourceList& list, NvParameterized::Interface* params, const char* name) : + IofxAssetImpl(module, list, params, name) {} + + virtual void release(); + + virtual const char* getName(void) const + { + READ_ZONE(); + return IofxAssetImpl::getName(); + } + virtual const char* getObjTypeName() const; + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + APEX_INVALID_OPERATION("Not Implemented."); + return false; + } + + void setToolString(const char* toolName, const char* toolVersion, uint32_t toolChangelist) + { + ApexAssetAuthoring::setToolString(toolName, toolVersion, toolChangelist); + } + +#if IOFX_AUTHORING_API_ENABLED + virtual void setMeshAssetName(const char* meshAssetName, uint32_t meshIndex = 0); + virtual void setMeshAssetWeight(const uint32_t weight, uint32_t meshIndex = 0); + virtual void setSpriteMaterialName(const char* spriteMaterialName); + + virtual uint32_t getMeshAssetCount() const + { + return IofxAssetImpl::getMeshAssetCount(); + } + virtual const char* getMeshAssetName(uint32_t index) const + { + return IofxAssetImpl::getMeshAssetName(index); + } + virtual uint32_t getMeshAssetWeight(uint32_t index) const + { + return IofxAssetImpl::getMeshAssetWeight(index); + } + virtual const char* getSpriteMaterialName() const + { + return IofxAssetImpl::getSpriteMaterialName(); + } + + virtual Modifier* createModifier(uint32_t modStage, uint32_t modType); + + virtual void removeModifier(uint32_t modStage, uint32_t position); + virtual uint32_t findModifier(uint32_t modStage, Modifier* modifier); + virtual Modifier* getModifier(uint32_t modStage, uint32_t position) const; + virtual uint32_t getModifierCount(uint32_t modStage) const; +#endif + + NvParameterized::Interface* getNvParameterized() const + { + READ_ZONE(); + return (NvParameterized::Interface*)getAssetNvParameterized(); + } + /** + * \brief Releases the ApexAsset but returns the NvParameterized::Interface and *ownership* to the caller. + */ + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + READ_ZONE(); + NvParameterized::Interface* ret = mParams; + mParams = NULL; + release(); + return ret; + } + uint32_t getAssetTarget() const; +}; +#endif + +} +} // namespace nvidia + +#endif // IOFX_ASSET_IMPL_H diff --git a/APEX_1.4/module/iofx/include/IofxManager.h b/APEX_1.4/module/iofx/include/IofxManager.h new file mode 100644 index 00000000..8a0043b9 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxManager.h @@ -0,0 +1,400 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_MANAGER_H__ +#define __IOFX_MANAGER_H__ + +#include "PsArray.h" +#include "PsHashMap.h" +#include "SceneIntl.h" +#include "IofxManagerIntl.h" +#include "ApexActor.h" + +#include "ModifierData.h" + +#include "PxTask.h" +#include "ApexMirroredArray.h" + +namespace nvidia +{ +namespace iofx +{ + +class IofxScene; +class IofxManager; +class IosObjectBaseData; +class IofxAssetImpl; +class IofxActorImpl; +class RenderVolumeImpl; +class IofxSharedRenderData; + +class TaskUpdateEffects : public PxTask +{ +public: + TaskUpdateEffects(IofxManager& owner) : mOwner(owner) {} + const char* getName() const + { + return "IofxManager::UpdateEffects"; + } + void run(); +protected: + IofxManager& mOwner; + +private: + TaskUpdateEffects& operator=(const TaskUpdateEffects&); +}; + +class IofxAssetImpl; + +class IofxSceneInst : public UserAllocated +{ +public: + virtual ~IofxSceneInst() {} + + uint32_t getRefCount() const + { + return _refCount; + } + void addRef() + { + ++_refCount; + } + bool removeRef() + { + PX_ASSERT(_refCount > 0); + return (--_refCount == 0); + } + +protected: + IofxSceneInst() : _refCount(0) {} + +private: + uint32_t _refCount; +}; + +class IofxAssetSceneInst : public IofxSceneInst +{ +public: + IofxAssetSceneInst(IofxAssetImpl* asset, uint32_t semantics) + : _asset(asset), _semantics(semantics) + { + } + virtual ~IofxAssetSceneInst() + { + } + + PX_INLINE IofxAssetImpl* getAsset() const + { + return _asset; + } + PX_INLINE uint32_t getSemantics() const + { + return _semantics; + } + +protected: + IofxAssetImpl* _asset; + uint32_t _semantics; +}; + +class IofxManagerClient : public IofxManagerClientIntl, public UserAllocated +{ +public: + IofxManagerClient(IofxAssetSceneInst* assetSceneInst, uint32_t actorClassID, const IofxManagerClientIntl::Params& params) + : _assetSceneInst(assetSceneInst), _actorClassID(actorClassID), _params(params) + { + } + virtual ~IofxManagerClient() + { + } + + PX_INLINE IofxAssetSceneInst* getAssetSceneInst() const + { + PX_ASSERT(_assetSceneInst != NULL); + return _assetSceneInst; + } + + PX_INLINE uint32_t getActorClassID() const + { + return _actorClassID; + } + + PX_INLINE const IofxManagerClientIntl::Params& getParams() const + { + return _params; + } + + // IofxManagerClientIntl interface + virtual void getParams(IofxManagerClientIntl::Params& params) const + { + params = _params; + } + virtual void setParams(const IofxManagerClientIntl::Params& params) + { + _params = params; + } + +protected: + IofxAssetSceneInst* _assetSceneInst; + uint32_t _actorClassID; + IofxManagerClientIntl::Params _params; +}; + +class IofxActorSceneInst : public IofxSceneInst +{ +public: + IofxActorSceneInst(ResID renderResID) + : _renderResID(renderResID) + { + } + virtual ~IofxActorSceneInst() + { + } + + PX_INLINE ResID getRenderResID() const + { + return _renderResID; + } + + void addAssetSceneInst(IofxAssetSceneInst* value) + { + _assetSceneInstArray.pushBack(value); + } + bool removeAssetSceneInst(IofxAssetSceneInst* value) + { + return _assetSceneInstArray.findAndReplaceWithLast(value); + } + const physx::Array<IofxAssetSceneInst*>& getAssetSceneInstArray() const + { + return _assetSceneInstArray; + } + +protected: + ResID _renderResID; + physx::Array<IofxAssetSceneInst*> _assetSceneInstArray; +}; + +class CudaPipeline +{ +public: + virtual ~CudaPipeline() {} + virtual void release() = 0; + virtual void fetchResults() = 0; + virtual void submitTasks() = 0; + + virtual PxTaskID launchGpuTasks() = 0; + virtual void launchPrep() = 0; + + virtual IofxManagerClient* createClient(IofxAssetSceneInst* assetSceneInst, uint32_t actorClassID, const IofxManagerClientIntl::Params& params) = 0; + virtual IofxAssetSceneInst* createAssetSceneInst(IofxAssetImpl* asset, uint32_t semantics) = 0; +}; + + +class IofxManager : public IofxManagerIntl, public ApexResourceInterface, public ApexResource, public ApexContext +{ +public: + IofxManager(IofxScene& scene, const IofxManagerDescIntl& desc, bool isMesh); + ~IofxManager(); + + void destroy(); + + /* Over-ride this ApexContext method to capture IofxActorImpl deletion events */ + void removeActorAtIndex(uint32_t index); + + void createSimulationBuffers(IosBufferDescIntl& outDesc); + void setSimulationParameters(float radius, const PxVec3& up, float gravity, float restDensity); + void updateEffectsData(float deltaTime, uint32_t numObjects, uint32_t maxInputID, uint32_t maxStateID, void* extraData); + virtual void submitTasks(); + virtual void fetchResults(); + void release(); + void outputHostToDevice(PxGpuCopyDescQueue& copyQueue); + PxTaskID getUpdateEffectsTaskID(PxTaskID); + void cpuModifiers(); + PxBounds3 getBounds() const; + void swapStates(); + + uint32_t getActorID(IofxAssetSceneInst* assetSceneInst, uint16_t meshID); + void releaseActorID(IofxAssetSceneInst* assetSceneInst, uint32_t actorID); + + uint16_t getActorClassID(IofxManagerClientIntl* client, uint16_t meshID); + + IofxManagerClientIntl* createClient(nvidia::apex::IofxAsset* asset, const IofxManagerClientIntl::Params& params); + void releaseClient(IofxManagerClientIntl* client); + + uint16_t getVolumeID(RenderVolume* vol); + PX_INLINE uint32_t getSimulatedParticlesCount() const + { + return mLastNumObjects; + } + + PX_INLINE void setOnStartCallback(IofxManagerCallbackIntl* callback) + { + if (mOnStartCallback) + { + PX_DELETE(mOnStartCallback); + } + mOnStartCallback = callback; + } + PX_INLINE void setOnFinishCallback(IofxManagerCallbackIntl* callback) + { + if (mOnFinishCallback) + { + PX_DELETE(mOnFinishCallback); + } + mOnFinishCallback = callback; + } + + PX_INLINE bool isMesh() + { + return mIsMesh; + } + + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + + float getObjectRadius() const; + + IofxAssetSceneInst* createAssetSceneInst(IofxAsset* asset); + + void initIofxActor(IofxActorImpl* iofxActor, uint32_t mActorID, RenderVolumeImpl* renderVolume); + + + typedef HashMap<IofxAssetImpl*, IofxAssetSceneInst*> AssetHashMap_t; + AssetHashMap_t mAssetHashMap; + + physx::Array<IofxActorSceneInst*> mActorTable; + + struct ActorClassData + { + IofxManagerClient* client; // NULL for empty rows + uint16_t meshid; + uint16_t count; + uint32_t actorID; + }; + physx::Array<ActorClassData> mActorClassTable; + + struct VolumeData + { + RenderVolumeImpl* vol; // NULL for empty rows + PxBounds3 mBounds; + uint32_t mPri; + uint32_t mFlags; + physx::Array<IofxActorImpl*> mActors; // Indexed by actorClassID + }; + physx::Array<VolumeData> mVolumeTable; + physx::Array<uint32_t> mCountPerActor; + physx::Array<uint32_t> mStartPerActor; + physx::Array<uint32_t> mBuildPerActor; + physx::Array<uint32_t> mOutputToState; + PxTaskID mPostUpdateTaskID; + + physx::Array<uint32_t> mSortingKeys; + + physx::Array<uint32_t> mVolumeActorClassBitmap; + + IofxScene* mIofxScene; + physx::Array<IosObjectBaseData*> mObjData; + IosBufferDescIntl mSimBuffers; + ApexSimpleString mIosAssetName; + + // reference pointers for IOFX actors, so they know which buffer + // in in which mode. + IosObjectBaseData* mWorkingIosData; + IosObjectBaseData* mResultIosData; + IosObjectBaseData* mStagingIosData; + + enum RenderState + { + RENDER_WAIT_FOR_DATA_ALLOC = 0, + RENDER_WAIT_FOR_FETCH_RESULT, + RENDER_WAIT_FOR_NEW, + RENDER_READY + }; + RenderState mRenderState; + + RenderInteropFlags::Enum mInteropFlags; + + volatile uint32_t mTargetSemantics; + + // Simulation storage, for CPU/GPU IOS + ApexMirroredArray<PxVec4> positionMass; + ApexMirroredArray<PxVec4> velocityLife; + ApexMirroredArray<PxVec4> collisionNormalFlags; + ApexMirroredArray<float> density; + ApexMirroredArray<IofxActorIDIntl> actorIdentifiers; + ApexMirroredArray<uint32_t> inStateToInput; + ApexMirroredArray<uint32_t> outStateToInput; + + ApexMirroredArray<uint32_t> userData; + + IofxManagerCallbackIntl* mOnStartCallback; + IofxManagerCallbackIntl* mOnFinishCallback; + + // Assets that were added on this frame (prior to simulate) + physx::Array<const IofxAssetImpl*> addedAssets; + + // Max size of public/private states over active (simulated) assets + uint32_t pubStateSize, privStateSize; + + // State data (CPU only) + + typedef ApexMirroredArray<IofxSlice> SliceArray; + + struct State + { + physx::Array<SliceArray*> slices; // Slices + physx::Array<IofxSlice*> a, b; // Pointers to slices' halves + }; + + State pubState; + State privState; + + uint32_t mInStateOffset; + uint32_t mOutStateOffset; + bool mStateSwap; + + float mTotalElapsedTime; + bool mIsMesh; + bool mDistanceSortingEnabled; + bool mCudaIos; + bool mCudaModifiers; + + void prepareRenderables(); + + void fillMapUnmapArraysForInterop(physx::Array<CUgraphicsResource> &, physx::Array<CUgraphicsResource> &); + void mapBufferResultsForInterop(bool, bool); + + CudaPipeline* mCudaPipeline; + TaskUpdateEffects mSimulateTask; + + PxBounds3 mBounds; + +#if APEX_CUDA_SUPPORT + PxGpuCopyDescQueue mCopyQueue; +#endif + + uint32_t mLastNumObjects; + uint32_t mLastMaxInputID; +}; + +#define DEFERRED_IOFX_ACTOR ((IofxActorImpl*)(1)) + +} +} // end namespace nvidia::apex + +#endif // __IOFX_MANAGER_H__ diff --git a/APEX_1.4/module/iofx/include/IofxManagerGPU.h b/APEX_1.4/module/iofx/include/IofxManagerGPU.h new file mode 100644 index 00000000..f624c242 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxManagerGPU.h @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_MANAGER_GPU_H__ +#define __IOFX_MANAGER_GPU_H__ + +#include "Apex.h" +#include "IofxManager.h" +#include "IofxSceneGPU.h" + +#if APEX_CUDA_SUPPORT +#include "ApexCudaWrapper.h" +#include "PxCudaContextManager.h" +#endif + +#include "ModifierData.h" +#include "IosObjectData.h" + +namespace nvidia +{ +namespace apex +{ +class SceneIntl; +class Modifier; +} +namespace iofx +{ + +class IofxAssetImpl; +class IofxScene; +class ModifierParamsMapperGPU; + +/* Class which manages a per-IOS CUDA IOFX pipeline */ +class IofxManagerGPU : public CudaPipeline, public UserAllocated +{ +public: + IofxManagerGPU(SceneIntl& scene, const IofxManagerDescIntl& desc, IofxManager&, const ApexMirroredPlace::Enum defaultPlace = ApexMirroredPlace::GPU); + ~IofxManagerGPU(); + + void release(); + virtual void submitTasks(); + virtual void fetchResults(); + PxTaskID IofxManagerGPU::launchGpuTasks(); + void launchPrep(); + + IofxManagerClient* createClient(IofxAssetSceneInst* assetSceneInst, uint32_t actorClassID, const IofxManagerClientIntl::Params& params); + IofxAssetSceneInst* createAssetSceneInst(IofxAssetImpl* asset, uint32_t semantics); + + + IofxManager& mManager; + IofxScene& mIofxScene; + + bool cudaLaunch(CUstream stream, int kernelIndex); + void cudaLaunchRadixSort(CUstream stream, unsigned int numElements, unsigned int keyBits, unsigned int startBit, bool useSyncKernels); + + uint32_t mCurSeed; + uint32_t* mTargetBufDevPtr; + uint32_t mCountActorIDs; + uint32_t mNumberVolumes; + uint32_t mNumberActorClasses; + uint32_t mOutputDWords; + bool mEmptySimulation; + PxTask* mTaskLaunch; + +#if APEX_CUDA_SUPPORT + ApexCudaConstMemGroup mVolumeConstMemGroup; + InplaceHandle<VolumeParamsArray> mVolumeParamsArrayHandle; + InplaceHandle<ActorClassIDBitmapArray> mActorClassIDBitmapArrayHandle; + + ApexCudaConstMemGroup mRemapConstMemGroup; + InplaceHandle<ActorIDRemapArray> mActorIDRemapArrayHandle; + + ApexCudaConstMemGroup mModifierConstMemGroup; + InplaceHandle<ClientParamsHandleArray> mClientParamsHandleArrayHandle; + InplaceHandle<SpriteOutputLayout> mSpriteOutputLayoutHandle; + InplaceHandle<MeshOutputLayout> mMeshOutputLayoutHandle; + + PxGpuCopyDescQueue mCopyQueue; +#endif + + const ApexMirroredPlace::Enum mDefaultPlace; + + ApexMirroredArray<float> mCuSpawnScale; + ApexMirroredArray<uint32_t> mCuSpawnSeed; + + ApexMirroredArray<LCG_PRNG> mCuBlockPRNGs; + + // sprite sorting, then actor ID sorting + ApexMirroredArray<uint32_t> mCuSortedActorIDs; + ApexMirroredArray<uint32_t> mCuSortedStateIDs; + ApexMirroredArray<uint32_t> mCuSortTempKeys; + ApexMirroredArray<uint32_t> mCuSortTempValues; + ApexMirroredArray<uint32_t> mCuSortTemp; + + ApexMirroredArray<uint32_t> mCuActorStart; + ApexMirroredArray<uint32_t> mCuActorEnd; + ApexMirroredArray<uint32_t> mCuActorVisibleEnd; + + ApexMirroredArray<PxVec4> mCuMinBounds; + ApexMirroredArray<PxVec4> mCuMaxBounds; + ApexMirroredArray<PxVec4> mCuTempMinBounds; + ApexMirroredArray<PxVec4> mCuTempMaxBounds; + ApexMirroredArray<uint32_t> mCuTempActorIDs; + LCG_PRNG mRandThreadLeap; + LCG_PRNG mRandGridLeap; + + + class OutputBuffer + { + PxCudaBuffer* mGpuBuffer; + + public: + OutputBuffer() + { + mGpuBuffer = 0; + } + ~OutputBuffer() + { + release(); + } + + PX_INLINE bool isValid() const + { + return (mGpuBuffer != 0); + } + + PX_INLINE void* getGpuPtr() const + { + return (mGpuBuffer != 0) ? reinterpret_cast<void*>(mGpuBuffer->getPtr()) : 0; + } + + void release() + { + if (mGpuBuffer != 0) + { + mGpuBuffer->free(); + mGpuBuffer = 0; + } + } + + void realloc(size_t capacity, PxCudaContextManager* ctx) + { + if (mGpuBuffer != 0 && mGpuBuffer->getSize() >= capacity) + { + return; + } + if (capacity > 0) + { + release(); + mGpuBuffer = ctx->getMemoryManager()->alloc( + PxCudaBufferType(PxCudaBufferMemorySpace::T_GPU, PxCudaBufferFlags::F_READ_WRITE), + capacity); + PX_ASSERT(mGpuBuffer != 0); + } + } + + void copyToHost(CUstream stream, void* hostPtr, size_t size) + { + if (isValid()) + { + CUT_SAFE_CALL(cuMemcpyDtoHAsync(hostPtr, CUdeviceptr(mGpuBuffer->getPtr()), size, stream)); + } + } + }; + + OutputBuffer mTargetOutputBuffer; + uint32_t mTargetTextureCount; + ApexCudaArray mTargetCudaArrayList[IofxSpriteRenderLayout::MAX_SURFACE_COUNT]; +}; + +} +} // namespace nvidia + +#endif // __IOFX_ACTOR_GPU_H__ diff --git a/APEX_1.4/module/iofx/include/IofxRenderData.h b/APEX_1.4/module/iofx/include/IofxRenderData.h new file mode 100644 index 00000000..fde64366 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxRenderData.h @@ -0,0 +1,711 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_RENDER_DATA_H__ +#define __IOFX_RENDER_DATA_H__ + +#include "ApexUsingNamespace.h" +#include "PsUserAllocated.h" +#include "IofxRenderable.h" +#include "IofxRenderCallback.h" +#include "UserRenderCallback.h" +#include "ApexRenderMeshAsset.h" +#include "UserOpaqueMesh.h" +#include "RenderAPIIntl.h" + +#if APEX_CUDA_SUPPORT +#include "ApexCuda.h" +#endif + +namespace nvidia +{ +using namespace apex; + +namespace iofx +{ + +class IofxActorImpl; +class IofxScene; + + +class IofxSharedRenderDataBase : public RenderEntityIntl +{ +public: + virtual ~IofxSharedRenderDataBase() {} + + virtual void updateSemantics(IofxScene& scene, uint32_t semantics, uint32_t maxObjectCount, uint32_t activeObjectCount) = 0; + + virtual size_t getRenderBufferSize() const = 0; + +#if APEX_CUDA_SUPPORT + virtual CUdeviceptr getBufferMappedCudaPtr() const = 0; +#endif + virtual void* getBufferMappedPtr() const = 0; + + PX_INLINE bool checkSemantics(uint32_t semantics) const + { + return (semantics & mSemantics) == semantics; + } + + PX_INLINE uint32_t getSemantics() const + { + return mSemantics; + } + + PX_INLINE uint32_t getInstanceID() const + { + return mInstanceID; + } + + PX_INLINE IofxSharedRenderDataBase* incrementReferenceCount() + { + return static_cast<IofxSharedRenderDataBase*>(RenderEntityIntl::incrementReferenceCount()); + } + +protected: + IofxSharedRenderDataBase() + : mInstanceID(uint32_t(-1)) + , mSemantics(0) + { + } + + uint32_t mInstanceID; + uint32_t mSemantics; + +private: + IofxSharedRenderDataBase& operator=(const IofxSharedRenderDataBase&); +}; + +template <typename Impl, typename SRDT> +class IofxSharedRenderDataImpl : public RenderEntityIntlImpl<Impl, IofxSharedRenderDataBase> +{ +public: + virtual void updateSemantics(IofxScene& iofxScene, uint32_t newSemantics, uint32_t maxObjectCount, uint32_t activeObjectCount) + { + mSharedRenderData.maxObjectCount = maxObjectCount; + mSharedRenderData.activeObjectCount = activeObjectCount; + + if (newSemantics == mSemantics) + { + return; + } + + Impl::RenderLayout_t newRenderLayout; + bool bIsUserDefinedLayout = false; + if (newSemantics != 0) + { + bIsUserDefinedLayout = getImpl()->createRenderLayout(iofxScene, newSemantics, maxObjectCount, newRenderLayout); + if (getImpl()->getRenderLayout().isTheSameAs(newRenderLayout)) + { + mSemantics = newSemantics; + return; + } + } + + IofxSharedRenderDataImpl::free(); + + if (newSemantics != 0) + { + bool result = false; + if (bIsUserDefinedLayout) + { + //only create render buffer through UserRenderCallback if layout was user defined through IofxRenderCallback! + IofxRenderCallback* iofxRenderCallback = iofxScene.getIofxRenderCallback(); + if (iofxRenderCallback != NULL) + { + result = getImpl()->allocAllRenderStorage(newRenderLayout, iofxRenderCallback); + } + } + if (!result) + { + IofxRenderCallbackImpl internalIofxRenderCallback; + result = getImpl()->allocAllRenderStorage(newRenderLayout, &internalIofxRenderCallback); + } + if (result) + { + getImpl()->getRenderLayout() = newRenderLayout; + mSemantics = newSemantics; + } + } + } + + virtual void free() + { + RenderEntityIntlImpl<Impl, IofxSharedRenderDataBase>::free(); + + mSemantics = 0; + getImpl()->getRenderLayout().setDefaults(); + } + + virtual void* getBufferMappedPtr() const + { + return getImpl()->getRenderBufferState().getMappedPtr(); + } +#if APEX_CUDA_SUPPORT + virtual CUdeviceptr getBufferMappedCudaPtr() const + { + return getImpl()->getRenderBufferState().getMappedCudaPtr(); + } +#endif + + virtual size_t getRenderBufferSize() const + { + return getImpl()->getRenderBufferDesc().size; + } + + typedef SRDT SharedRenderData_t; + + PX_INLINE const SharedRenderData_t& getSharedRenderData() const + { + return mSharedRenderData; + } + +protected: + IofxSharedRenderDataImpl(uint32_t instance, RenderInteropFlags::Enum interopFlags) + : RenderEntityIntlImpl<Impl, IofxSharedRenderDataBase>(interopFlags) + { + mInstanceID = instance; + mSharedRenderData.maxObjectCount = 0; + mSharedRenderData.activeObjectCount = 0; + } + + SharedRenderData_t mSharedRenderData; +}; + +class IofxSharedRenderDataMeshImpl : public IofxSharedRenderDataImpl<IofxSharedRenderDataMeshImpl, IofxMeshSharedRenderData> +{ +public: + typedef IofxMeshRenderLayout RenderLayout_t; + + IofxSharedRenderDataMeshImpl(uint32_t instance, RenderInteropFlags::Enum interopFlags) + : IofxSharedRenderDataImpl<IofxSharedRenderDataMeshImpl, IofxMeshSharedRenderData>(instance, interopFlags) + { + mSharedRenderData.meshRenderBuffer = NULL; + } + + PX_INLINE const UserRenderBufferDesc& getRenderBufferDesc() const + { + return mSharedRenderData.meshRenderLayout.bufferDesc; + } + PX_INLINE const RenderBufferStateIntl& getRenderBufferState() const + { + return mMeshBufferState; + } + PX_INLINE RenderLayout_t& getRenderLayout() + { + return mSharedRenderData.meshRenderLayout; + } + PX_INLINE const RenderLayout_t& getRenderLayout() const + { + return mSharedRenderData.meshRenderLayout; + } + // + PX_INLINE uint32_t getRenderStorageCount() const + { + return (mSharedRenderData.meshRenderBuffer != NULL) ? 1u : 0u; + } + PX_INLINE RenderStorageStateIntl& getRenderStorage(uint32_t index, UserRenderStorage* &renderStorage, RenderInteropFlags::Enum &interopFlags) + { + PX_UNUSED(index); + PX_ASSERT(index == 0); + renderStorage = mSharedRenderData.meshRenderBuffer; + interopFlags = mSharedRenderData.meshRenderLayout.bufferDesc.interopFlags; + return mMeshBufferState; + } + PX_INLINE void onMapRenderStorage(uint32_t index) + { + PX_UNUSED(index); + PX_ASSERT(index == 0); + mMeshBufferState.setMapRange(0, mSharedRenderData.activeObjectCount * mSharedRenderData.meshRenderLayout.stride); + } + // + + bool createRenderLayout(IofxScene& iofxScene, uint32_t semantics, uint32_t maxObjectCount, RenderLayout_t& newRenderLayout); + bool allocAllRenderStorage(const RenderLayout_t& newRenderLayout, IofxRenderCallback* callback); + void freeAllRenderStorage(); + +private: + IofxSharedRenderDataMeshImpl& operator=(const IofxSharedRenderDataMeshImpl&); + + RenderBufferStateIntl mMeshBufferState; +}; + +class IofxSharedRenderDataSpriteImpl : public IofxSharedRenderDataImpl<IofxSharedRenderDataSpriteImpl, IofxSpriteSharedRenderData> +{ +public: + typedef IofxSpriteRenderLayout RenderLayout_t; + + IofxSharedRenderDataSpriteImpl(uint32_t instance, RenderInteropFlags::Enum interopFlags) + : IofxSharedRenderDataImpl<IofxSharedRenderDataSpriteImpl, IofxSpriteSharedRenderData>(instance, interopFlags) + { + mSharedRenderData.spriteRenderBuffer = NULL; + for (uint32_t i = 0; i < IofxSpriteRenderLayout::MAX_SURFACE_COUNT; ++i) + { + mSharedRenderData.spriteRenderSurfaces[i] = NULL; + } + } + + PX_INLINE const UserRenderBufferDesc& getRenderBufferDesc() const + { + return mSharedRenderData.spriteRenderLayout.bufferDesc; + } + PX_INLINE const RenderBufferStateIntl& getRenderBufferState() const + { + return mSpriteBufferState; + } + PX_INLINE RenderLayout_t& getRenderLayout() + { + return mSharedRenderData.spriteRenderLayout; + } + PX_INLINE const RenderLayout_t& getRenderLayout() const + { + return mSharedRenderData.spriteRenderLayout; + } + + // + PX_INLINE uint32_t getRenderStorageCount() const + { + if (mSharedRenderData.spriteRenderLayout.surfaceCount > 0) + { + return mSharedRenderData.spriteRenderLayout.surfaceCount; + } + else + { + return (mSharedRenderData.spriteRenderBuffer != NULL) ? 1u : 0u; + } + } + PX_INLINE RenderStorageStateIntl& getRenderStorage(uint32_t index, UserRenderStorage* &renderStorage, RenderInteropFlags::Enum &interopFlags) + { + if (mSharedRenderData.spriteRenderLayout.surfaceCount > 0) + { + PX_ASSERT(index < mSharedRenderData.spriteRenderLayout.surfaceCount); + renderStorage = mSharedRenderData.spriteRenderSurfaces[index]; + interopFlags = mSharedRenderData.spriteRenderLayout.surfaceDescs[index].interopFlags; + return mSpriteSurfaceStateArray[index]; + } + else + { + PX_ASSERT(index == 0); + renderStorage = mSharedRenderData.spriteRenderBuffer; + interopFlags = mSharedRenderData.spriteRenderLayout.bufferDesc.interopFlags; + return mSpriteBufferState; + } + } + PX_INLINE void onMapRenderStorage(uint32_t index) + { + if (mSharedRenderData.spriteRenderLayout.surfaceCount == 0) + { + PX_UNUSED(index); + PX_ASSERT(index == 0); + mSpriteBufferState.setMapRange(0, mSharedRenderData.activeObjectCount * mSharedRenderData.spriteRenderLayout.stride); + } + } + // + + bool createRenderLayout(IofxScene& iofxScene, uint32_t semantics, uint32_t maxObjectCount, RenderLayout_t& newRenderLayout); + bool allocAllRenderStorage(const RenderLayout_t& newRenderLayout, IofxRenderCallback* callback); + void freeAllRenderStorage(); + +#if APEX_CUDA_SUPPORT + + PX_INLINE CUarray getSurfaceMappedCudaArray(uint32_t index) const + { + PX_ASSERT(index < IofxSpriteRenderLayout::MAX_SURFACE_COUNT); + return mSpriteSurfaceStateArray[index].getMappedCudaArray(); + } +#endif + + PX_INLINE bool getSurfaceMappedInfo(uint32_t index, UserRenderSurface::MappedInfo& mappedInfo) const + { + PX_ASSERT(index < IofxSpriteRenderLayout::MAX_SURFACE_COUNT); + mappedInfo = mSpriteSurfaceStateArray[index].getMappedInfo(); + return mSpriteSurfaceStateArray[index].isMapped(); + } + +private: + IofxSharedRenderDataSpriteImpl& operator=(const IofxSharedRenderDataSpriteImpl&); + + RenderBufferStateIntl mSpriteBufferState; + RenderSurfaceStateIntl mSpriteSurfaceStateArray[IofxSpriteRenderLayout::MAX_SURFACE_COUNT]; +}; + + +class IofxRenderableImpl : public IofxRenderable, public UserAllocated, public ApexRWLockable +{ +public: + // IofxRenderable methods + virtual const physx::PxBounds3& getBounds() const + { + return mRenderBounds; + } + + virtual void update(IofxSharedRenderDataBase* sharedRenderData, const physx::PxBounds3& bounds, uint32_t startIndex, uint32_t objectCount, uint32_t visibleCount) = 0; + + virtual void release() + { + bool triggerDelete = false; + mRefCountLock.lock(); + if (mRefCount > 0) + { + triggerDelete = !(--mRefCount); + } + mRefCountLock.unlock(); + if (triggerDelete) + { + if (mRenderCallback != NULL) + { + mRenderCallback->onReleasingIofxRenderable(*this); + } + delete this; + } + } + + // Returns this if successful, NULL otherwise + IofxRenderable* incrementReferenceCount() + { + IofxRenderable* returnValue = NULL; + mRefCountLock.lock(); + if (mRefCount > 0) + { + ++mRefCount; + returnValue = this; + } + mRefCountLock.unlock(); + return returnValue; + } + + PX_INLINE int32_t getReferenceCount() const + { + return mRefCount; + } + + virtual ~IofxRenderableImpl() + { + WRITE_ZONE(); + + PX_ASSERT(mRefCount == 0); + if (mSharedRenderData != NULL) + { + mSharedRenderData->release(); + } + if (mRenderResID != INVALID_RESOURCE_ID) + { + //this call decrements resource refCount + GetInternalApexSDK()->getInternalResourceProvider()->releaseResource(mRenderResID); + } + } + +protected: + IofxRenderableImpl(IofxScene* iofxScene) + : mRefCount(1) // Ref count initialized to 1, assuming that whoever calls this constructor will store a reference + , mRenderCallback(iofxScene->getIofxRenderCallback()) + , mSharedRenderData(NULL) + , mRenderResID(INVALID_RESOURCE_ID) + { + mRenderBounds.setEmpty(); + } + + void initRenderResource(ResID renderResID, IofxCommonRenderData& renderData) + { + mRenderResID = renderResID; + if (mRenderResID != INVALID_RESOURCE_ID) + { + ResourceProviderIntl* nrp = GetInternalApexSDK()->getInternalResourceProvider(); + renderData.renderResourceNameSpace = nrp->getResourceNameSpace(mRenderResID); + renderData.renderResourceName = nrp->getResourceName(mRenderResID); + renderData.renderResource = nrp->getResource(mRenderResID); + //this call increments resource refCount + nrp->setResource(renderData.renderResourceNameSpace, renderData.renderResourceName, renderData.renderResource, true, true); + } + else + { + renderData.renderResourceNameSpace = renderData.renderResourceName = ""; + renderData.renderResource = NULL; + } + } + + void update(IofxSharedRenderDataBase* sharedRenderData, const physx::PxBounds3& bounds) + { + if (mSharedRenderData != sharedRenderData) + { + if (mSharedRenderData != NULL) + { + mSharedRenderData->release(); + } + mSharedRenderData = sharedRenderData->incrementReferenceCount(); + } + mRenderBounds = bounds; + if (mRenderCallback != NULL) + { + mRenderCallback->onUpdatedIofxRenderable(*this); + } + } + + volatile int32_t mRefCount; + AtomicLock mRefCountLock; + + IofxRenderCallback* mRenderCallback; + IofxSharedRenderDataBase* mSharedRenderData; + + physx::PxBounds3 mRenderBounds; + + ResID mRenderResID; + + friend class IofxActorImpl; +}; + +class IofxMeshRenderable : public IofxRenderableImpl +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + IofxMeshRenderable(IofxScene* iofxScene, ResID renderResID) + : IofxRenderableImpl(iofxScene) + { + mMeshRenderData.startIndex = mMeshRenderData.objectCount = 0; + mMeshRenderData.sharedRenderData = NULL; + + initRenderResource(renderResID, mMeshRenderData); + ApexRenderMeshAsset* rma = static_cast<ApexRenderMeshAsset*>(static_cast<Asset*>(mMeshRenderData.renderResource)); + if (rma != NULL) + { + UserOpaqueMesh* opaqueMesh = rma->getOpaqueMesh(); + if (opaqueMesh != NULL) + { + //this call increments resource refCount + GetInternalApexSDK()->getInternalResourceProvider()->setResource(APEX_OPAQUE_MESH_NAME_SPACE, rma->getName(), opaqueMesh, true, true); + } + } + + if (mRenderCallback != NULL) + { + mRenderCallback->onCreatedIofxRenderable(*this); + } + } + + virtual ~IofxMeshRenderable() + { + ApexRenderMeshAsset* rma = static_cast<ApexRenderMeshAsset*>(static_cast<Asset*>(mMeshRenderData.renderResource)); + if (rma != NULL) + { + UserOpaqueMesh* opaqueMesh = rma->getOpaqueMesh(); + if (opaqueMesh != NULL) + { + //this call decrements resource refCount + GetInternalApexSDK()->getNamedResourceProvider()->releaseResource(APEX_OPAQUE_MESH_NAME_SPACE, rma->getName()); + } + } + } + + // IofxRenderableImpl methods + virtual void update(IofxSharedRenderDataBase* sharedRenderData, const physx::PxBounds3& bounds, uint32_t startIndex, uint32_t objectCount, uint32_t visibleCount) + { + mMeshRenderData.startIndex = startIndex; + mMeshRenderData.objectCount = objectCount; + PX_UNUSED(visibleCount); + mMeshRenderData.sharedRenderData = &(static_cast<IofxSharedRenderDataMeshImpl*>(sharedRenderData)->getSharedRenderData()); + IofxRenderableImpl::update(sharedRenderData, bounds); + } + + virtual Type getType() const + { + return IofxRenderable::MESH; + } + + virtual const IofxSpriteRenderData* getSpriteRenderData() const + { + return NULL; + } + + virtual const IofxMeshRenderData* getMeshRenderData() const + { + return &mMeshRenderData; + } + +private: + IofxMeshRenderData mMeshRenderData; +}; + +class IofxSpriteRenderable : public IofxRenderableImpl +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + IofxSpriteRenderable(IofxScene* iofxScene, ResID renderResID) + : IofxRenderableImpl(iofxScene) + { + mSpriteRenderData.startIndex = mSpriteRenderData.objectCount = 0; + mSpriteRenderData.visibleCount = 0; + mSpriteRenderData.sharedRenderData = NULL; + + initRenderResource(renderResID, mSpriteRenderData); + + if (mRenderCallback != NULL) + { + mRenderCallback->onCreatedIofxRenderable(*this); + } + } + + virtual void update(IofxSharedRenderDataBase* sharedRenderData, const physx::PxBounds3& bounds, uint32_t startIndex, uint32_t objectCount, uint32_t visibleCount) + { + mSpriteRenderData.startIndex = startIndex; + mSpriteRenderData.objectCount = objectCount; + mSpriteRenderData.visibleCount = visibleCount; + mSpriteRenderData.sharedRenderData = &(static_cast<IofxSharedRenderDataSpriteImpl*>(sharedRenderData)->getSharedRenderData()); + IofxRenderableImpl::update(sharedRenderData, bounds); + } + + virtual Type getType() const + { + return IofxRenderable::SPRITE; + } + + virtual const IofxSpriteRenderData* getSpriteRenderData() const + { + return &mSpriteRenderData; + } + + virtual const IofxMeshRenderData* getMeshRenderData() const + { + return NULL; + } + +private: + IofxSpriteRenderData mSpriteRenderData; +}; + + +class IofxRenderBuffer : public UserRenderBuffer, public UserAllocated +{ +public: + IofxRenderBuffer(const UserRenderBufferDesc& desc) + { + mData = shdfnd::getAllocator().allocate(desc.size, "", __FILE__, __LINE__); + if (mData == NULL) + { + PX_ASSERT(!"IofxRenderBuffer: failed to allocate CPU memory!"); + } + } + + virtual ~IofxRenderBuffer() + { + if (mData) + { + shdfnd::getAllocator().deallocate(mData); + mData = NULL; + } + } + + virtual void release() + { + PX_DELETE(this); + } + + //CPU access + virtual void* map(RenderMapType::Enum mapType, size_t offset, size_t size) + { + PX_UNUSED(mapType); + PX_UNUSED(size); + return mData ? static_cast<uint8_t*>(mData) + offset : NULL; + } + virtual void unmap() + { + //do nothing! + } + + //GPU access + virtual bool getCUDAgraphicsResource(CUgraphicsResource &ret) + { + PX_UNUSED(ret); + return false; + } + +private: + void* mData; +}; + + +class IofxRenderSurface : public UserRenderSurface, public UserAllocated +{ +public: + IofxRenderSurface(const UserRenderSurfaceDesc& desc) + { + mPitch = uint32_t(desc.width) * RenderDataFormat::getFormatDataSize(desc.format); + mData = shdfnd::getAllocator().allocate(mPitch * desc.height, "", __FILE__, __LINE__); + if (mData == 0) + { + PX_ASSERT(!"IofxRenderSurface: failed to allocate CPU memory!"); + } + } + + virtual ~IofxRenderSurface() + { + if (mData) + { + shdfnd::getAllocator().deallocate(mData); + mData = 0; + } + } + + virtual void release() + { + PX_DELETE(this); + } + + //CPU access + virtual bool map(RenderMapType::Enum mapType, MappedInfo& info) + { + PX_UNUSED(mapType); + PX_ASSERT(mapType == RenderMapType::MAP_READ); + if (mData) + { + info.pData= mData; + info.rowPitch = mPitch; + info.depthPitch = 0; + return true; + } + return false; + } + virtual void unmap() + { + //do nothing! + } + + //GPU access + virtual bool getCUDAgraphicsResource(CUgraphicsResource &ret) + { + PX_UNUSED(ret); + return false; + } + +private: + void* mData; + uint32_t mPitch; +}; + +class IofxRenderCallbackImpl : public IofxRenderCallback +{ +public: + virtual UserRenderBuffer* createRenderBuffer(const UserRenderBufferDesc& desc) + { + return PX_NEW(IofxRenderBuffer)(desc); + } + virtual UserRenderSurface* createRenderSurface(const UserRenderSurfaceDesc& desc) + { + return PX_NEW(IofxRenderSurface)(desc); + } +}; + + +} +} // namespace nvidia + +#endif /* __IOFX_RENDER_DATA_H__ */ diff --git a/APEX_1.4/module/iofx/include/IofxScene.h b/APEX_1.4/module/iofx/include/IofxScene.h new file mode 100644 index 00000000..d16edb02 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxScene.h @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_SCENE_H__ +#define __IOFX_SCENE_H__ + +#include "Apex.h" +#include "ModuleIofx.h" + +#include "ApexSDKIntl.h" +#include "ModuleIntl.h" +#include "ApexContext.h" +#include "ApexSDKHelpers.h" +#include "RenderVolumeImpl.h" + +#include "PxGpuCopyDescQueue.h" + +namespace nvidia +{ +namespace apex +{ +class SceneIntl; +class IofxManagerDescIntl; +class DebugRenderParams; +class IofxRenderCallback; +} +namespace iofx +{ + +class ModuleIofxImpl; +class IofxDebugRenderParams; +class IofxManager; + +class IofxScene; + +class IofxRenderableIteratorImpl : public IofxRenderableIterator, public ApexRWLockable, public UserAllocated +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + virtual IofxRenderable* getFirst(); + virtual IofxRenderable* getNext(); + virtual void release() + { + PX_DELETE(this); + } + + IofxRenderableIteratorImpl(IofxScene& iofxScene) + : mIofxScene(iofxScene), mVolumeCount(0), mVolumeIndex(0) + , mActorCount(0), mActorIndex(0), mActorList(NULL) + { + } + +private: + PX_INLINE IofxRenderable* findNextInActorList(); + IofxRenderable* findFirstInNotEmptyVolume(); + + IofxScene& mIofxScene; + + uint32_t mVolumeCount; + uint32_t mVolumeIndex; + + uint32_t mActorCount; + uint32_t mActorIndex; + nvidia::apex::IofxActor* const* mActorList; +}; + +class IofxScene : public ModuleSceneIntl, public ApexContext, public ApexResourceInterface, public ApexResource +{ +public: + enum StatsDataEnum + { + SimulatedSpriteParticlesCount, + SimulatedMeshParticlesCount, + // insert new items before this line + NumberOfStats // The number of stats + }; +public: + IofxScene(ModuleIofxImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list); + ~IofxScene(); + + /* ModuleSceneIntl */ + void visualize(); + void setModulePhysXScene(PxScene* s); + PxScene* getModulePhysXScene() const + { + return mPhysXScene; + } + PxScene* mPhysXScene; + + virtual Module* getModule(); + + virtual SceneStats* getStats() + { + return &mModuleSceneStats; + } + + bool lockRenderResources() + { + renderLockAllActors(); // Lock options not implemented yet + return true; + } + + bool unlockRenderResources() + { + renderUnLockAllActors(); // Lock options not implemented yet + return true; + } + + /* ApexResourceInterface */ + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + void release(); + + virtual IofxManager* createIofxManager(const IofxAsset& asset, const IofxManagerDescIntl& desc); + void releaseIofxManager(IofxManager* manager); + + void submitTasks(float elapsedTime, float substepSize, uint32_t numSubSteps); + void fetchResults(); + + void fetchResultsPreRenderLock() + { + lockLiveRenderVolumes(); + } + void fetchResultsPostRenderUnlock() + { + unlockLiveRenderVolumes(); + } + + virtual void prepareRenderables(); + + PX_INLINE void lockLiveRenderVolumes(); + PX_INLINE void unlockLiveRenderVolumes(); + + void createModuleStats(void); + void destroyModuleStats(void); + void setStatValue(StatsDataEnum index, StatValue dataVal); + + void setIofxRenderCallback(IofxRenderCallback* callback) + { + mRenderCallback = callback; + } + IofxRenderCallback* getIofxRenderCallback() const + { + return mRenderCallback; + } + IofxRenderableIterator* createIofxRenderableIterator() + { + return PX_NEW(IofxRenderableIteratorImpl)(*this); + } + + + ModuleIofxImpl* mModule; + SceneIntl* mApexScene; + RenderDebugInterface* mDebugRender; + + nvidia::Mutex mFetchResultsLock; + shdfnd::ReadWriteLock mManagersLock; + + shdfnd::ReadWriteLock mLiveRenderVolumesLock; + nvidia::Mutex mAddedRenderVolumesLock; + nvidia::Mutex mDeletedRenderVolumesLock; + + ResourceList mActorManagers; + + physx::Array<RenderVolumeImpl*> mLiveRenderVolumes; + physx::Array<RenderVolumeImpl*> mAddedRenderVolumes; + physx::Array<RenderVolumeImpl*> mDeletedRenderVolumes; + + DebugRenderParams* mDebugRenderParams; + IofxDebugRenderParams* mIofxDebugRenderParams; + + SceneStats mModuleSceneStats; + + uint32_t mPrevTotalSimulatedSpriteParticles; + uint32_t mPrevTotalSimulatedMeshParticles; + + IofxRenderCallback* mRenderCallback; + + void destroy(); + + void processDeferredRenderVolumes(); +}; + +} +} // namespace nvidia + +#endif diff --git a/APEX_1.4/module/iofx/include/IofxSceneCPU.h b/APEX_1.4/module/iofx/include/IofxSceneCPU.h new file mode 100644 index 00000000..358e5963 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxSceneCPU.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_SCENE_CPU_H__ +#define __IOFX_SCENE_CPU_H__ + +#if ENABLE_TEST +#include "IofxTestScene.h" +#define IOFX_SCENE IofxTestScene +#else +#include "IofxScene.h" +#define IOFX_SCENE IofxScene +#endif + +namespace nvidia +{ +namespace iofx +{ + +class IofxSceneCPU : public IOFX_SCENE +{ +public: + IofxSceneCPU(ModuleIofxImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list); +}; + +} +} // namespace nvidia + +#endif diff --git a/APEX_1.4/module/iofx/include/IofxSceneGPU.h b/APEX_1.4/module/iofx/include/IofxSceneGPU.h new file mode 100644 index 00000000..acba3ff4 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IofxSceneGPU.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOFX_SCENE_GPU_H__ +#define __IOFX_SCENE_GPU_H__ + +#if ENABLE_TEST +#include "IofxTestScene.h" +#define IOFX_SCENE IofxTestScene +#else +#include "IofxScene.h" +#define IOFX_SCENE IofxScene +#endif + +#if APEX_CUDA_SUPPORT + +#include "ApexCudaWrapper.h" +#include "ApexCuda.h" +#include "CudaModuleScene.h" + +#include "../cuda/include/common.h" +#include "ModifierData.h" + +#define SCENE_CUDA_OBJ(scene, name) static_cast<IofxSceneGPU&>(scene).APEX_CUDA_OBJ_NAME(name) + +namespace nvidia +{ +namespace iofx +{ + +class IofxSceneGPU : public IOFX_SCENE, public CudaModuleScene +{ +public: + IofxSceneGPU(ModuleIofxImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list); + ~IofxSceneGPU(); + + void submitTasks(float elapsedTime, float substepSize, uint32_t numSubSteps); + + virtual void prepareRenderables(); + + void* getHeadCudaObj() + { + return CudaModuleScene::getHeadCudaObj(); + } + +//CUDA module objects +#include "../cuda/include/moduleList.h" + +protected: + /* device and host pinned buffers, etc */ + PxCudaContextManager* mContextManager; + + nvidia::Array<CUgraphicsResource> mToMapArray, mToUnmapArray; +}; + +} +} // namespace nvidia + +#endif +#endif diff --git a/APEX_1.4/module/iofx/include/IosObjectData.h b/APEX_1.4/module/iofx/include/IosObjectData.h new file mode 100644 index 00000000..62c1bff9 --- /dev/null +++ b/APEX_1.4/module/iofx/include/IosObjectData.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __IOS_OBJECT_DATA_H__ +#define __IOS_OBJECT_DATA_H__ + +#include "ApexUsingNamespace.h" +#include "PsUserAllocated.h" +#include "PsSync.h" +#include "PxVec3.h" +#include "PxVec4.h" +#include "IofxManagerIntl.h" +#include "PxMat33.h" +#include "ApexMirroredArray.h" +#include "ApexMath.h" + +#include "IofxRenderData.h" +#include "ModifierData.h" + +namespace physx +{ +class PxCudaContextManager; +} + +namespace nvidia +{ +namespace iofx +{ + +class IosObjectBaseData : public IofxManagerDescIntl, public IosBufferDescIntl, public UserAllocated +{ +public: + IosObjectBaseData(uint32_t instance) + : instanceID(instance) + , renderData(NULL) + , maxStateID(0) + , maxInputID(0) + , numParticles(0) + { + } + virtual ~IosObjectBaseData() + { + if (renderData) + { + renderData->release(); + } + } + + void updateSemantics(IofxScene& scene, uint32_t semantics) + { + if (renderData) + { + renderData->updateSemantics(scene, semantics, maxObjectCount, numParticles); + } + } + + PX_INLINE ModifierCommonParams getCommonParams() const + { + ModifierCommonParams common; + + common.inputHasCollision = iosSupportsCollision; + common.inputHasDensity = iosSupportsDensity; + common.inputHasUserData = iosSupportsUserData; + common.upVector = upVector; + common.eyePosition = eyePosition; + common.eyeDirection = eyeDirection; + common.eyeAxisX = eyeAxisX; + common.eyeAxisY = eyeAxisY; + common.zNear = zNear; + common.deltaTime = deltaTime; + + return common; + } + + const uint32_t instanceID; + + PxVec3 upVector; + float radius; + float gravity; + float restDensity; //!< resting density of simulation + + float elapsedTime; //!< total simulation time + float deltaTime; //!< SceneIntl::getElapsedTime() + PxVec3 eyePosition; //!< Scene::getEyePosition() + PxVec3 eyeDirection; //!< Scene::getEyeDirection() + PxVec3 eyeAxisX; + PxVec3 eyeAxisY; + float zNear; + + uint32_t maxStateID; //!< From IOS each frame + uint32_t maxInputID; //!< From IOS each frame + uint32_t numParticles; //!< From IOS each frame + + IofxSharedRenderDataBase* renderData; + +private: + IosObjectBaseData& operator=(const IosObjectBaseData&); +}; + +class IosObjectCpuData : public IosObjectBaseData +{ +public: + IosObjectCpuData(uint32_t instance) + : IosObjectBaseData(instance) + , outputToState(NULL) + , sortingKeys(NULL) + { + } + + IofxSlice** inPubState; + IofxSlice** outPubState; + uint32_t numPubSlices; + + IofxSlice** inPrivState; + IofxSlice** outPrivState; + uint32_t numPrivSlices; + + uint32_t* outputToState; + + uint32_t* sortingKeys; +}; + +#if APEX_CUDA_SUPPORT +class IosObjectGpuData : public IosObjectBaseData +{ +public: + IosObjectGpuData(uint32_t instance) + : IosObjectBaseData(instance) + { + } +}; +#endif + +} +} // namespace nvidia + +#endif /* __IOS_OBJECT_DATA_H__ */ diff --git a/APEX_1.4/module/iofx/include/ModifierData.h b/APEX_1.4/module/iofx/include/ModifierData.h new file mode 100644 index 00000000..9a211bf1 --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModifierData.h @@ -0,0 +1,514 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __MODIFIER_DATA_H__ +#define __MODIFIER_DATA_H__ + +#include "ApexUsingNamespace.h" +#include "PxVec3.h" +#include <PxMat33.h> +#include "InplaceTypes.h" +#include "InplaceStorage.h" +#include "RandState.h" + +#include "../../../include/iofx/IofxRenderCallback.h" + +namespace nvidia +{ +namespace iofx +{ + +#ifndef __CUDACC__ +PX_INLINE float saturate(float x) +{ + return (x < 0.0f) ? 0.0f : (1.0f < x) ? 1.0f : x; +} +#endif + +// output color is RenderDataFormat::B8G8R8A8 +#define FLT_TO_BYTE(x) ( (unsigned int)(saturate(PxAbs(x)) * 255) ) +#define MAKE_COLOR_UBYTE4(r, g, b, a) ( ((r) << 16) | ((g) << 8) | ((b) << 0) | ((a) << 24) ) + + +class IosObjectBaseData; + +//struct ModifierCommonParams +#define INPLACE_TYPE_STRUCT_NAME ModifierCommonParams +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(InplaceBool, inputHasCollision) \ + INPLACE_TYPE_FIELD(InplaceBool, inputHasDensity) \ + INPLACE_TYPE_FIELD(InplaceBool, inputHasUserData) \ + INPLACE_TYPE_FIELD(PxVec3, upVector) \ + INPLACE_TYPE_FIELD(PxVec3, eyePosition) \ + INPLACE_TYPE_FIELD(PxVec3, eyeDirection) \ + INPLACE_TYPE_FIELD(PxVec3, eyeAxisX) \ + INPLACE_TYPE_FIELD(PxVec3, eyeAxisY) \ + INPLACE_TYPE_FIELD(float, zNear) \ + INPLACE_TYPE_FIELD(float, deltaTime) +#include INPLACE_TYPE_BUILD() + + +// Mesh structs +struct MeshInput +{ + PxVec3 position; + float mass; + PxVec3 velocity; + float liferemain; + float density; + PxVec3 collisionNormal; + uint32_t collisionFlags; + uint32_t userData; + + PX_INLINE void load(const IosObjectBaseData& objData, uint32_t pos); +}; + +struct MeshPublicState +{ + PxMat33 rotation; + PxVec3 scale; + + float color[4]; + + static APEX_CUDA_CALLABLE PX_INLINE void initDefault(MeshPublicState& state, float objectScale) + { + state.rotation = PxMat33(PxIdentity); + state.scale = PxVec3(objectScale); + + state.color[0] = 1.0f; + state.color[1] = 1.0f; + state.color[2] = 1.0f; + state.color[3] = 1.0f; + } +}; + +/* TODO: Private state size should be declared by each IOFX asset, so the IOS can allocate + * the private buffer dynamically based on the IOFX assets used with the IOS. Each asset would + * in turn be given an offset for their private data in this buffer. + */ +struct MeshPrivateState +{ + PxMat33 rotation; + + static APEX_CUDA_CALLABLE PX_INLINE void initDefault(MeshPrivateState& state) + { + state.rotation = PxMat33(PxIdentity); + } +}; + + +//struct MeshOutputLayout +#define INPLACE_TYPE_STRUCT_NAME MeshOutputLayout +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, stride) \ + INPLACE_TYPE_FIELD_N(uint32_t, offsets, IofxMeshRenderLayoutElement::MAX_COUNT) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + +#ifdef __CUDACC__ +#define WRITE_TO_FLOAT(data) { *((volatile float*)(sdata + ((offset) >> 2) * pitch) + idx) = (data); offset += 4; } +#define WRITE_TO_UINT(data) { *((volatile unsigned int*)(sdata + ((offset) >> 2) * pitch + idx)) = (data); offset += 4; } + + __device__ PX_INLINE void write(volatile unsigned int* sdata, unsigned int idx, unsigned int pitch, const MeshInput& input, const MeshPublicState& state, unsigned int outputID) const + { +#else +#define WRITE_TO_FLOAT(data) { *(float*)(outputPtr + outputID * stride + offset) = (data); offset += 4; } +#define WRITE_TO_UINT(data) { *(unsigned int*)(outputPtr + outputID * stride + offset) = (data); offset += 4; } + + PX_INLINE void write(uint32_t outputID, const MeshInput& input, const MeshPublicState& state, const uint8_t* outputPtr) const + { + if (outputPtr == NULL) + { + return; + } +#endif + uint32_t offset; + if ((offset = offsets[IofxMeshRenderLayoutElement::POSITION_FLOAT3]) != static_cast<uint32_t>(-1)) //POSITION: 3 dwords + { + WRITE_TO_FLOAT( input.position.x ) + WRITE_TO_FLOAT( input.position.y ) + WRITE_TO_FLOAT( input.position.z ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::ROTATION_SCALE_FLOAT3x3]) != static_cast<uint32_t>(-1)) //ROTATION_SCALE: 9 dwords + { + PxVec3 axis0 = state.rotation.column0 * state.scale.x; + PxVec3 axis1 = state.rotation.column1 * state.scale.y; + PxVec3 axis2 = state.rotation.column2 * state.scale.z; + + WRITE_TO_FLOAT( axis0.x ) + WRITE_TO_FLOAT( axis0.y ) + WRITE_TO_FLOAT( axis0.z ) + + WRITE_TO_FLOAT( axis1.x ) + WRITE_TO_FLOAT( axis1.y ) + WRITE_TO_FLOAT( axis1.z ) + + WRITE_TO_FLOAT( axis2.x ) + WRITE_TO_FLOAT( axis2.y ) + WRITE_TO_FLOAT( axis2.z ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::VELOCITY_LIFE_FLOAT4]) != static_cast<uint32_t>(-1)) //VELOCITY: 3 dwords + { + WRITE_TO_FLOAT( input.velocity.x ) + WRITE_TO_FLOAT( input.velocity.y ) + WRITE_TO_FLOAT( input.velocity.z ) + WRITE_TO_FLOAT( input.liferemain ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::DENSITY_FLOAT1]) != static_cast<uint32_t>(-1)) //DENSITY: 1 dword + { + WRITE_TO_FLOAT( input.density ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::COLOR_BGRA8]) != static_cast<uint32_t>(-1)) //COLOR: 1 dword + { + WRITE_TO_UINT( MAKE_COLOR_UBYTE4( FLT_TO_BYTE(state.color[0]), + FLT_TO_BYTE(state.color[1]), + FLT_TO_BYTE(state.color[2]), + FLT_TO_BYTE(state.color[3]) ) ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::COLOR_RGBA8]) != static_cast<uint32_t>(-1)) //COLOR: 1 dword + { + WRITE_TO_UINT( MAKE_COLOR_UBYTE4( FLT_TO_BYTE(state.color[2]), + FLT_TO_BYTE(state.color[1]), + FLT_TO_BYTE(state.color[0]), + FLT_TO_BYTE(state.color[3]) ) ) + + } + if ((offset = offsets[IofxMeshRenderLayoutElement::COLOR_FLOAT4]) != static_cast<uint32_t>(-1)) //COLOR_FLOAT4: 4 dword + { + WRITE_TO_FLOAT( state.color[0] ) + WRITE_TO_FLOAT( state.color[1] ) + WRITE_TO_FLOAT( state.color[2] ) + WRITE_TO_FLOAT( state.color[3] ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::USER_DATA_UINT1]) != static_cast<uint32_t>(-1)) //USER_DATA: 1 dword + { + WRITE_TO_UINT( input.userData ) + } + if ((offset = offsets[IofxMeshRenderLayoutElement::POSE_FLOAT3x4]) != static_cast<uint32_t>(-1)) //POSE: 12 dwords + { + PxVec3 axis0 = state.rotation.column0 * state.scale.x; + PxVec3 axis1 = state.rotation.column1 * state.scale.y; + PxVec3 axis2 = state.rotation.column2 * state.scale.z; + + WRITE_TO_FLOAT( axis0.x ) + WRITE_TO_FLOAT( axis1.x ) + WRITE_TO_FLOAT( axis2.x ) + WRITE_TO_FLOAT( input.position.x ) + + WRITE_TO_FLOAT( axis0.y ) + WRITE_TO_FLOAT( axis1.y ) + WRITE_TO_FLOAT( axis2.y ) + WRITE_TO_FLOAT( input.position.y ) + + WRITE_TO_FLOAT( axis0.z ) + WRITE_TO_FLOAT( axis1.z ) + WRITE_TO_FLOAT( axis2.z ) + WRITE_TO_FLOAT( input.position.z ) + } + } +#undef WRITE_TO_UINT +#undef WRITE_TO_FLOAT +}; + + +// Sprite structs +struct SpriteInput +{ + PxVec3 position; + float mass; + PxVec3 velocity; + float liferemain; + float density; + uint32_t userData; + + PX_INLINE void load(const IosObjectBaseData& objData, uint32_t pos); +}; + + +struct SpritePublicState +{ + PxVec3 scale; + float subTextureId; + float rotation; + + float color[4]; + + static APEX_CUDA_CALLABLE PX_INLINE void initDefault(SpritePublicState& state, float objectScale) + { + state.scale = PxVec3(objectScale); + + state.subTextureId = 0; + state.rotation = 0; + + state.color[0] = 1.0f; + state.color[1] = 1.0f; + state.color[2] = 1.0f; + state.color[3] = 1.0f; + } +}; + +/* TODO: Private state size should be declared by each IOFX asset, so the IOS can allocate + * the private buffer dynamically based on the IOFX assets used with the IOS. Each asset would + * in turn be given an offset for their private data in this buffer. + */ +struct SpritePrivateState +{ + float rotation; + float scale; + + static APEX_CUDA_CALLABLE PX_INLINE void initDefault(SpritePrivateState& state) + { + state.rotation = 0.0f; + state.scale = 1.0f; + } +}; + +//struct SpriteOutputLayout +#define INPLACE_TYPE_STRUCT_NAME SpriteOutputLayout +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, stride) \ + INPLACE_TYPE_FIELD_N(uint32_t, offsets, IofxSpriteRenderLayoutElement::MAX_COUNT) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + +#ifdef __CUDACC__ +#define WRITE_TO_FLOAT(data) { *((volatile float*)(sdata + ((offset) >> 2) * pitch) + idx) = (data); offset += 4; } +#define WRITE_TO_UINT(data) { *((volatile unsigned int*)(sdata + ((offset) >> 2) * pitch + idx)) = (data); offset += 4; } + + __device__ PX_INLINE void write(volatile unsigned int* sdata, unsigned int idx, unsigned int pitch, const SpriteInput& input, const SpritePublicState& state, unsigned int outputID) const + { +#else +#define WRITE_TO_FLOAT(data) { *(float*)(outputPtr + outputID * stride + offset) = (data); offset += 4; } +#define WRITE_TO_UINT(data) { *(unsigned int*)(outputPtr + outputID * stride + offset) = (data); offset += 4; } + + PX_INLINE void write(uint32_t outputID, const SpriteInput& input, const SpritePublicState& state, const uint8_t* outputPtr) const + { + if (outputPtr == NULL) + { + return; + } +#endif + uint32_t offset; + if((offset = offsets[IofxSpriteRenderLayoutElement::POSITION_FLOAT3]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( input.position.x ) + WRITE_TO_FLOAT( input.position.y ) + WRITE_TO_FLOAT( input.position.z ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::COLOR_BGRA8]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_UINT( MAKE_COLOR_UBYTE4(FLT_TO_BYTE(state.color[0]), + FLT_TO_BYTE(state.color[1]), + FLT_TO_BYTE(state.color[2]), + FLT_TO_BYTE(state.color[3])) ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::COLOR_RGBA8]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_UINT( MAKE_COLOR_UBYTE4(FLT_TO_BYTE(state.color[2]), + FLT_TO_BYTE(state.color[1]), + FLT_TO_BYTE(state.color[0]), + FLT_TO_BYTE(state.color[3])) ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::COLOR_FLOAT4]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( state.color[0] ) + WRITE_TO_FLOAT( state.color[1] ) + WRITE_TO_FLOAT( state.color[2] ) + WRITE_TO_FLOAT( state.color[3] ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::VELOCITY_FLOAT3]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( input.velocity.x ) + WRITE_TO_FLOAT( input.velocity.y ) + WRITE_TO_FLOAT( input.velocity.z ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::SCALE_FLOAT2]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( state.scale.x ) + WRITE_TO_FLOAT( state.scale.y ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::LIFE_REMAIN_FLOAT1]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( input.liferemain ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::DENSITY_FLOAT1]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( input.density ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::SUBTEXTURE_FLOAT1]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( state.subTextureId ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::ORIENTATION_FLOAT1]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_FLOAT( state.rotation ) + } + if((offset = offsets[IofxSpriteRenderLayoutElement::USER_DATA_UINT1]) != static_cast<uint32_t>(-1)) + { + WRITE_TO_UINT( input.userData ) + } + } +#undef WRITE_TO_UINT +#undef WRITE_TO_FLOAT +}; + +struct TextureOutputData +{ + uint16_t layout; + uint8_t widthShift; + uint8_t pitchShift; +}; + +struct SpriteTextureOutputLayout +{ + uint32_t textureCount; + TextureOutputData textureData[4]; + uint8_t* texturePtr[4]; + +#ifdef __CUDACC__ +//#define CHECK_PTR(N) true +#define WRITE_TO_FLOAT4(N, e0, e1, e2, e3) surf2Dwrite<float4>(make_float4(e0, e1, e2, e3), KERNEL_SURF_REF(APEX_CUDA_CONCAT(Output, N)), (x << 4), y); +#define WRITE_TO_UINT(N, data) surf2Dwrite<uint32_t>(data, KERNEL_SURF_REF(APEX_CUDA_CONCAT(Output, N)), (x << 2), y); + + __device__ PX_INLINE void write(volatile unsigned int* sdata, unsigned int idx, unsigned int pitch, const SpriteInput& input, const SpritePublicState& state, unsigned int outputID) const +#else +//#define CHECK_PTR(N) (texturePtr[N] != NULL) +#define WRITE_TO_FLOAT4(N, e0, e1, e2, e3) { *(PxVec4*)(texturePtr[N] + (y << textureData[N].pitchShift) + (x << 4)) = PxVec4(e0, e1, e2, e3); } +#define WRITE_TO_UINT(N, data) { *(unsigned int*)(texturePtr[N] + (y << textureData[N].pitchShift) + (x << 2)) = data; } + + PX_INLINE void write(unsigned int outputID, const SpriteInput& input, const SpritePublicState& state, const uint8_t*) const +#endif + { +#define WRITE_TO_TEXTURE(N) \ + if (N < textureCount) \ + { \ + const uint32_t y = (outputID >> textureData[N].widthShift); \ + const uint32_t x = outputID - (y << textureData[N].widthShift); \ + switch (textureData[N].layout) \ + { \ + case IofxSpriteRenderLayoutSurfaceElement::POSITION_FLOAT4: \ + WRITE_TO_FLOAT4(N, input.position.x, input.position.y, input.position.z, 1.0f ) \ + break; \ + case IofxSpriteRenderLayoutSurfaceElement::SCALE_ORIENT_SUBTEX_FLOAT4: \ + WRITE_TO_FLOAT4(N, state.scale.x, state.scale.y, state.rotation, state.subTextureId ) \ + break; \ + case IofxSpriteRenderLayoutSurfaceElement::COLOR_BGRA8: \ + WRITE_TO_UINT(N, MAKE_COLOR_UBYTE4( FLT_TO_BYTE(state.color[0]), FLT_TO_BYTE(state.color[1]), FLT_TO_BYTE(state.color[2]), FLT_TO_BYTE(state.color[3]) ) ) \ + break; \ + case IofxSpriteRenderLayoutSurfaceElement::COLOR_RGBA8: \ + WRITE_TO_UINT(N, MAKE_COLOR_UBYTE4( FLT_TO_BYTE(state.color[2]), FLT_TO_BYTE(state.color[1]), FLT_TO_BYTE(state.color[0]), FLT_TO_BYTE(state.color[3]) ) ) \ + break; \ + case IofxSpriteRenderLayoutSurfaceElement::COLOR_FLOAT4: \ + WRITE_TO_FLOAT4(N, state.color[0], state.color[1], state.color[2], state.color[3] ) \ + break; \ + } \ + } + + WRITE_TO_TEXTURE(0) + WRITE_TO_TEXTURE(1) + WRITE_TO_TEXTURE(2) + WRITE_TO_TEXTURE(3) + } +#undef WRITE_TO_TEXTURE +#undef WRITE_TO_UINT +#undef WRITE_TO_FLOAT4 +//#undef CHECK_PTR +}; + +//struct CurvePoint +#define INPLACE_TYPE_STRUCT_NAME CurvePoint +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, x) \ + INPLACE_TYPE_FIELD(float, y) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + APEX_CUDA_CALLABLE PX_INLINE CurvePoint() : x(0.0f), y(0.0f) {} + APEX_CUDA_CALLABLE PX_INLINE CurvePoint(float _x, float _y) : x(_x), y(_y) {} +}; + +APEX_CUDA_CALLABLE PX_INLINE float lerpPoints(float x, const CurvePoint& p0, const CurvePoint& p1) +{ + return ((x - p0.x) / (p1.x - p0.x)) * (p1.y - p0.y) + p0.y; +} + + +//struct Curve +#define INPLACE_TYPE_STRUCT_NAME Curve +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(InplaceArray<CurvePoint>, _pointArray) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + +#ifndef __CUDACC__ + PX_INLINE void resize(InplaceStorage& storage, uint32_t numPoints) + { + _pointArray.resize(storage, numPoints); + } + + PX_INLINE void setPoint(InplaceStorage& storage, const CurvePoint& point, uint32_t index) + { + _pointArray.updateElem(storage, point, index); + } +#endif + + INPLACE_TEMPL_ARGS_DEF + APEX_CUDA_CALLABLE PX_INLINE float evaluate(INPLACE_STORAGE_ARGS_DEF, float x) const + { + uint32_t count = _pointArray.getSize(); + if (count == 0) + { + return 0.0f; + } + + CurvePoint begPoint; + _pointArray.fetchElem(INPLACE_STORAGE_ARGS_VAL, begPoint, 0); + if (x <= begPoint.x) + { + return begPoint.y; + } + + CurvePoint endPoint; + _pointArray.fetchElem(INPLACE_STORAGE_ARGS_VAL, endPoint, count - 1); + if (x >= endPoint.x) + { + return endPoint.y; + } + + //do binary search + unsigned int beg = 0; + unsigned int end = count; + while (beg < end) + { + unsigned int mid = beg + ((end - beg) >> 1); + CurvePoint midPoint; + _pointArray.fetchElem(INPLACE_STORAGE_ARGS_VAL, midPoint, mid); + if (x < midPoint.x) + { + end = mid; + } + else + { + beg = mid + 1; + } + } + beg = PxMin<uint32_t>(beg, count - 1); + CurvePoint point0, point1; + _pointArray.fetchElem(INPLACE_STORAGE_ARGS_VAL, point0, beg - 1); + _pointArray.fetchElem(INPLACE_STORAGE_ARGS_VAL, point1, beg); + return lerpPoints(x, point0, point1); + } +}; + +} +} // namespace nvidia + +#endif /* __MODIFIER_DATA_H__ */ diff --git a/APEX_1.4/module/iofx/include/ModifierImpl.h b/APEX_1.4/module/iofx/include/ModifierImpl.h new file mode 100644 index 00000000..3eb671c9 --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModifierImpl.h @@ -0,0 +1,1154 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __MODIFIER_IMPL_H__ +#define __MODIFIER_IMPL_H__ + +#include "Modifier.h" +#include "CurveImpl.h" +#include "PsUserAllocated.h" + +#include "RotationModifierParams.h" +#include "SimpleScaleModifierParams.h" +#include "RandomScaleModifierParams.h" +#include "ScaleByMassModifierParams.h" +#include "ColorVsLifeModifierParams.h" +#include "ScaleVsLifeModifierParams.h" +#include "ScaleVsDensityModifierParams.h" +#include "ScaleVsCameraDistanceModifierParams.h" +#include "ColorVsDensityModifierParams.h" +#include "SubtextureVsLifeModifierParams.h" +#include "OrientAlongVelocityModifierParams.h" +#include "ScaleAlongVelocityModifierParams.h" +#include "RandomSubtextureModifierParams.h" +#include "RandomRotationModifierParams.h" +#include "ViewDirectionSortingModifierParams.h" +#include "RotationRateModifierParams.h" +#include "RotationRateVsLifeModifierParams.h" +#include "OrientScaleAlongScreenVelocityModifierParams.h" +#include "ColorVsVelocityModifierParams.h" + +#include "ParamArray.h" + +#include "PsArray.h" + +namespace nvidia +{ +namespace apex +{ +class InplaceStorage; +class InplaceHandleBase; +struct RandState; +} +namespace iofx +{ + +/** + Directions for adding a new APEX modifier type (an official modifier, not a user modifier). + + 1) In Modifier.h, add a value to the end of ModifierTypeEnum, matching the naming convention of others. + 2) In Modifier.h, add a new subclass of ModifierT, specialized on your type. + - e.g. class MyNewModifier : public ModifierT<NxMyNewModifier> { }; + 3) MyNewModifier should include pure virtual getters (by value), and setters. Do not promise to return + by const-reference. + 4) In ModifierImpl.h (this file), add a subcless of your public class and ApexAllocateable + - e.g. class MyNewModifier : public MyNewModifier, public UserAllocated { }; + 5) The ModifierImpl.h class should provide concrete implementations of all of the functions. + - Feel free to do the getters and setters inline in ModifierImpl.h + 6) In ModifierImpl.cpp, provide the implementations for the serailization functions and 'updateParticles.' +*/ + +// Ignore this warning temporarily. It's reset to default level at the bottom of the file. +// We'll fix this soon, just not "right this second" +#pragma warning( disable: 4100 ) + +class IofxModifierHelper +{ +public: + + // assumes the mParams class contains a "controlPoints" member + static void setCurve(const nvidia::apex::Curve* f, + NvParameterized::Interface* mParams, + ParamDynamicArrayStruct* controlPoints) + { + uint32_t cpSize; + f->getControlPoints(cpSize); + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("controlPoints", h); + h.resizeArray((int32_t)cpSize); + + ParamArray<ScaleVsCameraDistanceModifierParamsNS::vec2_Type> + cpArray(mParams, "controlPoints", controlPoints); + + for (uint32_t i = 0; i < cpSize; i++) + { + cpArray[i].x = f->getControlPoints(cpSize)[i].x; + cpArray[i].y = f->getControlPoints(cpSize)[i].y; + } + } +}; + + +class ModifierParamsMapperCPU +{ +public: + virtual void beginParams(void* params, size_t size, size_t align, uint32_t randomCount) = 0; + virtual void endParams() = 0; + + virtual void mapValue(size_t offset, int32_t value) = 0; + void mapValue(size_t offset, uint32_t value) + { + mapValue(offset, static_cast<int32_t>(value)); + } + + virtual void mapValue(size_t offset, float value) = 0; + void mapValue(size_t offset, const PxVec3& value) + { + mapValue(offset + offsetof(PxVec3, x), value.x); + mapValue(offset + offsetof(PxVec3, y), value.y); + mapValue(offset + offsetof(PxVec3, z), value.z); + } + + virtual void mapCurve(size_t offset, const nvidia::apex::Curve* curve) = 0; +}; + +#if APEX_CUDA_SUPPORT + +class ModifierParamsMapperGPU +{ +public: + virtual InplaceStorage& getStorage() = 0; + + virtual void onParams(InplaceHandleBase handle, uint32_t randomCount) = 0; +}; +#endif + +struct MeshInput; +struct MeshPublicState; +struct MeshPrivateState; +struct SpriteInput; +struct SpritePublicState; +struct SpritePrivateState; +struct ModifierCommonParams; + +class ModifierImpl +{ +public: + static const ModifierImpl* castFrom(const Modifier*); + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const + { + PX_ASSERT(!"unimpl"); + } +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& /*mapper*/) const + { + PX_ASSERT(!"unimpl"); + } + + + typedef void (*updateSpriteFunc)(const void* params, const SpriteInput& input, SpritePublicState& pubState, SpritePrivateState& privState, const ModifierCommonParams& common, RandState& randState); + typedef void (*updateMeshFunc)(const void* params, const MeshInput& input, MeshPublicState& pubState, MeshPrivateState& privState, const ModifierCommonParams& common, RandState& randState); + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage /*stage*/) const + { + PX_ASSERT(!"unimpl"); + return 0; + } + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage /*stage*/) const + { + PX_ASSERT(!"unimpl"); + return 0; + } +}; + +// ------------------------------------------------------------------------------------------------ +class RotationModifierImpl : public RotationModifier, public ModifierImpl, public UserAllocated +{ +public: + RotationModifierImpl(RotationModifierParams* params); + + virtual ApexMeshParticleRollType::Enum getRollType() const + { + return mRollType; + } + virtual void setRollType(ApexMeshParticleRollType::Enum rollType); + virtual float getMaxSettleRate() const + { + return mParams->maxSettleRatePerSec; + } + virtual void setMaxSettleRate(float settleRate) + { + mParams->maxSettleRatePerSec = settleRate; + } + virtual float getMaxRotationRate() const + { + return mParams->maxRotationRatePerSec; + } + virtual void setMaxRotationRate(float rotationRate) + { + mParams->maxRotationRatePerSec = rotationRate; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, rollType), uint32_t(mRollType)); + mapper.mapValue(offsetof(Params, rollAxis), mRollAxis); + mapper.mapValue(offsetof(Params, rollSign), mRollSign); + + mapper.mapValue(offsetof(Params, maxSettleRatePerSec), mParams->maxSettleRatePerSec); + mapper.mapValue(offsetof(Params, maxRotationRatePerSec), mParams->maxRotationRatePerSec); + + mapper.mapValue(offsetof(Params, inAirRotationMultiplier), mParams->inAirRotationMultiplier); + mapper.mapValue(offsetof(Params, collisionRotationMultiplier), mParams->collisionRotationMultiplier); + + mapper.mapValue(offsetof(Params, includeVerticalDirection), uint32_t(mParams->includeVerticalDirection)); + + mapper.endParams(); + } + + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + RotationModifierParams* mParams; + ApexMeshParticleRollType::Enum mRollType; + int32_t mRollAxis; + float mRollSign; + float mLastUpdateTime; +}; + +// ------------------------------------------------------------------------------------------------ +class SimpleScaleModifierImpl : public SimpleScaleModifier, public ModifierImpl, public UserAllocated +{ +public: + SimpleScaleModifierImpl(SimpleScaleModifierParams* params); + + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SCALE); + } + + virtual PxVec3 getScaleFactor() const + { + return mParams->scaleFactor; + } + virtual void setScaleFactor(const PxVec3& s) + { + mParams->scaleFactor = s; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, scaleFactor), mParams->scaleFactor); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + SimpleScaleModifierParams* mParams; + +}; + +// ------------------------------------------------------------------------------------------------ +class ScaleByMassModifierImpl : public ScaleByMassModifier, public ModifierImpl, public UserAllocated +{ +public: + ScaleByMassModifierImpl(ScaleByMassModifierParams* params); + + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SCALE); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ScaleByMassModifierParams* mParams; + +}; + +// ------------------------------------------------------------------------------------------------ +class RandomScaleModifierImpl : public RandomScaleModifier, public ModifierImpl, public UserAllocated +{ +public: + RandomScaleModifierImpl(RandomScaleModifierParams* params); + + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SCALE); + } + + virtual Range<float> getScaleFactor() const + { + Range<float> s; + s.minimum = mParams->minScaleFactor; + s.maximum = mParams->maxScaleFactor; + return s; + } + + virtual void setScaleFactor(const Range<float>& s) + { + mParams->minScaleFactor = s.minimum; + mParams->maxScaleFactor = s.maximum; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, scaleFactorMin), mParams->minScaleFactor); + mapper.mapValue(offsetof(Params, scaleFactorMax), mParams->maxScaleFactor); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + RandomScaleModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class ColorVsLifeModifierImpl : public ColorVsLifeModifier, public ModifierImpl, public UserAllocated +{ +public: + ColorVsLifeModifierImpl(ColorVsLifeModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::COLOR); + } + virtual uint32_t getModifierMeshSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::COLOR); + } + + // Access to expected data members + virtual ColorChannel getColorChannel() const + { + return mColorChannel; + } + virtual void setColorChannel(ColorChannel colorChannel); + + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, channel), uint32_t(mColorChannel)); + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ColorVsLifeModifierParams* mParams; + ColorChannel mColorChannel; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class ColorVsDensityModifierImpl : public ColorVsDensityModifier, public ModifierImpl, public UserAllocated +{ +public: + ColorVsDensityModifierImpl(ColorVsDensityModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::COLOR); + } + virtual uint32_t getModifierMeshSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::COLOR); + } + + // Access to expected data members + virtual ColorChannel getColorChannel() const + { + return mColorChannel; + } + virtual void setColorChannel(ColorChannel colorChannel); + + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, channel), uint32_t(mColorChannel)); + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ColorVsDensityModifierParams* mParams; + ColorChannel mColorChannel; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class ColorVsVelocityModifierImpl : public ColorVsVelocityModifier, public ModifierImpl, public UserAllocated +{ +public: + ColorVsVelocityModifierImpl(ColorVsVelocityModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::COLOR); + } + virtual uint32_t getModifierMeshSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::COLOR); + } + + // Access to expected data members + virtual ColorChannel getColorChannel() const + { + return mColorChannel; + } + virtual void setColorChannel(ColorChannel colorChannel); + + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + + virtual float getVelocity0() const + { + return mParams->velocity0; + } + virtual void setVelocity0(float value) + { + mParams->velocity0 = value; + } + + virtual float getVelocity1() const + { + return mParams->velocity1; + } + virtual void setVelocity1(float value) + { + mParams->velocity1 = value; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, velocity0), mParams->velocity0); + mapper.mapValue(offsetof(Params, velocity1), mParams->velocity1); + mapper.mapValue(offsetof(Params, channel), uint32_t(mColorChannel)); + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ColorVsVelocityModifierParams* mParams; + ColorChannel mColorChannel; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class SubtextureVsLifeModifierImpl : public SubtextureVsLifeModifier, public ModifierImpl, public UserAllocated +{ +public: + SubtextureVsLifeModifierImpl(SubtextureVsLifeModifierParams* params); + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SUBTEXTURE); + } + + // Access to expected data members + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + SubtextureVsLifeModifierParams* mParams; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class OrientAlongVelocityModifierImpl : public OrientAlongVelocityModifier, public ModifierImpl, public UserAllocated +{ +public: + OrientAlongVelocityModifierImpl(OrientAlongVelocityModifierParams* params); + + // Methods from Modifier + + // Access to expected data members + virtual PxVec3 getModelForward() const + { + return mParams->modelForward; + } + virtual void setModelForward(const PxVec3& s) + { + mParams->modelForward = s; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, modelForward), mParams->modelForward); + + mapper.endParams(); + } + + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + OrientAlongVelocityModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class ScaleAlongVelocityModifierImpl : public ScaleAlongVelocityModifier, public ModifierImpl, public UserAllocated +{ +public: + ScaleAlongVelocityModifierImpl(ScaleAlongVelocityModifierParams* params); + + // Methods from Modifier + + // Access to expected data members + virtual float getScaleFactor() const + { + return mParams->scaleFactor; + } + virtual void setScaleFactor(const float& s) + { + mParams->scaleFactor = s; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, scaleFactor), mParams->scaleFactor); + + mapper.endParams(); + } + + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ScaleAlongVelocityModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class RandomSubtextureModifierImpl : public RandomSubtextureModifier, public ModifierImpl, public UserAllocated +{ +public: + RandomSubtextureModifierImpl(RandomSubtextureModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SUBTEXTURE); + } + + // Access to expected data members + virtual Range<float> getSubtextureRange() const + { + Range<float> s; + s.minimum = mParams->minSubtexture; + s.maximum = mParams->maxSubtexture; + return s; + } + + virtual void setSubtextureRange(const Range<float>& s) + { + mParams->minSubtexture = s.minimum; + mParams->maxSubtexture = s.maximum; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, subtextureRangeMin), mParams->minSubtexture); + mapper.mapValue(offsetof(Params, subtextureRangeMax), mParams->maxSubtexture); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + RandomSubtextureModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class RandomRotationModifierImpl : public RandomRotationModifier, public ModifierImpl, public UserAllocated +{ +public: + RandomRotationModifierImpl(RandomRotationModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::ORIENTATION); + } + + // Access to expected data members + virtual Range<float> getRotationRange() const + { + Range<float> s; + s.minimum = mParams->minRotation; + s.maximum = mParams->maxRotation; + return s; + } + + virtual void setRotationRange(const Range<float>& s) + { + mParams->minRotation = s.minimum; + mParams->maxRotation = s.maximum; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, rotationRangeMin), mParams->minRotation); + mapper.mapValue(offsetof(Params, rotationRangeMax), mParams->maxRotation); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + RandomRotationModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class ScaleVsLifeModifierImpl : public ScaleVsLifeModifier, public ModifierImpl, public UserAllocated +{ +public: + ScaleVsLifeModifierImpl(ScaleVsLifeModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SCALE); + } + + // Access to expected data members + virtual ScaleAxis getScaleAxis() const + { + return mScaleAxis; + } + virtual void setScaleAxis(ScaleAxis a); + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, axis), uint32_t(mScaleAxis)); + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ScaleVsLifeModifierParams* mParams; + ScaleAxis mScaleAxis; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class ScaleVsDensityModifierImpl : public ScaleVsDensityModifier, public ModifierImpl, public UserAllocated +{ +public: + ScaleVsDensityModifierImpl(ScaleVsDensityModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::SCALE); + } + + // Access to expected data members + virtual ScaleAxis getScaleAxis() const + { + return mScaleAxis; + } + virtual void setScaleAxis(ScaleAxis a); + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, axis), uint32_t(mScaleAxis)); + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ScaleVsDensityModifierParams* mParams; + ScaleAxis mScaleAxis; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class ScaleVsCameraDistanceModifierImpl : public ScaleVsCameraDistanceModifier, public ModifierImpl, public UserAllocated +{ +public: + ScaleVsCameraDistanceModifierImpl(ScaleVsCameraDistanceModifierParams* params); + + // Methods from Modifier + + // Access to expected data members + virtual ScaleAxis getScaleAxis() const + { + return mScaleAxis; + } + virtual void setScaleAxis(ScaleAxis a); + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, axis), uint32_t(mScaleAxis)); + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + virtual updateMeshFunc getUpdateMeshFunc(ModifierStage stage) const; + +private: + ScaleVsCameraDistanceModifierParams* mParams; + ScaleAxis mScaleAxis; + CurveImpl mCurveFunction; +}; + +/** + NvParameterized::Factory for modifiers. TODO: This should be a class that you instantiate, which you can then register objects with, + and that you then pass to the Asset class for deserialization. +*/ +Modifier* CreateModifier(ModifierTypeEnum modifierType, NvParameterized::Interface* objParam, NvParameterized::Handle& h); + +// ------------------------------------------------------------------------------------------------ +class ViewDirectionSortingModifierImpl : public ViewDirectionSortingModifier, public ModifierImpl, public UserAllocated +{ +public: + ViewDirectionSortingModifierImpl(ViewDirectionSortingModifierParams* params); + + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)0; + } + + // Access to expected data members + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + ViewDirectionSortingModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class RotationRateModifierImpl : public RotationRateModifier, public ModifierImpl, public UserAllocated +{ +public: + RotationRateModifierImpl(RotationRateModifierParams* params); + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::ORIENTATION); + } + + // Access to expected data members + virtual float getRotationRate() const + { + return mParams->rotationRate; + } + virtual void setRotationRate(const float& r) + { + mParams->rotationRate = r; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, rotationRate), mParams->rotationRate); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + RotationRateModifierParams* mParams; +}; + +// ------------------------------------------------------------------------------------------------ +class RotationRateVsLifeModifierImpl : public RotationRateVsLifeModifier, public ModifierImpl, public UserAllocated +{ +public: + RotationRateVsLifeModifierImpl(RotationRateVsLifeModifierParams* params); + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)(1 << IofxRenderSemantic::ORIENTATION); + } + + // Access to expected data members + virtual const nvidia::apex::Curve* getFunction() const + { + return static_cast<const nvidia::apex::Curve*>(&mCurveFunction); + } + virtual void setFunction(const nvidia::apex::Curve* f) + { + const CurveImpl* curve = static_cast<const CurveImpl*>(f); + mCurveFunction = *curve; + + IofxModifierHelper::setCurve(f, + mParams, + (ParamDynamicArrayStruct*)&mParams->controlPoints); + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapCurve(offsetof(Params, curve), static_cast<const CurveImpl*>(&mCurveFunction)); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + RotationRateVsLifeModifierParams* mParams; + CurveImpl mCurveFunction; +}; + +// ------------------------------------------------------------------------------------------------ +class OrientScaleAlongScreenVelocityModifierImpl : public OrientScaleAlongScreenVelocityModifier, public ModifierImpl, public UserAllocated +{ +public: + OrientScaleAlongScreenVelocityModifierImpl(OrientScaleAlongScreenVelocityModifierParams* params); + // Methods from Modifier + virtual uint32_t getModifierSpriteSemantics() + { + return (uint32_t)((1 << IofxRenderSemantic::ORIENTATION) | (1 << IofxRenderSemantic::SCALE)); + } + + // Access to expected data members + virtual float getScalePerVelocity() const + { + return mParams->scalePerVelocity; + } + virtual void setScalePerVelocity(const float& s) + { + mParams->scalePerVelocity = s; + } + + virtual float getScaleChangeLimit() const + { + return mParams->scaleChangeLimit; + } + virtual void setScaleChangeLimit(const float& s) + { + mParams->scaleChangeLimit = s; + } + + virtual float getScaleChangeDelay() const + { + return mParams->scaleChangeDelay; + } + virtual void setScaleChangeDelay(const float& s) + { + mParams->scaleChangeDelay = s; + } + +#if APEX_CUDA_SUPPORT + virtual void mapParamsGPU(ModifierParamsMapperGPU& mapper) const; +#endif + virtual void mapParamsCPU(ModifierParamsMapperCPU& mapper) const; + + template <class Mapper, typename Params> + void mapParams(Mapper& mapper, Params* params) const + { + mapper.beginParams(params, sizeof(Params), __alignof(Params), Params::RANDOM_COUNT); + + mapper.mapValue(offsetof(Params, scalePerVelocity), mParams->scalePerVelocity); + mapper.mapValue(offsetof(Params, scaleChangeLimit), mParams->scaleChangeLimit); + mapper.mapValue(offsetof(Params, scaleChangeDelay), mParams->scaleChangeDelay); + + mapper.endParams(); + } + + virtual updateSpriteFunc getUpdateSpriteFunc(ModifierStage stage) const; + +private: + OrientScaleAlongScreenVelocityModifierParams* mParams; +}; + +#pragma warning( default: 4100 ) + +} +} // namespace nvidia + +#endif /* __MODIFIER_IMPL_H__ */ diff --git a/APEX_1.4/module/iofx/include/ModifierList.h b/APEX_1.4/module/iofx/include/ModifierList.h new file mode 100644 index 00000000..e2831c4d --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModifierList.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef _MODIFIER +#define _MODIFIER(name) +#endif + +#ifndef _MODIFIER_SPRITE +#define _MODIFIER_SPRITE(name) +#endif + +#ifndef _MODIFIER_MESH +#define _MODIFIER_MESH(name) +#endif + +//All +_MODIFIER(Rotation) +_MODIFIER(SimpleScale) +_MODIFIER(RandomScale) +_MODIFIER(ScaleByMass) +_MODIFIER(ColorVsLife) +_MODIFIER(ColorVsDensity) +_MODIFIER(SubtextureVsLife) +_MODIFIER(OrientAlongVelocity) +_MODIFIER(ScaleAlongVelocity) +_MODIFIER(RandomSubtexture) +_MODIFIER(RandomRotation) +_MODIFIER(ScaleVsLife) +_MODIFIER(ScaleVsDensity) +_MODIFIER(ScaleVsCameraDistance) +_MODIFIER(ViewDirectionSorting) +_MODIFIER(RotationRate) +_MODIFIER(RotationRateVsLife) +_MODIFIER(OrientScaleAlongScreenVelocity) +_MODIFIER(ColorVsVelocity) + +//Sprite +_MODIFIER_SPRITE(SimpleScale) +_MODIFIER_SPRITE(RandomScale) +_MODIFIER_SPRITE(ScaleByMass) +_MODIFIER_SPRITE(ColorVsLife) +_MODIFIER_SPRITE(ColorVsDensity) +_MODIFIER_SPRITE(SubtextureVsLife) +_MODIFIER_SPRITE(RandomSubtexture) +_MODIFIER_SPRITE(RandomRotation) +_MODIFIER_SPRITE(ScaleVsLife) +_MODIFIER_SPRITE(ScaleVsDensity) +_MODIFIER_SPRITE(ScaleVsCameraDistance) +_MODIFIER_SPRITE(ViewDirectionSorting) +_MODIFIER_SPRITE(RotationRate) +_MODIFIER_SPRITE(RotationRateVsLife) +_MODIFIER_SPRITE(OrientScaleAlongScreenVelocity) +_MODIFIER_SPRITE(ColorVsVelocity) + +//Mesh +_MODIFIER_MESH(Rotation) +_MODIFIER_MESH(SimpleScale) +_MODIFIER_MESH(RandomScale) +_MODIFIER_MESH(ScaleByMass) +_MODIFIER_MESH(ColorVsLife) +_MODIFIER_MESH(ColorVsDensity) +_MODIFIER_MESH(OrientAlongVelocity) +_MODIFIER_MESH(ScaleAlongVelocity) +_MODIFIER_MESH(ScaleVsLife) +_MODIFIER_MESH(ScaleVsDensity) +_MODIFIER_MESH(ScaleVsCameraDistance) +_MODIFIER_MESH(ColorVsVelocity) + +#undef _MODIFIER +#undef _MODIFIER_SPRITE +#undef _MODIFIER_MESH diff --git a/APEX_1.4/module/iofx/include/ModifierSrc.h b/APEX_1.4/module/iofx/include/ModifierSrc.h new file mode 100644 index 00000000..c293c31a --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModifierSrc.h @@ -0,0 +1,921 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#if defined(__CUDACC__) && defined(__CUDA_ARCH__) && __CUDA_ARCH__ < 200 +#define _CUDA_OPT_LOC_MEM_ 1 +#else +#define _CUDA_OPT_LOC_MEM_ 0 +#endif + +#define PI 3.141592653589793f + +//--- Helpers + +APEX_CUDA_CALLABLE PX_INLINE unsigned int binSearch(float val, unsigned int count, const float* data) +{ + unsigned int beg = 0; + unsigned int end = count; + + while (beg < end) + { + unsigned int mid = beg + ((end - beg) >> 1); + if (val < data[mid]) + { + end = mid; + } + else + { + beg = mid + 1; + } + } + return beg; +} + +APEX_CUDA_CALLABLE PX_INLINE void approxAxisAngleToMat33(const PxVec3& axisAngle, PxMat33& rot) +{ + const float x = 0.5f * axisAngle.x; + const float y = 0.5f * axisAngle.y; + const float z = 0.5f * axisAngle.z; + const float xx = x * x; + const float yy = y * y; + const float zz = z * z; + const float xy = x * y; + const float yz = y * z; + const float zx = z * x; + const float twoRecipNorm2 = 2.0f / (1.0f + xx + yy + zz); // w = 1 + rot(0, 0) = 1.0f - twoRecipNorm2 * (yy + zz); + rot(0, 1) = twoRecipNorm2 * (xy - z); + rot(0, 2) = twoRecipNorm2 * (zx + y); + rot(1, 0) = twoRecipNorm2 * (xy + z); + rot(1, 1) = 1.0f - twoRecipNorm2 * (zz + xx); + rot(1, 2) = twoRecipNorm2 * (yz - x); + rot(2, 0) = twoRecipNorm2 * (zx - y); + rot(2, 1) = twoRecipNorm2 * (yz + x); + rot(2, 2) = 1.0f - twoRecipNorm2 * (xx + yy); +} + + +APEX_CUDA_CALLABLE PX_INLINE bool approxEquals(float a, float b, float eps) +{ + const float diff = PxAbs(a - b); + return (diff < eps); +} + +APEX_CUDA_CALLABLE PX_INLINE bool approxEquals(const PxVec3& a, const PxVec3& b, float eps) +{ + return approxEquals(a.x, b.x, eps) && + approxEquals(a.y, b.y, eps) && + approxEquals(a.z, b.z, eps); +} + +APEX_CUDA_CALLABLE PX_INLINE int maxAbsElementIndex(const PxVec3& v) +{ + const PxVec3 a(PxAbs(v.x), PxAbs(v.y), PxAbs(v.z)); + const int m01 = (a.y > a.x); + const int m2 = (a.z > a[(unsigned)m01]); + return (m2 << 1) | (m01 >> m2); +} + + +APEX_CUDA_CALLABLE PX_INLINE void generateRotationMatrix(const PxVec3& srcVec, const PxVec3& dstVec, PxMat33& outRotMat) +{ + if (approxEquals(srcVec, dstVec, 0.0001f)) + { + outRotMat = PxMat33(PxIdentity); + return; + } + + PxVec3 crossResult = srcVec.cross(dstVec); + crossResult *= PxAcos(srcVec.dot(dstVec)); + + approxAxisAngleToMat33(crossResult, outRotMat); +} + +APEX_CUDA_CALLABLE PX_INLINE void generateRandomRotation(const PxVec3& srcVec, PxMat33& outRotMat, nvidia::RandState& randState) +{ + PxVec3 tmpRotVec(srcVec); + tmpRotVec *= randState.nextFloat(0.0f, 2 * PI); + approxAxisAngleToMat33(tmpRotVec, outRotMat); +} + +// ------------------------------------------------------------------------------------------------ + + +//--- Rotation modifier --- + +//struct PARAMS_NAME(Rotation) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(Rotation) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, rollType) \ + INPLACE_TYPE_FIELD(int32_t, rollAxis) \ + INPLACE_TYPE_FIELD(float, rollSign) \ + INPLACE_TYPE_FIELD(float, maxSettleRatePerSec) \ + INPLACE_TYPE_FIELD(float, maxRotationRatePerSec) \ + INPLACE_TYPE_FIELD(float, inAirRotationMultiplier) \ + INPLACE_TYPE_FIELD(float, collisionRotationMultiplier) \ + INPLACE_TYPE_FIELD(uint32_t, includeVerticalDirection) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 3; +}; + +APEX_CUDA_CALLABLE PX_INLINE void chooseUp(PxVec3& outUp, unsigned int rollType, nvidia::RandState& randState) +{ + const float angle = randState.nextFloat(0.0f, 2 * PI); + const float up = angle < PI ? -1.0f : 1.0f; + const float cosAng = PxCos(angle); + const float sinAng = PxSin(angle); + + switch (rollType) + { + default: + outUp = PxVec3(0.0f, 0.0f, 1.0f); + break; + + case nvidia::apex::ApexMeshParticleRollType::FLAT_X: + outUp = PxVec3(up, 0.0f, 0.0f); + break; + case nvidia::apex::ApexMeshParticleRollType::FLAT_Y: + outUp = PxVec3(0.0f, up, 0.0f); + break; + case nvidia::apex::ApexMeshParticleRollType::FLAT_Z: + outUp = PxVec3(0.0f, 0.0f, up); + break; + + case nvidia::apex::ApexMeshParticleRollType::LONG_X: + outUp = PxVec3(0.0f, cosAng, sinAng); + break; + case nvidia::apex::ApexMeshParticleRollType::LONG_Y: + outUp = PxVec3(cosAng, 0.0f, sinAng); + break; + case nvidia::apex::ApexMeshParticleRollType::LONG_Z: + outUp = PxVec3(cosAng, sinAng, 0.0f); + break; + } +} + +APEX_CUDA_CALLABLE PX_INLINE void updateParticleRollBoxFromCollision(const PARAMS_NAME(Rotation)& params, PxVec3& particleAngularDelta, const PxMat33& rot, const PxVec3& collisionNormal, float timeSlice) +{ + const float maxSettle = params.maxSettleRatePerSec * timeSlice; + const float maxSettle2 = maxSettle * maxSettle; // where to compute this? + + if (params.rollType != nvidia::apex::ApexMeshParticleRollType::SPHERICAL) + { + // Settling + PxVec3 a; + if (params.rollAxis < 0) + { + // Cubic rolling, must choose most normal-pointing mRollAxis + PxVec3 overlap; + overlap = rot.transform(collisionNormal); + const int32_t bestAxis = maxAbsElementIndex(overlap); + a = bestAxis == 0 ? rot.column0 : bestAxis == 1 ? rot.column1 : rot.column2; + } + else + { + // Flat or long box, mRollAxis is chosen + a = params.rollAxis == 0 ? rot.column0 : params.rollAxis == 1 ? rot.column1 : rot.column2; + } + + PxVec3 settle = (params.rollSign * a.dot(collisionNormal)) * a.cross(collisionNormal); + if (maxSettle != 0.0f) + { + const float settle2 = settle.magnitudeSquared(); + // Cap how much settling is allowed per simulation tick + if (settle2 > maxSettle2) + { + settle *= maxSettle * PxRecipSqrt(settle2); + } + } + particleAngularDelta += settle; + } +} + +APEX_CUDA_CALLABLE PX_INLINE void updateParticleRollBoxNoCollision(const PARAMS_NAME(Rotation)& params, PxVec3& particleAngularDelta, float timeSlice) +{ + const float maxRotation = params.maxRotationRatePerSec * timeSlice; + const float maxRotation2 = maxRotation * maxRotation; + + if (maxRotation != 0.0f) + { + // Cap the total amount of roll. + const float roll2 = particleAngularDelta.magnitudeSquared(); + if (roll2 > maxRotation2) + { + particleAngularDelta *= maxRotation * PxRecipSqrt(roll2); + } + } +} + + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierRotation(const PARAMS_NAME(Rotation)& params, const Input& input, PubState& pubState, PrivState& privState, const nvidia::iofx::ModifierCommonParams& common, nvidia::RandState& randState) +{ + if (usage == nvidia::apex::ModifierUsage_Mesh) + { + // TODO: This should really go into a 'settle' modifier, that says that objects should try to settle with one side up + // or another, but for now it's here. + if (spawn) + { + // Need to come up with a default pose. + PxMat33 rotationOnSpawn; + if (params.rollType == nvidia::apex::ApexMeshParticleRollType::SPHERICAL) + { + PxVec3 randomRotation; + randomRotation.x = randState.nextFloat(-PI, PI); + randomRotation.y = randState.nextFloat(-PI, PI); + randomRotation.z = randState.nextFloat(-PI, PI); + approxAxisAngleToMat33(randomRotation, rotationOnSpawn); + } + else + { + PxVec3 upVector; + chooseUp(upVector, params.rollType, randState); + + PxVec3 unitSystemUp = common.upVector; + unitSystemUp.normalize(); + + PxMat33 rotateToUp, randomRotation; + generateRotationMatrix(upVector, unitSystemUp, rotateToUp); + generateRandomRotation(unitSystemUp, randomRotation, randState); + + rotationOnSpawn = randomRotation * rotateToUp; + } + privState.rotation = rotationOnSpawn; + pubState.rotation = rotationOnSpawn; + } + else + { + PxVec3 rollDelta; + PxVec3 delta = input.velocity * common.deltaTime; + + if (common.inputHasCollision) + { + if (input.collisionFlags != 0) + { + rollDelta = params.collisionRotationMultiplier * input.collisionNormal.cross(delta); + } + else + { + if (params.includeVerticalDirection) + { + // I'd like to use the absolute value of the "up" speed... just check it in first. + rollDelta = params.inAirRotationMultiplier * delta; + } + else + { + rollDelta = params.inAirRotationMultiplier * common.upVector.cross( delta ); + } + } + + updateParticleRollBoxFromCollision(params, rollDelta, privState.rotation, input.collisionNormal, common.deltaTime); + updateParticleRollBoxNoCollision(params, rollDelta, common.deltaTime); + } + else + { + if (params.includeVerticalDirection) + { + // I'd like to use the absolute value of the "up" speed... just check it in first. + rollDelta = params.inAirRotationMultiplier * delta; + } + else + { + rollDelta = params.inAirRotationMultiplier * common.upVector.cross( delta ); + } + updateParticleRollBoxNoCollision(params, rollDelta, common.deltaTime); + } + + if (rollDelta.magnitudeSquared() > 0.0f) + { + // update particle transform + // A) This is because maxAngle isn't really working properly + // B) This should be a configurable parameter of the system + PxMat33 rot; + approxAxisAngleToMat33(rollDelta, rot); + privState.rotation = rot * privState.rotation; + } + pubState.rotation = privState.rotation; + } + } +} + +//--- SimpleScale modifier --- + +//struct PARAMS_NAME(SimpleScale) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(SimpleScale) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(PxVec3, scaleFactor) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierSimpleScale(const PARAMS_NAME(SimpleScale)& params, const Input& /*input*/, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ + pubState.scale.x *= params.scaleFactor.x; + pubState.scale.y *= params.scaleFactor.y; + pubState.scale.z *= params.scaleFactor.z; +} + +//--- RandomScale modifier --- + +//struct PARAMS_NAME(RandomScale) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(RandomScale) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, scaleFactorMin) \ + INPLACE_TYPE_FIELD(float, scaleFactorMax) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 1; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierRandomScale(const PARAMS_NAME(RandomScale)& params, const Input& /*input*/, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& randState) +{ + const float scaleFactor = randState.nextFloat(params.scaleFactorMin, params.scaleFactorMax); + + pubState.scale *= scaleFactor; +} + +//--- ScaleByMass modifier --- + +//struct PARAMS_NAME(ScaleByMass) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ScaleByMass) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, scaleFactor) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierScaleByMass(const PARAMS_NAME(ScaleByMass)& /*params*/, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ + pubState.scale *= input.mass; +} + +//--- ColorVsLife modifier --- + +//struct PARAMS_NAME(ColorVsLife) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ColorVsLife) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, channel) \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierColorVsLife(const PARAMS_NAME(ColorVsLife)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ +#define _MODIFIER_CODE_(channel) \ + { \ + pubState.color[channel] *= EVAL_CURVE(params.curve, input.liferemain); \ + } +#if _CUDA_OPT_LOC_MEM_ + if (params.channel == 0) _MODIFIER_CODE_(0) + else if (params.channel == 1) _MODIFIER_CODE_(1) + else if (params.channel == 2) _MODIFIER_CODE_(2) + else if (params.channel == 3) _MODIFIER_CODE_(3) +#else + _MODIFIER_CODE_(params.channel) +#endif +#undef _MODIFIER_CODE_ + + } + +//--- ColorVsDensity modifier --- + +//struct PARAMS_NAME(ColorVsDensity) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ColorVsDensity) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, channel) \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierColorVsDensity(const PARAMS_NAME(ColorVsDensity)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ +#define _MODIFIER_CODE_(channel) \ + { \ + pubState.color[channel] *= EVAL_CURVE(params.curve, input.density); \ + } +#if _CUDA_OPT_LOC_MEM_ + if (params.channel == 0) _MODIFIER_CODE_(0) + else if (params.channel == 1) _MODIFIER_CODE_(1) + else if (params.channel == 2) _MODIFIER_CODE_(2) + else if (params.channel == 3) _MODIFIER_CODE_(3) +#else + _MODIFIER_CODE_(params.channel) +#endif +#undef _MODIFIER_CODE_ + } + +//--- ColorVsVelocity modifier --- + +//struct PARAMS_NAME(ColorVsVelocity) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ColorVsVelocity) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, velocity0) \ + INPLACE_TYPE_FIELD(float, velocity1) \ + INPLACE_TYPE_FIELD(uint32_t, channel) \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierColorVsVelocity(const PARAMS_NAME(ColorVsVelocity)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ + float velocity = (input.velocity.magnitude() - params.velocity0) / (params.velocity1 - params.velocity0); + velocity = PxClamp(velocity, 0.0f, 1.0f); + +#define _MODIFIER_CODE_(channel) \ + { \ + pubState.color[channel] *= EVAL_CURVE(params.curve, velocity); \ + } +#if _CUDA_OPT_LOC_MEM_ + if (params.channel == 0) _MODIFIER_CODE_(0) + else if (params.channel == 1) _MODIFIER_CODE_(1) + else if (params.channel == 2) _MODIFIER_CODE_(2) + else if (params.channel == 3) _MODIFIER_CODE_(3) +#else + _MODIFIER_CODE_(params.channel) +#endif +#undef _MODIFIER_CODE_ +} + +//--- SubtextureVsLife modifier --- + +//struct PARAMS_NAME(SubtextureVsLife) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(SubtextureVsLife) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierSubtextureVsLife(const PARAMS_NAME(SubtextureVsLife)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ + if (usage == nvidia::apex::ModifierUsage_Sprite) + { + pubState.subTextureId += EVAL_CURVE(params.curve, input.liferemain); + } +} + +//--- OrientAlongVelocity modifier --- + +APEX_CUDA_CALLABLE PX_INLINE bool buildRotationMatrix(const PxVec3& srcVec, const PxVec3& dstVec, PxMat33& outRotMat) +{ + PxVec3 axis = srcVec.cross(dstVec); + + float cosAngle = srcVec.dot(dstVec); + float angle = PxAcos(cosAngle); + + float axisLen = axis.normalize(); + if (axisLen < 0.0001f) + { + return false; + } + + PxQuat quat(angle, axis); + outRotMat = PxMat33(quat); + return true; +} + +//struct PARAMS_NAME(OrientAlongVelocity) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(OrientAlongVelocity) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(PxVec3, modelForward) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierOrientAlongVelocity(const PARAMS_NAME(OrientAlongVelocity)& params, const Input& input, PubState& pubState, PrivState& privState, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ + if (usage == nvidia::apex::ModifierUsage_Mesh) + { + PxVec3 vel = input.velocity; + float velMagnitude = vel.normalize(); // normalize it + // If travelling too slowly, this will be unstable, so don't do anything. + if (PxAbs(velMagnitude) >= 0.0001f) + { + PxMat33 rotMat; + if (buildRotationMatrix(params.modelForward, vel, rotMat)) + { + privState.rotation = rotMat; + } + } + pubState.rotation = privState.rotation; + } +} + +//--- ScaleAlongVelocity modifier --- + +///p,q -> p^q = n (n - must be normalized!) +APEX_CUDA_CALLABLE PX_INLINE void buildPlaneBasis(const PxVec3& n, PxVec3& p, PxVec3& q) +{ + const float SQRT1_2 = PxSqrt(float(0.5)); + if (PxAbs(n.z) > SQRT1_2) + { + // choose p in y-z plane + float k = sqrtf(n.y * n.y + n.z * n.z); + p.x = 0; + p.y = -n.z / k; + p.z = n.y / k; + // set q = n x p + q.x = k; + q.y = -n.x * p.z; + q.z = n.x * p.y; + } + else + { + // choose p in x-y plane + float k = PxSqrt(n.x * n.x + n.y * n.y); + p.x = -n.y / k; + p.y = n.x / k; + p.z = 0; + // set q = n x p + q.x = -n.z * p.y; + q.y = n.z * p.x; + q.z = k; + } +} + +APEX_CUDA_CALLABLE PX_INLINE void buildScaleAlongAxis(const PxVec3& scaleAxis, float scale, PxMat33& scaleMat) +{ + PxVec3 axis0, axis1; + buildPlaneBasis(scaleAxis, axis0, axis1); + + PxMat33 rotToAxisMat(axis0, axis1, scaleAxis); + + scaleMat = rotToAxisMat; + scaleMat.column2 = scaleAxis * scale; + + //scaleMat.setMultiplyTransposeRight(scaleMat, rotToAxisMat); + + float a = scaleMat.column0.dot(rotToAxisMat.column0); + float b = scaleMat(0,0) * rotToAxisMat(0,1) + scaleMat(1,0) * rotToAxisMat(1,1) + scaleMat(2,0) * rotToAxisMat(2,1); + float c = scaleMat(0,0) * rotToAxisMat(0,2) + scaleMat(1,0) * rotToAxisMat(1,2) + scaleMat(2,0) * rotToAxisMat(2,2); + float d = scaleMat(0,1) * rotToAxisMat(0,0) + scaleMat(1,1) * rotToAxisMat(1,0) + scaleMat(2,1) * rotToAxisMat(2,0); + float e = scaleMat(0,1) * rotToAxisMat(0,1) + scaleMat(1,1) * rotToAxisMat(1,1) + scaleMat(2,1) * rotToAxisMat(2,1); + float f = scaleMat(0,1) * rotToAxisMat(0,2) + scaleMat(1,1) * rotToAxisMat(1,2) + scaleMat(2,1) * rotToAxisMat(2,2); + float g = scaleMat(0,2) * rotToAxisMat(0,0) + scaleMat(1,2) * rotToAxisMat(1,0) + scaleMat(2,2) * rotToAxisMat(2,0); + float h = scaleMat(0,2) * rotToAxisMat(0,1) + scaleMat(1,2) * rotToAxisMat(1,1) + scaleMat(2,2) * rotToAxisMat(2,1); + float i = scaleMat(0,2) * rotToAxisMat(0,2) + scaleMat(1,2) * rotToAxisMat(1,2) + scaleMat(2,2) * rotToAxisMat(2,2); + + scaleMat(0,0) = a; + scaleMat(1,0) = b; + scaleMat(2,0) = c; + + scaleMat(0,1) = d; + scaleMat(1,1) = e; + scaleMat(2,1) = f; + + scaleMat(0,2) = g; + scaleMat(1,2) = h; + scaleMat(2,2) = i; +} + +//struct PARAMS_NAME(ScaleAlongVelocity) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ScaleAlongVelocity) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, scaleFactor) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierScaleAlongVelocity(const PARAMS_NAME(ScaleAlongVelocity)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ + if (usage == nvidia::apex::ModifierUsage_Mesh) + { + PxVec3 vel = input.velocity; + float velMagnitude = vel.normalize(); // normalize it + + PxMat33 scaleMat(PxIdentity); + if (velMagnitude >= 0.0001f) + { + float scale = 1.0f + velMagnitude * params.scaleFactor; + + buildScaleAlongAxis(vel, scale, scaleMat); + } + pubState.rotation = scaleMat * pubState.rotation; + } +} + +//--- RandomSubtexture modifier --- + +//struct PARAMS_NAME(RandomSubtexture) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(RandomSubtexture) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, subtextureRangeMin) \ + INPLACE_TYPE_FIELD(float, subtextureRangeMax) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 1; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierRandomSubtexture(const PARAMS_NAME(RandomSubtexture)& params, const Input& /*input*/, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& randState) +{ + if (usage == nvidia::apex::ModifierUsage_Sprite) + { + pubState.subTextureId += randState.nextFloat(params.subtextureRangeMin, params.subtextureRangeMax); + } +} + +//--- RandomRotation modifier --- + +//struct PARAMS_NAME(RandomRotation) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(RandomRotation) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, rotationRangeMin) \ + INPLACE_TYPE_FIELD(float, rotationRangeMax) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 1; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierRandomRotation(const PARAMS_NAME(RandomRotation)& params, const Input& /*input*/, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& randState) +{ + if (usage == nvidia::apex::ModifierUsage_Sprite) + { + const float DegToRad = PI / 180; + pubState.rotation += DegToRad * randState.nextFloat(params.rotationRangeMin, params.rotationRangeMax); + } +} + +//--- ScaleVsLife modifier --- + +//struct PARAMS_NAME(ScaleVsLife) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ScaleVsLife) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, axis) \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierScaleVsLife(const PARAMS_NAME(ScaleVsLife)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ +#define _MODIFIER_CODE_(axis) \ + { \ + pubState.scale[axis] *= EVAL_CURVE(params.curve, input.liferemain); \ + } +#if _CUDA_OPT_LOC_MEM_ + if (params.axis == 0) _MODIFIER_CODE_(0) + else if (params.axis == 1) _MODIFIER_CODE_(1) + else if (params.axis == 2) _MODIFIER_CODE_(2) +#else + _MODIFIER_CODE_(params.axis) +#endif +#undef _MODIFIER_CODE_ + } + +//--- ScaleVsDensity modifier --- + +//struct PARAMS_NAME(ScaleVsDensity) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ScaleVsDensity) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, axis) \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierScaleVsDensity(const PARAMS_NAME(ScaleVsDensity)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ +#define _MODIFIER_CODE_(axis) \ + { \ + pubState.scale[axis] *= EVAL_CURVE(params.curve, input.density); \ + } +#if _CUDA_OPT_LOC_MEM_ + if (params.axis == 0) _MODIFIER_CODE_(0) + else if (params.axis == 1) _MODIFIER_CODE_(1) + else if (params.axis == 2) _MODIFIER_CODE_(2) +#else + _MODIFIER_CODE_(params.axis) +#endif +#undef _MODIFIER_CODE_ + } + +//--- ScaleVsCameraDistance modifier --- + +//struct PARAMS_NAME(ScaleVsCameraDistance) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ScaleVsCameraDistance) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(uint32_t, axis) \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierScaleVsCameraDistance(const PARAMS_NAME(ScaleVsCameraDistance)& params, const Input& input, PubState& pubState, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& common, nvidia::RandState& /*nvidia::RandState*/) +{ + float cameraDistance = (input.position - common.eyePosition).magnitude(); + +#define _MODIFIER_CODE_(axis) \ + { \ + pubState.scale[axis] *= EVAL_CURVE(params.curve, cameraDistance); \ + } +#if _CUDA_OPT_LOC_MEM_ + if (params.axis == 0) _MODIFIER_CODE_(0) + else if (params.axis == 1) _MODIFIER_CODE_(1) + else if (params.axis == 2) _MODIFIER_CODE_(2) +#else + _MODIFIER_CODE_(params.axis) +#endif +#undef _MODIFIER_CODE_ + } + +//--- ViewDirectionSorting modifier --- + +//struct PARAMS_NAME(ViewDirectionSorting) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(ViewDirectionSorting) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierViewDirectionSorting(const PARAMS_NAME(ViewDirectionSorting)& /*params*/, const Input& /*input*/, PubState& /*pubState*/, PrivState& /*privState*/, const nvidia::iofx::ModifierCommonParams& /*common*/, nvidia::RandState& /*nvidia::RandState*/) +{ +} + +//--- RotationRate modifier --- + +//struct PARAMS_NAME(RotationRate) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(RotationRate) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, rotationRate) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierRotationRate(const PARAMS_NAME(RotationRate)& params, const Input& /*input*/, PubState& pubState, PrivState& privState, const nvidia::iofx::ModifierCommonParams& common, nvidia::RandState& /*nvidia::RandState*/) +{ + if (usage == nvidia::apex::ModifierUsage_Sprite) + { + const float TwoPi = 2 * PI; + const float rotationDelta = params.rotationRate * TwoPi * common.deltaTime; + privState.rotation += rotationDelta; + pubState.rotation += privState.rotation; + } +} + +//--- RotationRateVsLife modifier --- + +//struct PARAMS_NAME(RotationRateVsLife) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(RotationRateVsLife) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(CURVE_TYPE, curve) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierRotationRateVsLife(const PARAMS_NAME(RotationRateVsLife)& params, const Input& input, PubState& pubState, PrivState& privState, const nvidia::iofx::ModifierCommonParams& common, nvidia::RandState& /*nvidia::RandState*/) +{ + if (usage == nvidia::apex::ModifierUsage_Sprite) + { + const float TwoPi = 2 * PI; + const float rotationDelta = EVAL_CURVE(params.curve, input.liferemain) * TwoPi * common.deltaTime; + privState.rotation += rotationDelta; + pubState.rotation += privState.rotation; + } +} + +//--- OrientScaleAlongScreenVelocity modifier --- + +//struct PARAMS_NAME(OrientScaleAlongScreenVelocity) +#define INPLACE_TYPE_STRUCT_NAME PARAMS_NAME(OrientScaleAlongScreenVelocity) +#define INPLACE_TYPE_STRUCT_FIELDS \ + INPLACE_TYPE_FIELD(float, scalePerVelocity) \ + INPLACE_TYPE_FIELD(float, scaleChangeLimit) \ + INPLACE_TYPE_FIELD(float, scaleChangeDelay) +#define INPLACE_TYPE_STRUCT_LEAVE_OPEN 1 +#include INPLACE_TYPE_BUILD() + + static const uint32_t RANDOM_COUNT = 0; +}; + +INPLACE_TEMPL_VA_ARGS_DEF(bool spawn, int usage, typename Input, typename PubState, typename PrivState) +MODIFIER_DECL void modifierOrientScaleAlongScreenVelocity(const PARAMS_NAME(OrientScaleAlongScreenVelocity)& params, const Input& input, PubState& pubState, PrivState& privState, const nvidia::iofx::ModifierCommonParams& common, nvidia::RandState& /*nvidia::RandState*/) +{ + if (usage == nvidia::apex::ModifierUsage_Sprite) + { + PxVec3 viewPos, viewVel; // position & velocity in view space + + viewPos.x = (input.position - common.eyePosition).dot(common.eyeAxisX); + viewPos.y = (input.position - common.eyePosition).dot(common.eyeAxisY); + viewPos.z = (input.position - common.eyePosition).dot(common.eyeDirection); // eyeDir = eyeAxisZ + + // 4 is simply a hack that looks decent in UE3 ATM, we should use the FOV to determine when to + // cull particles, otherwise you end up with particles around the zNear plane that have huge + // 'd' values, resulting in bad scaling + if (viewPos.z < common.zNear * 4) + { + pubState.rotation = privState.rotation; + pubState.scale.x = 0.0f; + pubState.scale.y = 0.0f; + return; + } + + viewVel.x = (input.velocity).dot(common.eyeAxisX); + viewVel.y = (input.velocity).dot(common.eyeAxisY); + viewVel.z = (input.velocity).dot(common.eyeDirection); // eyeDir = eyeAxisZ + + // tan(angle) = (Vy*Pz - Py*Vz) / (Vx*Pz - Px*Vz) + const float velX = viewVel.x * viewPos.z - viewPos.x * viewVel.z; + const float velY = viewVel.y * viewPos.z - viewPos.y * viewVel.z; + + const float velLengthMultiplier = 1.0f / viewPos.z; + + const float dx = velX * velLengthMultiplier; + const float dy = velY * velLengthMultiplier; + + const float d = PxSqrt(dx * dx + dy * dy); + + if (d >= 1e-5f) + { + // "Note that the order of arguments is reversed; the function atan2(y,x) computes + // the angle corresponding to the point (x,y)." + // see http://en.wikipedia.org/wiki/Atan2 + privState.rotation = PxAtan2(velY, velX); + + float scale = 1.0f + d * params.scalePerVelocity; + if (params.scaleChangeDelay > 0.0f) + { + const float blendFactor = PxExp(-common.deltaTime / params.scaleChangeDelay); + scale *= (1.0f - blendFactor); + scale += blendFactor * privState.scale; + } + if (params.scaleChangeLimit > 0.0f) + { + const float scaleChangeLimit = params.scaleChangeLimit * common.deltaTime; + const float scaleChange = scale - privState.scale; + if (scaleChange > +scaleChangeLimit) + { + scale = privState.scale + scaleChangeLimit; + } + else if (scaleChange < -scaleChangeLimit) + { + scale = privState.scale - scaleChangeLimit; + } + } + privState.scale = scale; + pubState.scale.x *= scale; + } + pubState.rotation = privState.rotation; + } +} + +#undef _CUDA_OPT_LOC_MEM_ diff --git a/APEX_1.4/module/iofx/include/ModuleEventDefs.h b/APEX_1.4/module/iofx/include/ModuleEventDefs.h new file mode 100644 index 00000000..87181235 --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModuleEventDefs.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +// This file is used to define a list of AgPerfMon events. +// +// This file is included exclusively by AgPerfMonEventSrcAPI.h +// and by AgPerfMonEventSrcAPI.cpp, for the purpose of building +// an enumeration (enum xx) and an array of strings () +// that contain the list of events. +// +// This file should only contain event definitions, using the +// DEFINE_EVENT macro. E.g.: +// +// DEFINE_EVENT(sample_name_1) +// DEFINE_EVENT(sample_name_2) +// DEFINE_EVENT(sample_name_3) + +DEFINE_EVENT(IofxManagerUpdateEffectsData) +DEFINE_EVENT(IofxManagerGPUModifiers) diff --git a/APEX_1.4/module/iofx/include/ModuleIofxImpl.h b/APEX_1.4/module/iofx/include/ModuleIofxImpl.h new file mode 100644 index 00000000..6a2d69e6 --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModuleIofxImpl.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __MODULE_IOFX_IMPL_H__ +#define __MODULE_IOFX_IMPL_H__ + +#include "Apex.h" +#include "ModuleIofx.h" +#include "ApexSDKIntl.h" +#include "ModuleBase.h" +#include "ModuleIofxIntl.h" +#include "ResourceProviderIntl.h" +#include "ApexSharedUtils.h" +#include "ApexSDKHelpers.h" +#include "ModulePerfScope.h" +#include "ApexAuthorableObject.h" +#include "ApexRWLockable.h" +#include "ModuleIofxRegistration.h" +#include "ReadCheck.h" +#include "WriteCheck.h" + + +namespace nvidia +{ +namespace apex +{ +class RenderVolume; +} +namespace iofx +{ +class IofxAssetImpl; +class IofxScene; + +class ModuleIofxDesc : public ApexDesc +{ +public: + + /** + \brief constructor sets to default. + */ + PX_INLINE ModuleIofxDesc() : ApexDesc() + { + init(); + } + + /** + \brief sets members to default values. + */ + PX_INLINE void setToDefault() + { + ApexDesc::setToDefault(); + init(); + } + + /** + \brief checks if this is a valid descriptor. + */ + PX_INLINE bool isValid() const + { + bool retVal = ApexDesc::isValid(); + return retVal; + } + +private: + + PX_INLINE void init() + { + } +}; + +class ModuleIofxImpl : public ModuleIofx, public ModuleIofxIntl, public ModuleBase, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + ModuleIofxImpl(ApexSDKIntl* sdk); + ~ModuleIofxImpl(); + + void init(const ModuleIofxDesc& ModuleIofxDesc); + + // base class methods + void init(NvParameterized::Interface&) {} + NvParameterized::Interface* getDefaultModuleDesc(); + void release() + { + ModuleBase::release(); + } + void destroy(); + const char* getName() const + { + READ_ZONE(); + return ModuleBase::getName(); + } + + RenderableIterator* createRenderableIterator(const Scene&) + { + WRITE_ZONE(); + return NULL; //obsolete! + } + + void disableCudaInterop() + { + WRITE_ZONE(); + mInteropDisabled = true; + } + void disableCudaModifiers() + { + WRITE_ZONE(); + mCudaDisabled = true; + } + void disableDeferredRenderableAllocation() + { + WRITE_ZONE(); + mDeferredDisabled = true; + } + + const TestBase* getTestBase(Scene* apexScene) const; + + bool setIofxRenderCallback(const Scene& apexScene, IofxRenderCallback* ); + IofxRenderCallback* getIofxRenderCallback(const Scene& apexScene) const; + + IofxRenderableIterator* createIofxRenderableIterator(const Scene&); + + void prepareRenderables(const Scene&); + + // ModuleIofxIntl methods + IofxManagerIntl* createActorManager(const Scene& scene, const IofxAsset& asset, const IofxManagerDescIntl& desc); + + uint32_t forceLoadAssets(); + AuthObjTypeID getModuleID() const; + + ModuleSceneIntl* createInternalModuleScene(SceneIntl&, RenderDebugInterface*); + void releaseModuleSceneIntl(ModuleSceneIntl&); + + IofxScene* getIofxScene(const Scene& scene); + const IofxScene* getIofxScene(const Scene& scene) const; + + RenderVolume* createRenderVolume(const Scene& apexScene, const PxBounds3& b, uint32_t priority, bool allIofx); + void releaseRenderVolume(RenderVolume& volume); + +protected: + + ResourceList mAuthorableObjects; + + IofxModuleParameters* mModuleParams; + bool mInteropDisabled; + bool mCudaDisabled; + bool mDeferredDisabled; + + ResourceList mIofxScenes; + + friend class IofxActorImpl; + friend class IofxScene; + friend class IofxManager; + friend class IofxManagerGPU; +}; + +} +} // namespace nvidia + +#endif // __MODULE_IOFX_IMPL_H__ diff --git a/APEX_1.4/module/iofx/include/ModulePerfScope.h b/APEX_1.4/module/iofx/include/ModulePerfScope.h new file mode 100644 index 00000000..891e6131 --- /dev/null +++ b/APEX_1.4/module/iofx/include/ModulePerfScope.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __MODULE_PERF_SCOPE_H___ +#define __MODULE_PERF_SCOPE_H___ + +#define MODULE_NAMESPACE iofx +#include "ModuleProfileCommon.h" + +#endif
\ No newline at end of file diff --git a/APEX_1.4/module/iofx/include/RenderVolumeImpl.h b/APEX_1.4/module/iofx/include/RenderVolumeImpl.h new file mode 100644 index 00000000..bf6b7e1d --- /dev/null +++ b/APEX_1.4/module/iofx/include/RenderVolumeImpl.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __RENDER_VOLUME_IMPL_H__ +#define __RENDER_VOLUME_IMPL_H__ + +#include "Apex.h" +#include "RenderVolume.h" +#include "PsArray.h" +#include "ApexResource.h" +#include "ApexRenderable.h" +#include "ApexRWLockable.h" +#include "ReadCheck.h" +#include "WriteCheck.h" + +namespace nvidia +{ +namespace apex +{ +class IofxAsset; +class IofxActor; +} +namespace iofx +{ +class IofxScene; + +class RenderVolumeImpl : public RenderVolume, public ApexResourceInterface, public ApexResource, public ApexRWLockable +{ +public: + APEX_RW_LOCKABLE_BOILERPLATE + + RenderVolumeImpl(IofxScene& scene, const PxBounds3& b, uint32_t priority, bool allIofx); + ~RenderVolumeImpl(); + + // ApexResourceInterface methods + void release(); + void destroy(); + + uint32_t getListIndex() const + { + return m_listIndex; + } + void setListIndex(ResourceList& list, uint32_t index) + { + m_listIndex = index; + m_list = &list; + } + + void setOwnershipBounds(const PxBounds3& b) + { + WRITE_ZONE(); + mOwnershipBounds = b; + } + PxBounds3 getOwnershipBounds(void) const + { + READ_ZONE(); + return mOwnershipBounds; + } + PxBounds3 getBounds() const; + + // methods for use by IOS or IOFX actor + bool addIofxActor(IofxActor& iofx); + bool removeIofxActor(const IofxActor& iofx); + + bool addIofxAsset(IofxAsset& iofx); + void setPosition(const PxVec3& pos); + + bool getAffectsAllIofx() const + { + READ_ZONE(); + return mAllIofx; + } + + IofxActor* const* lockIofxActorList(uint32_t& count) + { + READ_ZONE(); + mLock.lockReader(); + count = mIofxActors.size(); + return count ? &mIofxActors.front() : NULL; + } + void unlockIofxActorList() + { + mLock.unlockReader(); + } + + + IofxAsset* const* getIofxAssetList(uint32_t& count) const + { + READ_ZONE(); + count = mIofxAssets.size(); + return count ? &mIofxAssets.front() : NULL; + } + PxVec3 getPosition() const + { + READ_ZONE(); + return mOwnershipBounds.getCenter(); + } + uint32_t getPriority() const + { + READ_ZONE(); + return mPriority; + } + bool affectsIofxAsset(const IofxAsset& iofx) const; + + PX_INLINE void lockReader() + { + mLock.lockReader(); + } + PX_INLINE void unlockReader() + { + mLock.unlockReader(); + } + +protected: + // bounds is stored in ApexRenderable::mRenderBounds + uint32_t mPriority; + bool mAllIofx; + bool mPendingDelete; + IofxScene& mScene; + nvidia::Array<IofxAsset*> mIofxAssets; + nvidia::Array<IofxActor*> mIofxActors; + physx::PxBounds3 mOwnershipBounds; + physx::shdfnd::ReadWriteLock mLock; +}; + +} +} // namespace nvidia + +#endif // __RENDER_VOLUME_IMPL_H__ diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsDensityCompositeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsDensityCompositeModifierParams.h new file mode 100644 index 00000000..2f505954 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsDensityCompositeModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsDensityCompositeModifierParams_h +#define HEADER_ColorVsDensityCompositeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsDensityCompositeModifierParamsNS +{ + +struct colorDensityStruct_Type; + +struct colorDensityStruct_DynamicArray1D_Type +{ + colorDensityStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct colorDensityStruct_Type +{ + float density; + physx::PxVec4 color; +}; + +struct ParametersStruct +{ + + colorDensityStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x6ee7f5a0, 0xedd1e5d5, 0x6169ab3c, 0x868306ec, }; + +} // namespace ColorVsDensityCompositeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsDensityCompositeModifierParams : public NvParameterized::NvParameters, public ColorVsDensityCompositeModifierParamsNS::ParametersStruct +{ +public: + ColorVsDensityCompositeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsDensityCompositeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsDensityCompositeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsDensityCompositeModifierParamsNS::checksum); + return ColorVsDensityCompositeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsDensityCompositeModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsDensityCompositeModifierParams* tmpThis = const_cast<ColorVsDensityCompositeModifierParams*>(this); + return *(static_cast<ColorVsDensityCompositeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsDensityCompositeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsDensityCompositeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsDensityCompositeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsDensityCompositeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsDensityCompositeModifierParams), ColorVsDensityCompositeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsDensityCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsDensityCompositeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsDensityCompositeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsDensityCompositeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsDensityCompositeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsDensityCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsDensityCompositeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsDensityCompositeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsDensityCompositeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsDensityCompositeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsDensityCompositeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsDensityCompositeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsDensityCompositeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsDensityModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsDensityModifierParams.h new file mode 100644 index 00000000..5386b7c5 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsDensityModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsDensityModifierParams_h +#define HEADER_ColorVsDensityModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsDensityModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* colorChannel; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xbd1ead31, 0x79bc4460, 0x6a89ef07, 0xbbe13350, }; + +} // namespace ColorVsDensityModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsDensityModifierParams : public NvParameterized::NvParameters, public ColorVsDensityModifierParamsNS::ParametersStruct +{ +public: + ColorVsDensityModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsDensityModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsDensityModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsDensityModifierParamsNS::checksum); + return ColorVsDensityModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsDensityModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsDensityModifierParams* tmpThis = const_cast<ColorVsDensityModifierParams*>(this); + return *(static_cast<ColorVsDensityModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsDensityModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsDensityModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsDensityModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsDensityModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsDensityModifierParams), ColorVsDensityModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsDensityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsDensityModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsDensityModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsDensityModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsDensityModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsDensityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsDensityModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsDensityModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsDensityModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsDensityModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsDensityModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsDensityModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsDensityModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsLifeCompositeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsLifeCompositeModifierParams.h new file mode 100644 index 00000000..9a8111ee --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsLifeCompositeModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsLifeCompositeModifierParams_h +#define HEADER_ColorVsLifeCompositeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsLifeCompositeModifierParamsNS +{ + +struct colorLifeStruct_Type; + +struct colorLifeStruct_DynamicArray1D_Type +{ + colorLifeStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct colorLifeStruct_Type +{ + float lifeRemaining; + physx::PxVec4 color; +}; + +struct ParametersStruct +{ + + colorLifeStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x2ee279f3, 0x6440bf5b, 0x26d89b02, 0xc90fa659, }; + +} // namespace ColorVsLifeCompositeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsLifeCompositeModifierParams : public NvParameterized::NvParameters, public ColorVsLifeCompositeModifierParamsNS::ParametersStruct +{ +public: + ColorVsLifeCompositeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsLifeCompositeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsLifeCompositeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsLifeCompositeModifierParamsNS::checksum); + return ColorVsLifeCompositeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsLifeCompositeModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsLifeCompositeModifierParams* tmpThis = const_cast<ColorVsLifeCompositeModifierParams*>(this); + return *(static_cast<ColorVsLifeCompositeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsLifeCompositeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsLifeCompositeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsLifeCompositeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsLifeCompositeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsLifeCompositeModifierParams), ColorVsLifeCompositeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsLifeCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsLifeCompositeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsLifeCompositeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsLifeCompositeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsLifeCompositeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsLifeCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsLifeCompositeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsLifeCompositeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsLifeCompositeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsLifeCompositeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsLifeCompositeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsLifeCompositeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsLifeCompositeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsLifeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsLifeModifierParams.h new file mode 100644 index 00000000..c146c48d --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsLifeModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsLifeModifierParams_h +#define HEADER_ColorVsLifeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsLifeModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* colorChannel; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x6273c5a3, 0xe1a0df26, 0x77f5af16, 0x6a54d1e7, }; + +} // namespace ColorVsLifeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsLifeModifierParams : public NvParameterized::NvParameters, public ColorVsLifeModifierParamsNS::ParametersStruct +{ +public: + ColorVsLifeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsLifeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsLifeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsLifeModifierParamsNS::checksum); + return ColorVsLifeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsLifeModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsLifeModifierParams* tmpThis = const_cast<ColorVsLifeModifierParams*>(this); + return *(static_cast<ColorVsLifeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsLifeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsLifeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsLifeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsLifeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsLifeModifierParams), ColorVsLifeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsLifeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsLifeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsLifeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsLifeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsLifeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsLifeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsLifeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsLifeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsLifeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsLifeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsLifeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsTemperatureCompositeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsTemperatureCompositeModifierParams.h new file mode 100644 index 00000000..e3e84894 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsTemperatureCompositeModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsTemperatureCompositeModifierParams_h +#define HEADER_ColorVsTemperatureCompositeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsTemperatureCompositeModifierParamsNS +{ + +struct colorTemperatureStruct_Type; + +struct colorTemperatureStruct_DynamicArray1D_Type +{ + colorTemperatureStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct colorTemperatureStruct_Type +{ + float temperature; + physx::PxVec4 color; +}; + +struct ParametersStruct +{ + + colorTemperatureStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xb5bad295, 0x1bbde1e7, 0xb10b2dc3, 0xde67581e, }; + +} // namespace ColorVsTemperatureCompositeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsTemperatureCompositeModifierParams : public NvParameterized::NvParameters, public ColorVsTemperatureCompositeModifierParamsNS::ParametersStruct +{ +public: + ColorVsTemperatureCompositeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsTemperatureCompositeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsTemperatureCompositeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsTemperatureCompositeModifierParamsNS::checksum); + return ColorVsTemperatureCompositeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsTemperatureCompositeModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsTemperatureCompositeModifierParams* tmpThis = const_cast<ColorVsTemperatureCompositeModifierParams*>(this); + return *(static_cast<ColorVsTemperatureCompositeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsTemperatureCompositeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsTemperatureCompositeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsTemperatureCompositeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsTemperatureCompositeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsTemperatureCompositeModifierParams), ColorVsTemperatureCompositeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsTemperatureCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsTemperatureCompositeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsTemperatureCompositeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsTemperatureCompositeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsTemperatureCompositeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsTemperatureCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsTemperatureCompositeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsTemperatureCompositeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsTemperatureCompositeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsTemperatureCompositeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsTemperatureCompositeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsTemperatureCompositeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsTemperatureCompositeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsTemperatureModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsTemperatureModifierParams.h new file mode 100644 index 00000000..135dc951 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsTemperatureModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsTemperatureModifierParams_h +#define HEADER_ColorVsTemperatureModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsTemperatureModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* colorChannel; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xe539a2ca, 0x44cf1564, 0xa6a2c047, 0xec15660d, }; + +} // namespace ColorVsTemperatureModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsTemperatureModifierParams : public NvParameterized::NvParameters, public ColorVsTemperatureModifierParamsNS::ParametersStruct +{ +public: + ColorVsTemperatureModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsTemperatureModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsTemperatureModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsTemperatureModifierParamsNS::checksum); + return ColorVsTemperatureModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsTemperatureModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsTemperatureModifierParams* tmpThis = const_cast<ColorVsTemperatureModifierParams*>(this); + return *(static_cast<ColorVsTemperatureModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsTemperatureModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsTemperatureModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsTemperatureModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsTemperatureModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsTemperatureModifierParams), ColorVsTemperatureModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsTemperatureModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsTemperatureModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsTemperatureModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsTemperatureModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsTemperatureModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsTemperatureModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsTemperatureModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsTemperatureModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsTemperatureModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsTemperatureModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsTemperatureModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsTemperatureModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsTemperatureModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsVelocityCompositeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsVelocityCompositeModifierParams.h new file mode 100644 index 00000000..2815ecbf --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsVelocityCompositeModifierParams.h @@ -0,0 +1,246 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsVelocityCompositeModifierParams_h +#define HEADER_ColorVsVelocityCompositeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsVelocityCompositeModifierParamsNS +{ + +struct colorVelocityStruct_Type; + +struct colorVelocityStruct_DynamicArray1D_Type +{ + colorVelocityStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct colorVelocityStruct_Type +{ + float velocity; + physx::PxVec4 color; +}; + +struct ParametersStruct +{ + + float velocity0; + float velocity1; + colorVelocityStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x85918a9e, 0x651f465d, 0x179721b9, 0x3bbd630d, }; + +} // namespace ColorVsVelocityCompositeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsVelocityCompositeModifierParams : public NvParameterized::NvParameters, public ColorVsVelocityCompositeModifierParamsNS::ParametersStruct +{ +public: + ColorVsVelocityCompositeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsVelocityCompositeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsVelocityCompositeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsVelocityCompositeModifierParamsNS::checksum); + return ColorVsVelocityCompositeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsVelocityCompositeModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsVelocityCompositeModifierParams* tmpThis = const_cast<ColorVsVelocityCompositeModifierParams*>(this); + return *(static_cast<ColorVsVelocityCompositeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsVelocityCompositeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsVelocityCompositeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsVelocityCompositeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsVelocityCompositeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsVelocityCompositeModifierParams), ColorVsVelocityCompositeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsVelocityCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsVelocityCompositeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsVelocityCompositeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsVelocityCompositeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsVelocityCompositeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsVelocityCompositeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsVelocityCompositeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsVelocityCompositeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsVelocityCompositeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsVelocityCompositeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsVelocityCompositeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsVelocityCompositeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsVelocityCompositeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ColorVsVelocityModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ColorVsVelocityModifierParams.h new file mode 100644 index 00000000..376c875c --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ColorVsVelocityModifierParams.h @@ -0,0 +1,247 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ColorVsVelocityModifierParams_h +#define HEADER_ColorVsVelocityModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ColorVsVelocityModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* colorChannel; + float velocity0; + float velocity1; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x4c79c470, 0xac91d48e, 0xa4578ba1, 0x9c1ae2f2, }; + +} // namespace ColorVsVelocityModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ColorVsVelocityModifierParams : public NvParameterized::NvParameters, public ColorVsVelocityModifierParamsNS::ParametersStruct +{ +public: + ColorVsVelocityModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ColorVsVelocityModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ColorVsVelocityModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ColorVsVelocityModifierParamsNS::checksum); + return ColorVsVelocityModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ColorVsVelocityModifierParamsNS::ParametersStruct& parameters(void) const + { + ColorVsVelocityModifierParams* tmpThis = const_cast<ColorVsVelocityModifierParams*>(this); + return *(static_cast<ColorVsVelocityModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ColorVsVelocityModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ColorVsVelocityModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ColorVsVelocityModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ColorVsVelocityModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ColorVsVelocityModifierParams), ColorVsVelocityModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ColorVsVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsVelocityModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ColorVsVelocityModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ColorVsVelocityModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ColorVsVelocityModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ColorVsVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ColorVsVelocityModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ColorVsVelocityModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ColorVsVelocityModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ColorVsVelocityModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ColorVsVelocityModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ColorVsVelocityModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ColorVsVelocityModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/InitialColorModifierParams.h b/APEX_1.4/module/iofx/include/autogen/InitialColorModifierParams.h new file mode 100644 index 00000000..49ba52b0 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/InitialColorModifierParams.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_InitialColorModifierParams_h +#define HEADER_InitialColorModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace InitialColorModifierParamsNS +{ + + + +struct ParametersStruct +{ + + physx::PxVec4 color; + +}; + +static const uint32_t checksum[] = { 0xeede1183, 0x3f1f709f, 0x0957a3e8, 0x4a27910f, }; + +} // namespace InitialColorModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class InitialColorModifierParams : public NvParameterized::NvParameters, public InitialColorModifierParamsNS::ParametersStruct +{ +public: + InitialColorModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~InitialColorModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("InitialColorModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(InitialColorModifierParamsNS::checksum); + return InitialColorModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const InitialColorModifierParamsNS::ParametersStruct& parameters(void) const + { + InitialColorModifierParams* tmpThis = const_cast<InitialColorModifierParams*>(this); + return *(static_cast<InitialColorModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + InitialColorModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<InitialColorModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class InitialColorModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + InitialColorModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(InitialColorModifierParams), InitialColorModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, InitialColorModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class InitialColorModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(InitialColorModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, InitialColorModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, InitialColorModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, InitialColorModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class InitialColorModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of InitialColorModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (InitialColorModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (InitialColorModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (InitialColorModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (InitialColorModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (InitialColorModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/IofxAssetParameters.h b/APEX_1.4/module/iofx/include/autogen/IofxAssetParameters.h new file mode 100644 index 00000000..77557890 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/IofxAssetParameters.h @@ -0,0 +1,237 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_IofxAssetParameters_h +#define HEADER_IofxAssetParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace IofxAssetParametersNS +{ + +struct outputProperties_Type; + +struct outputProperties_Type +{ + bool useUserSemantic; + bool useFloat4Color; +}; + +struct ParametersStruct +{ + + NvParameterized::Interface* iofxType; + outputProperties_Type renderOutput; + +}; + +static const uint32_t checksum[] = { 0xbb5add57, 0xf771d298, 0xcd7c3bc3, 0x921baa57, }; + +} // namespace IofxAssetParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class IofxAssetParameters : public NvParameterized::NvParameters, public IofxAssetParametersNS::ParametersStruct +{ +public: + IofxAssetParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~IofxAssetParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("IofxAssetParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)2; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(IofxAssetParametersNS::checksum); + return IofxAssetParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const IofxAssetParametersNS::ParametersStruct& parameters(void) const + { + IofxAssetParameters* tmpThis = const_cast<IofxAssetParameters*>(this); + return *(static_cast<IofxAssetParametersNS::ParametersStruct*>(tmpThis)); + } + + IofxAssetParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<IofxAssetParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class IofxAssetParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + IofxAssetParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(IofxAssetParameters), IofxAssetParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, IofxAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class IofxAssetParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(IofxAssetParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, IofxAssetParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, IofxAssetParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, IofxAssetParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class IofxAssetParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of IofxAssetParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (IofxAssetParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (IofxAssetParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (IofxAssetParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (IofxAssetParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (IofxAssetParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/IofxDebugRenderParams.h b/APEX_1.4/module/iofx/include/autogen/IofxDebugRenderParams.h new file mode 100644 index 00000000..a26652f3 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/IofxDebugRenderParams.h @@ -0,0 +1,232 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_IofxDebugRenderParams_h +#define HEADER_IofxDebugRenderParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace IofxDebugRenderParamsNS +{ + + + +struct ParametersStruct +{ + + bool VISUALIZE_IOFX_ACTOR; + bool VISUALIZE_IOFX_BOUNDING_BOX; + bool VISUALIZE_IOFX_ACTOR_NAME; + +}; + +static const uint32_t checksum[] = { 0xa907935c, 0x197f0683, 0x47c3ea05, 0x61985bda, }; + +} // namespace IofxDebugRenderParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class IofxDebugRenderParams : public NvParameterized::NvParameters, public IofxDebugRenderParamsNS::ParametersStruct +{ +public: + IofxDebugRenderParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~IofxDebugRenderParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("IofxDebugRenderParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(IofxDebugRenderParamsNS::checksum); + return IofxDebugRenderParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const IofxDebugRenderParamsNS::ParametersStruct& parameters(void) const + { + IofxDebugRenderParams* tmpThis = const_cast<IofxDebugRenderParams*>(this); + return *(static_cast<IofxDebugRenderParamsNS::ParametersStruct*>(tmpThis)); + } + + IofxDebugRenderParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<IofxDebugRenderParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class IofxDebugRenderParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + IofxDebugRenderParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(IofxDebugRenderParams), IofxDebugRenderParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, IofxDebugRenderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class IofxDebugRenderParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(IofxDebugRenderParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, IofxDebugRenderParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, IofxDebugRenderParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, IofxDebugRenderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class IofxDebugRenderParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of IofxDebugRenderParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (IofxDebugRenderParams*)bufObj; + } + + virtual const char* getClassName() + { + return (IofxDebugRenderParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (IofxDebugRenderParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (IofxDebugRenderParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (IofxDebugRenderParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/IofxModuleParameters.h b/APEX_1.4/module/iofx/include/autogen/IofxModuleParameters.h new file mode 100644 index 00000000..eee1c73f --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/IofxModuleParameters.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_IofxModuleParameters_h +#define HEADER_IofxModuleParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace IofxModuleParametersNS +{ + + + +struct ParametersStruct +{ + + uint32_t unused; + +}; + +static const uint32_t checksum[] = { 0x70f85d6f, 0xc44790e5, 0x2f3cd6fd, 0x9d4a542b, }; + +} // namespace IofxModuleParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class IofxModuleParameters : public NvParameterized::NvParameters, public IofxModuleParametersNS::ParametersStruct +{ +public: + IofxModuleParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~IofxModuleParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("IofxModuleParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(IofxModuleParametersNS::checksum); + return IofxModuleParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const IofxModuleParametersNS::ParametersStruct& parameters(void) const + { + IofxModuleParameters* tmpThis = const_cast<IofxModuleParameters*>(this); + return *(static_cast<IofxModuleParametersNS::ParametersStruct*>(tmpThis)); + } + + IofxModuleParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<IofxModuleParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class IofxModuleParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + IofxModuleParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(IofxModuleParameters), IofxModuleParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, IofxModuleParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class IofxModuleParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(IofxModuleParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, IofxModuleParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, IofxModuleParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, IofxModuleParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class IofxModuleParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of IofxModuleParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (IofxModuleParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (IofxModuleParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (IofxModuleParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (IofxModuleParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (IofxModuleParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/MeshIofxParameters.h b/APEX_1.4/module/iofx/include/autogen/MeshIofxParameters.h new file mode 100644 index 00000000..8bac4572 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/MeshIofxParameters.h @@ -0,0 +1,254 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_MeshIofxParameters_h +#define HEADER_MeshIofxParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace MeshIofxParametersNS +{ + +struct meshProperties_Type; + +struct meshProperties_DynamicArray1D_Type +{ + meshProperties_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct REF_DynamicArray1D_Type +{ + NvParameterized::Interface** buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct meshProperties_Type +{ + NvParameterized::Interface* meshAssetName; + uint32_t weight; +}; + +struct ParametersStruct +{ + + meshProperties_DynamicArray1D_Type renderMeshList; + REF_DynamicArray1D_Type spawnModifierList; + REF_DynamicArray1D_Type continuousModifierList; + +}; + +static const uint32_t checksum[] = { 0x823a573c, 0xd18e2215, 0x6fc4db63, 0x3df0022a, }; + +} // namespace MeshIofxParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class MeshIofxParameters : public NvParameterized::NvParameters, public MeshIofxParametersNS::ParametersStruct +{ +public: + MeshIofxParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~MeshIofxParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("MeshIofxParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)4; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(MeshIofxParametersNS::checksum); + return MeshIofxParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const MeshIofxParametersNS::ParametersStruct& parameters(void) const + { + MeshIofxParameters* tmpThis = const_cast<MeshIofxParameters*>(this); + return *(static_cast<MeshIofxParametersNS::ParametersStruct*>(tmpThis)); + } + + MeshIofxParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<MeshIofxParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class MeshIofxParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + MeshIofxParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(MeshIofxParameters), MeshIofxParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, MeshIofxParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class MeshIofxParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(MeshIofxParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, MeshIofxParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, MeshIofxParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, MeshIofxParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class MeshIofxParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of MeshIofxParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (MeshIofxParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (MeshIofxParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (MeshIofxParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (MeshIofxParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (MeshIofxParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ModuleIofxRegistration.h b/APEX_1.4/module/iofx/include/autogen/ModuleIofxRegistration.h new file mode 100644 index 00000000..db457b97 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ModuleIofxRegistration.h @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef MODULE_MODULEIOFXREGISTRATIONH_H +#define MODULE_MODULEIOFXREGISTRATIONH_H + +#include "PsAllocator.h" +#include "NvRegistrationsForTraitsBase.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "PxAssert.h" +#include <stdint.h> + +// INCLUDE GENERATED FACTORIES +#include "IofxDebugRenderParams.h" +#include "IofxAssetParameters.h" +#include "MeshIofxParameters.h" +#include "SpriteIofxParameters.h" +#include "RotationModifierParams.h" +#include "SimpleScaleModifierParams.h" +#include "ScaleByMassModifierParams.h" +#include "RandomScaleModifierParams.h" +#include "ColorVsLifeModifierParams.h" +#include "ColorVsLifeCompositeModifierParams.h" +#include "InitialColorModifierParams.h" +#include "ScaleVsLifeModifierParams.h" +#include "ScaleVsLife3DModifierParams.h" +#include "ScaleVsLife2DModifierParams.h" +#include "ScaleVsDensityModifierParams.h" +#include "ScaleVsDensity3DModifierParams.h" +#include "ScaleVsDensity2DModifierParams.h" +#include "ScaleVsCameraDistanceModifierParams.h" +#include "ScaleVsCameraDistance3DModifierParams.h" +#include "ScaleVsCameraDistance2DModifierParams.h" +#include "ColorVsDensityModifierParams.h" +#include "ColorVsDensityCompositeModifierParams.h" +#include "SubtextureVsLifeModifierParams.h" +#include "OrientAlongVelocityModifierParams.h" +#include "ScaleAlongVelocityModifierParams.h" +#include "RandomSubtextureModifierParams.h" +#include "RandomRotationModifierParams.h" +#include "ViewDirectionSortingModifierParams.h" +#include "RotationRateModifierParams.h" +#include "RotationRateVsLifeModifierParams.h" +#include "OrientScaleAlongScreenVelocityModifierParams.h" +#include "ColorVsVelocityModifierParams.h" +#include "ColorVsVelocityCompositeModifierParams.h" +#include "ColorVsTemperatureModifierParams.h" +#include "ColorVsTemperatureCompositeModifierParams.h" +#include "ScaleVsTemperatureModifierParams.h" +#include "ScaleVsTemperature3DModifierParams.h" +#include "ScaleVsTemperature2DModifierParams.h" +#include "IofxModuleParameters.h" + + +// INCLUDE GENERATED CONVERSION + + +namespace nvidia { +namespace iofx { + + +class ModuleIofxRegistration : public NvParameterized::RegistrationsForTraitsBase +{ +public: + static void invokeRegistration(NvParameterized::Traits* parameterizedTraits) + { + if (parameterizedTraits) + { + ModuleIofxRegistration().registerAll(*parameterizedTraits); + } + } + + static void invokeUnregistration(NvParameterized::Traits* parameterizedTraits) + { + if (parameterizedTraits) + { + ModuleIofxRegistration().unregisterAll(*parameterizedTraits); + } + } + + void registerAvailableFactories(NvParameterized::Traits& parameterizedTraits) + { + ::NvParameterized::Factory* factoriesToRegister[] = { +// REGISTER GENERATED FACTORIES + new nvidia::iofx::IofxDebugRenderParamsFactory(), + new nvidia::iofx::IofxAssetParametersFactory(), + new nvidia::iofx::MeshIofxParametersFactory(), + new nvidia::iofx::SpriteIofxParametersFactory(), + new nvidia::iofx::RotationModifierParamsFactory(), + new nvidia::iofx::SimpleScaleModifierParamsFactory(), + new nvidia::iofx::ScaleByMassModifierParamsFactory(), + new nvidia::iofx::RandomScaleModifierParamsFactory(), + new nvidia::iofx::ColorVsLifeModifierParamsFactory(), + new nvidia::iofx::ColorVsLifeCompositeModifierParamsFactory(), + new nvidia::iofx::InitialColorModifierParamsFactory(), + new nvidia::iofx::ScaleVsLifeModifierParamsFactory(), + new nvidia::iofx::ScaleVsLife3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsLife2DModifierParamsFactory(), + new nvidia::iofx::ScaleVsDensityModifierParamsFactory(), + new nvidia::iofx::ScaleVsDensity3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsDensity2DModifierParamsFactory(), + new nvidia::iofx::ScaleVsCameraDistanceModifierParamsFactory(), + new nvidia::iofx::ScaleVsCameraDistance3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsCameraDistance2DModifierParamsFactory(), + new nvidia::iofx::ColorVsDensityModifierParamsFactory(), + new nvidia::iofx::ColorVsDensityCompositeModifierParamsFactory(), + new nvidia::iofx::SubtextureVsLifeModifierParamsFactory(), + new nvidia::iofx::OrientAlongVelocityModifierParamsFactory(), + new nvidia::iofx::ScaleAlongVelocityModifierParamsFactory(), + new nvidia::iofx::RandomSubtextureModifierParamsFactory(), + new nvidia::iofx::RandomRotationModifierParamsFactory(), + new nvidia::iofx::ViewDirectionSortingModifierParamsFactory(), + new nvidia::iofx::RotationRateModifierParamsFactory(), + new nvidia::iofx::RotationRateVsLifeModifierParamsFactory(), + new nvidia::iofx::OrientScaleAlongScreenVelocityModifierParamsFactory(), + new nvidia::iofx::ColorVsVelocityModifierParamsFactory(), + new nvidia::iofx::ColorVsVelocityCompositeModifierParamsFactory(), + new nvidia::iofx::ColorVsTemperatureModifierParamsFactory(), + new nvidia::iofx::ColorVsTemperatureCompositeModifierParamsFactory(), + new nvidia::iofx::ScaleVsTemperatureModifierParamsFactory(), + new nvidia::iofx::ScaleVsTemperature3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsTemperature2DModifierParamsFactory(), + new nvidia::iofx::IofxModuleParametersFactory(), + + }; + + for (size_t i = 0; i < sizeof(factoriesToRegister)/sizeof(factoriesToRegister[0]); ++i) + { + parameterizedTraits.registerFactory(*factoriesToRegister[i]); + } + } + + virtual void registerAvailableConverters(NvParameterized::Traits& parameterizedTraits) + { +// REGISTER GENERATED CONVERSION +PX_UNUSED(parameterizedTraits); + + } + + void unregisterAvailableFactories(NvParameterized::Traits& parameterizedTraits) + { + struct FactoryDesc + { + const char* name; + uint32_t version; + }; + + ::NvParameterized::Factory* factoriesToUnregister[] = { +// UNREGISTER GENERATED FACTORIES + new nvidia::iofx::IofxDebugRenderParamsFactory(), + new nvidia::iofx::IofxAssetParametersFactory(), + new nvidia::iofx::MeshIofxParametersFactory(), + new nvidia::iofx::SpriteIofxParametersFactory(), + new nvidia::iofx::RotationModifierParamsFactory(), + new nvidia::iofx::SimpleScaleModifierParamsFactory(), + new nvidia::iofx::ScaleByMassModifierParamsFactory(), + new nvidia::iofx::RandomScaleModifierParamsFactory(), + new nvidia::iofx::ColorVsLifeModifierParamsFactory(), + new nvidia::iofx::ColorVsLifeCompositeModifierParamsFactory(), + new nvidia::iofx::InitialColorModifierParamsFactory(), + new nvidia::iofx::ScaleVsLifeModifierParamsFactory(), + new nvidia::iofx::ScaleVsLife3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsLife2DModifierParamsFactory(), + new nvidia::iofx::ScaleVsDensityModifierParamsFactory(), + new nvidia::iofx::ScaleVsDensity3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsDensity2DModifierParamsFactory(), + new nvidia::iofx::ScaleVsCameraDistanceModifierParamsFactory(), + new nvidia::iofx::ScaleVsCameraDistance3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsCameraDistance2DModifierParamsFactory(), + new nvidia::iofx::ColorVsDensityModifierParamsFactory(), + new nvidia::iofx::ColorVsDensityCompositeModifierParamsFactory(), + new nvidia::iofx::SubtextureVsLifeModifierParamsFactory(), + new nvidia::iofx::OrientAlongVelocityModifierParamsFactory(), + new nvidia::iofx::ScaleAlongVelocityModifierParamsFactory(), + new nvidia::iofx::RandomSubtextureModifierParamsFactory(), + new nvidia::iofx::RandomRotationModifierParamsFactory(), + new nvidia::iofx::ViewDirectionSortingModifierParamsFactory(), + new nvidia::iofx::RotationRateModifierParamsFactory(), + new nvidia::iofx::RotationRateVsLifeModifierParamsFactory(), + new nvidia::iofx::OrientScaleAlongScreenVelocityModifierParamsFactory(), + new nvidia::iofx::ColorVsVelocityModifierParamsFactory(), + new nvidia::iofx::ColorVsVelocityCompositeModifierParamsFactory(), + new nvidia::iofx::ColorVsTemperatureModifierParamsFactory(), + new nvidia::iofx::ColorVsTemperatureCompositeModifierParamsFactory(), + new nvidia::iofx::ScaleVsTemperatureModifierParamsFactory(), + new nvidia::iofx::ScaleVsTemperature3DModifierParamsFactory(), + new nvidia::iofx::ScaleVsTemperature2DModifierParamsFactory(), + new nvidia::iofx::IofxModuleParametersFactory(), + + }; + + for (size_t i = 0; i < sizeof(factoriesToUnregister)/sizeof(factoriesToUnregister[0]); ++i) + { + ::NvParameterized::Factory* removedFactory = parameterizedTraits.removeFactory(factoriesToUnregister[i]->getClassName(), factoriesToUnregister[i]->getVersion()); + if (!removedFactory) + { + PX_ASSERT_WITH_MESSAGE(0, "Factory can not be removed!"); + } + else + { + removedFactory->freeParameterDefinitionTable(¶meterizedTraits); + delete removedFactory; + delete factoriesToUnregister[i]; + } + } + } + + virtual void unregisterAvailableConverters(NvParameterized::Traits& parameterizedTraits) + { +// UNREGISTER GENERATED CONVERSION +PX_UNUSED(parameterizedTraits); + + } + +}; + + +} +} //nvidia::iofx + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/OrientAlongVelocityModifierParams.h b/APEX_1.4/module/iofx/include/autogen/OrientAlongVelocityModifierParams.h new file mode 100644 index 00000000..b1769c54 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/OrientAlongVelocityModifierParams.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_OrientAlongVelocityModifierParams_h +#define HEADER_OrientAlongVelocityModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace OrientAlongVelocityModifierParamsNS +{ + + + +struct ParametersStruct +{ + + physx::PxVec3 modelForward; + +}; + +static const uint32_t checksum[] = { 0xbec07bae, 0xf99a7cd3, 0xa819cd23, 0xe75ba471, }; + +} // namespace OrientAlongVelocityModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class OrientAlongVelocityModifierParams : public NvParameterized::NvParameters, public OrientAlongVelocityModifierParamsNS::ParametersStruct +{ +public: + OrientAlongVelocityModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~OrientAlongVelocityModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("OrientAlongVelocityModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(OrientAlongVelocityModifierParamsNS::checksum); + return OrientAlongVelocityModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const OrientAlongVelocityModifierParamsNS::ParametersStruct& parameters(void) const + { + OrientAlongVelocityModifierParams* tmpThis = const_cast<OrientAlongVelocityModifierParams*>(this); + return *(static_cast<OrientAlongVelocityModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + OrientAlongVelocityModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<OrientAlongVelocityModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class OrientAlongVelocityModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + OrientAlongVelocityModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(OrientAlongVelocityModifierParams), OrientAlongVelocityModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, OrientAlongVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class OrientAlongVelocityModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(OrientAlongVelocityModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, OrientAlongVelocityModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, OrientAlongVelocityModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, OrientAlongVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class OrientAlongVelocityModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of OrientAlongVelocityModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (OrientAlongVelocityModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (OrientAlongVelocityModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (OrientAlongVelocityModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (OrientAlongVelocityModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (OrientAlongVelocityModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/OrientScaleAlongScreenVelocityModifierParams.h b/APEX_1.4/module/iofx/include/autogen/OrientScaleAlongScreenVelocityModifierParams.h new file mode 100644 index 00000000..2cb0cdea --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/OrientScaleAlongScreenVelocityModifierParams.h @@ -0,0 +1,232 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_OrientScaleAlongScreenVelocityModifierParams_h +#define HEADER_OrientScaleAlongScreenVelocityModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace OrientScaleAlongScreenVelocityModifierParamsNS +{ + + + +struct ParametersStruct +{ + + float scalePerVelocity; + float scaleChangeLimit; + float scaleChangeDelay; + +}; + +static const uint32_t checksum[] = { 0x2a151b3c, 0x4a3faff3, 0xb9e6ebc2, 0x6ec77c7c, }; + +} // namespace OrientScaleAlongScreenVelocityModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class OrientScaleAlongScreenVelocityModifierParams : public NvParameterized::NvParameters, public OrientScaleAlongScreenVelocityModifierParamsNS::ParametersStruct +{ +public: + OrientScaleAlongScreenVelocityModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~OrientScaleAlongScreenVelocityModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("OrientScaleAlongScreenVelocityModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)1; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(OrientScaleAlongScreenVelocityModifierParamsNS::checksum); + return OrientScaleAlongScreenVelocityModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const OrientScaleAlongScreenVelocityModifierParamsNS::ParametersStruct& parameters(void) const + { + OrientScaleAlongScreenVelocityModifierParams* tmpThis = const_cast<OrientScaleAlongScreenVelocityModifierParams*>(this); + return *(static_cast<OrientScaleAlongScreenVelocityModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + OrientScaleAlongScreenVelocityModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<OrientScaleAlongScreenVelocityModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class OrientScaleAlongScreenVelocityModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + OrientScaleAlongScreenVelocityModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(OrientScaleAlongScreenVelocityModifierParams), OrientScaleAlongScreenVelocityModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, OrientScaleAlongScreenVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class OrientScaleAlongScreenVelocityModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(OrientScaleAlongScreenVelocityModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, OrientScaleAlongScreenVelocityModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, OrientScaleAlongScreenVelocityModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, OrientScaleAlongScreenVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class OrientScaleAlongScreenVelocityModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of OrientScaleAlongScreenVelocityModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (OrientScaleAlongScreenVelocityModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (OrientScaleAlongScreenVelocityModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (OrientScaleAlongScreenVelocityModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (OrientScaleAlongScreenVelocityModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (OrientScaleAlongScreenVelocityModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/RandomRotationModifierParams.h b/APEX_1.4/module/iofx/include/autogen/RandomRotationModifierParams.h new file mode 100644 index 00000000..ee380621 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/RandomRotationModifierParams.h @@ -0,0 +1,231 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_RandomRotationModifierParams_h +#define HEADER_RandomRotationModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace RandomRotationModifierParamsNS +{ + + + +struct ParametersStruct +{ + + float minRotation; + float maxRotation; + +}; + +static const uint32_t checksum[] = { 0xa4b51fa4, 0x02427ca9, 0xff6c9fc0, 0xe34b89b6, }; + +} // namespace RandomRotationModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class RandomRotationModifierParams : public NvParameterized::NvParameters, public RandomRotationModifierParamsNS::ParametersStruct +{ +public: + RandomRotationModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~RandomRotationModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("RandomRotationModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(RandomRotationModifierParamsNS::checksum); + return RandomRotationModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const RandomRotationModifierParamsNS::ParametersStruct& parameters(void) const + { + RandomRotationModifierParams* tmpThis = const_cast<RandomRotationModifierParams*>(this); + return *(static_cast<RandomRotationModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + RandomRotationModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<RandomRotationModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class RandomRotationModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + RandomRotationModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(RandomRotationModifierParams), RandomRotationModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, RandomRotationModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RandomRotationModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(RandomRotationModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, RandomRotationModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, RandomRotationModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, RandomRotationModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RandomRotationModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of RandomRotationModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (RandomRotationModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (RandomRotationModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (RandomRotationModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (RandomRotationModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (RandomRotationModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/RandomScaleModifierParams.h b/APEX_1.4/module/iofx/include/autogen/RandomScaleModifierParams.h new file mode 100644 index 00000000..1463126a --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/RandomScaleModifierParams.h @@ -0,0 +1,231 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_RandomScaleModifierParams_h +#define HEADER_RandomScaleModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace RandomScaleModifierParamsNS +{ + + + +struct ParametersStruct +{ + + float minScaleFactor; + float maxScaleFactor; + +}; + +static const uint32_t checksum[] = { 0x393214a5, 0x3920927a, 0x6b466949, 0x38714cd7, }; + +} // namespace RandomScaleModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class RandomScaleModifierParams : public NvParameterized::NvParameters, public RandomScaleModifierParamsNS::ParametersStruct +{ +public: + RandomScaleModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~RandomScaleModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("RandomScaleModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(RandomScaleModifierParamsNS::checksum); + return RandomScaleModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const RandomScaleModifierParamsNS::ParametersStruct& parameters(void) const + { + RandomScaleModifierParams* tmpThis = const_cast<RandomScaleModifierParams*>(this); + return *(static_cast<RandomScaleModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + RandomScaleModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<RandomScaleModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class RandomScaleModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + RandomScaleModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(RandomScaleModifierParams), RandomScaleModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, RandomScaleModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RandomScaleModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(RandomScaleModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, RandomScaleModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, RandomScaleModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, RandomScaleModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RandomScaleModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of RandomScaleModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (RandomScaleModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (RandomScaleModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (RandomScaleModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (RandomScaleModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (RandomScaleModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/RandomSubtextureModifierParams.h b/APEX_1.4/module/iofx/include/autogen/RandomSubtextureModifierParams.h new file mode 100644 index 00000000..78afe359 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/RandomSubtextureModifierParams.h @@ -0,0 +1,231 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_RandomSubtextureModifierParams_h +#define HEADER_RandomSubtextureModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace RandomSubtextureModifierParamsNS +{ + + + +struct ParametersStruct +{ + + float minSubtexture; + float maxSubtexture; + +}; + +static const uint32_t checksum[] = { 0x08f8796a, 0xa2e2f9c5, 0x8997cd3a, 0xc27f7e3a, }; + +} // namespace RandomSubtextureModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class RandomSubtextureModifierParams : public NvParameterized::NvParameters, public RandomSubtextureModifierParamsNS::ParametersStruct +{ +public: + RandomSubtextureModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~RandomSubtextureModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("RandomSubtextureModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(RandomSubtextureModifierParamsNS::checksum); + return RandomSubtextureModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const RandomSubtextureModifierParamsNS::ParametersStruct& parameters(void) const + { + RandomSubtextureModifierParams* tmpThis = const_cast<RandomSubtextureModifierParams*>(this); + return *(static_cast<RandomSubtextureModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + RandomSubtextureModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<RandomSubtextureModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class RandomSubtextureModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + RandomSubtextureModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(RandomSubtextureModifierParams), RandomSubtextureModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, RandomSubtextureModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RandomSubtextureModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(RandomSubtextureModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, RandomSubtextureModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, RandomSubtextureModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, RandomSubtextureModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RandomSubtextureModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of RandomSubtextureModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (RandomSubtextureModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (RandomSubtextureModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (RandomSubtextureModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (RandomSubtextureModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (RandomSubtextureModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/RotationModifierParams.h b/APEX_1.4/module/iofx/include/autogen/RotationModifierParams.h new file mode 100644 index 00000000..4bc2a457 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/RotationModifierParams.h @@ -0,0 +1,235 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_RotationModifierParams_h +#define HEADER_RotationModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace RotationModifierParamsNS +{ + + + +struct ParametersStruct +{ + + const char* rollType; + float maxRotationRatePerSec; + float maxSettleRatePerSec; + float inAirRotationMultiplier; + float collisionRotationMultiplier; + bool includeVerticalDirection; + +}; + +static const uint32_t checksum[] = { 0xd2cf5d27, 0xa1732803, 0xcaa84b84, 0x18ed9e7c, }; + +} // namespace RotationModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class RotationModifierParams : public NvParameterized::NvParameters, public RotationModifierParamsNS::ParametersStruct +{ +public: + RotationModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~RotationModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("RotationModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)2; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(RotationModifierParamsNS::checksum); + return RotationModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const RotationModifierParamsNS::ParametersStruct& parameters(void) const + { + RotationModifierParams* tmpThis = const_cast<RotationModifierParams*>(this); + return *(static_cast<RotationModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + RotationModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<RotationModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class RotationModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + RotationModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(RotationModifierParams), RotationModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, RotationModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RotationModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(RotationModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, RotationModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, RotationModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, RotationModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RotationModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of RotationModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (RotationModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (RotationModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (RotationModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (RotationModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (RotationModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/RotationRateModifierParams.h b/APEX_1.4/module/iofx/include/autogen/RotationRateModifierParams.h new file mode 100644 index 00000000..5290b1ae --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/RotationRateModifierParams.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_RotationRateModifierParams_h +#define HEADER_RotationRateModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace RotationRateModifierParamsNS +{ + + + +struct ParametersStruct +{ + + float rotationRate; + +}; + +static const uint32_t checksum[] = { 0x250808c0, 0x4e8042ab, 0x9e0339e9, 0x3130e44d, }; + +} // namespace RotationRateModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class RotationRateModifierParams : public NvParameterized::NvParameters, public RotationRateModifierParamsNS::ParametersStruct +{ +public: + RotationRateModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~RotationRateModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("RotationRateModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(RotationRateModifierParamsNS::checksum); + return RotationRateModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const RotationRateModifierParamsNS::ParametersStruct& parameters(void) const + { + RotationRateModifierParams* tmpThis = const_cast<RotationRateModifierParams*>(this); + return *(static_cast<RotationRateModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + RotationRateModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<RotationRateModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class RotationRateModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + RotationRateModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(RotationRateModifierParams), RotationRateModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, RotationRateModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RotationRateModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(RotationRateModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, RotationRateModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, RotationRateModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, RotationRateModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RotationRateModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of RotationRateModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (RotationRateModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (RotationRateModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (RotationRateModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (RotationRateModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (RotationRateModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/RotationRateVsLifeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/RotationRateVsLifeModifierParams.h new file mode 100644 index 00000000..4ab0547f --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/RotationRateVsLifeModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_RotationRateVsLifeModifierParams_h +#define HEADER_RotationRateVsLifeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace RotationRateVsLifeModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x704cda91, 0xcc96c538, 0x11f054f6, 0xa3fc1c9e, }; + +} // namespace RotationRateVsLifeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class RotationRateVsLifeModifierParams : public NvParameterized::NvParameters, public RotationRateVsLifeModifierParamsNS::ParametersStruct +{ +public: + RotationRateVsLifeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~RotationRateVsLifeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("RotationRateVsLifeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(RotationRateVsLifeModifierParamsNS::checksum); + return RotationRateVsLifeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const RotationRateVsLifeModifierParamsNS::ParametersStruct& parameters(void) const + { + RotationRateVsLifeModifierParams* tmpThis = const_cast<RotationRateVsLifeModifierParams*>(this); + return *(static_cast<RotationRateVsLifeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + RotationRateVsLifeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<RotationRateVsLifeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class RotationRateVsLifeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + RotationRateVsLifeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(RotationRateVsLifeModifierParams), RotationRateVsLifeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, RotationRateVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RotationRateVsLifeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(RotationRateVsLifeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, RotationRateVsLifeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, RotationRateVsLifeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, RotationRateVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class RotationRateVsLifeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of RotationRateVsLifeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (RotationRateVsLifeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (RotationRateVsLifeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (RotationRateVsLifeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (RotationRateVsLifeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (RotationRateVsLifeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleAlongVelocityModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleAlongVelocityModifierParams.h new file mode 100644 index 00000000..c6ae8535 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleAlongVelocityModifierParams.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleAlongVelocityModifierParams_h +#define HEADER_ScaleAlongVelocityModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleAlongVelocityModifierParamsNS +{ + + + +struct ParametersStruct +{ + + float scaleFactor; + +}; + +static const uint32_t checksum[] = { 0x3c361211, 0x221d234b, 0x639bf597, 0xcca2608b, }; + +} // namespace ScaleAlongVelocityModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleAlongVelocityModifierParams : public NvParameterized::NvParameters, public ScaleAlongVelocityModifierParamsNS::ParametersStruct +{ +public: + ScaleAlongVelocityModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleAlongVelocityModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleAlongVelocityModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleAlongVelocityModifierParamsNS::checksum); + return ScaleAlongVelocityModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleAlongVelocityModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleAlongVelocityModifierParams* tmpThis = const_cast<ScaleAlongVelocityModifierParams*>(this); + return *(static_cast<ScaleAlongVelocityModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleAlongVelocityModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleAlongVelocityModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleAlongVelocityModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleAlongVelocityModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleAlongVelocityModifierParams), ScaleAlongVelocityModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleAlongVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleAlongVelocityModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleAlongVelocityModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleAlongVelocityModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleAlongVelocityModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleAlongVelocityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleAlongVelocityModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleAlongVelocityModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleAlongVelocityModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleAlongVelocityModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleAlongVelocityModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleAlongVelocityModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleAlongVelocityModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleByMassModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleByMassModifierParams.h new file mode 100644 index 00000000..27735cc6 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleByMassModifierParams.h @@ -0,0 +1,229 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleByMassModifierParams_h +#define HEADER_ScaleByMassModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleByMassModifierParamsNS +{ + + + +struct ParametersStruct +{ + + +}; + +static const uint32_t checksum[] = { 0x0164ba51, 0x109896dc, 0x1c51ccab, 0xc0cebd7a, }; + +} // namespace ScaleByMassModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleByMassModifierParams : public NvParameterized::NvParameters, public ScaleByMassModifierParamsNS::ParametersStruct +{ +public: + ScaleByMassModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleByMassModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleByMassModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleByMassModifierParamsNS::checksum); + return ScaleByMassModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleByMassModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleByMassModifierParams* tmpThis = const_cast<ScaleByMassModifierParams*>(this); + return *(static_cast<ScaleByMassModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleByMassModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleByMassModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleByMassModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleByMassModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleByMassModifierParams), ScaleByMassModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleByMassModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleByMassModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleByMassModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleByMassModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleByMassModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleByMassModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleByMassModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleByMassModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleByMassModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleByMassModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleByMassModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleByMassModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleByMassModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistance2DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistance2DModifierParams.h new file mode 100644 index 00000000..9addb5c9 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistance2DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsCameraDistance2DModifierParams_h +#define HEADER_ScaleVsCameraDistance2DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsCameraDistance2DModifierParamsNS +{ + +struct scaleCameraDistanceStruct_Type; + +struct scaleCameraDistanceStruct_DynamicArray1D_Type +{ + scaleCameraDistanceStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleCameraDistanceStruct_Type +{ + float cameraDistance; + physx::PxVec2 scale; +}; + +struct ParametersStruct +{ + + scaleCameraDistanceStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xa1847ef6, 0x35e96cc6, 0xd3de86e9, 0x977d685a, }; + +} // namespace ScaleVsCameraDistance2DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsCameraDistance2DModifierParams : public NvParameterized::NvParameters, public ScaleVsCameraDistance2DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsCameraDistance2DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsCameraDistance2DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsCameraDistance2DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsCameraDistance2DModifierParamsNS::checksum); + return ScaleVsCameraDistance2DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsCameraDistance2DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsCameraDistance2DModifierParams* tmpThis = const_cast<ScaleVsCameraDistance2DModifierParams*>(this); + return *(static_cast<ScaleVsCameraDistance2DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsCameraDistance2DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsCameraDistance2DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsCameraDistance2DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsCameraDistance2DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsCameraDistance2DModifierParams), ScaleVsCameraDistance2DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsCameraDistance2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsCameraDistance2DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsCameraDistance2DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsCameraDistance2DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsCameraDistance2DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsCameraDistance2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsCameraDistance2DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsCameraDistance2DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsCameraDistance2DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsCameraDistance2DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsCameraDistance2DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsCameraDistance2DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsCameraDistance2DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistance3DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistance3DModifierParams.h new file mode 100644 index 00000000..715ac901 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistance3DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsCameraDistance3DModifierParams_h +#define HEADER_ScaleVsCameraDistance3DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsCameraDistance3DModifierParamsNS +{ + +struct scaleCameraDistanceStruct_Type; + +struct scaleCameraDistanceStruct_DynamicArray1D_Type +{ + scaleCameraDistanceStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleCameraDistanceStruct_Type +{ + float cameraDistance; + physx::PxVec3 scale; +}; + +struct ParametersStruct +{ + + scaleCameraDistanceStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x661390b6, 0x5566a427, 0x6507630a, 0x6aff3b6e, }; + +} // namespace ScaleVsCameraDistance3DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsCameraDistance3DModifierParams : public NvParameterized::NvParameters, public ScaleVsCameraDistance3DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsCameraDistance3DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsCameraDistance3DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsCameraDistance3DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsCameraDistance3DModifierParamsNS::checksum); + return ScaleVsCameraDistance3DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsCameraDistance3DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsCameraDistance3DModifierParams* tmpThis = const_cast<ScaleVsCameraDistance3DModifierParams*>(this); + return *(static_cast<ScaleVsCameraDistance3DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsCameraDistance3DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsCameraDistance3DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsCameraDistance3DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsCameraDistance3DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsCameraDistance3DModifierParams), ScaleVsCameraDistance3DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsCameraDistance3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsCameraDistance3DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsCameraDistance3DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsCameraDistance3DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsCameraDistance3DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsCameraDistance3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsCameraDistance3DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsCameraDistance3DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsCameraDistance3DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsCameraDistance3DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsCameraDistance3DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsCameraDistance3DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsCameraDistance3DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistanceModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistanceModifierParams.h new file mode 100644 index 00000000..253eabce --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsCameraDistanceModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsCameraDistanceModifierParams_h +#define HEADER_ScaleVsCameraDistanceModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsCameraDistanceModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* scaleAxis; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x2c4aba3d, 0xa1d08f53, 0xfb08d5f3, 0xe12927dd, }; + +} // namespace ScaleVsCameraDistanceModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsCameraDistanceModifierParams : public NvParameterized::NvParameters, public ScaleVsCameraDistanceModifierParamsNS::ParametersStruct +{ +public: + ScaleVsCameraDistanceModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsCameraDistanceModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsCameraDistanceModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsCameraDistanceModifierParamsNS::checksum); + return ScaleVsCameraDistanceModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsCameraDistanceModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsCameraDistanceModifierParams* tmpThis = const_cast<ScaleVsCameraDistanceModifierParams*>(this); + return *(static_cast<ScaleVsCameraDistanceModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsCameraDistanceModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsCameraDistanceModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsCameraDistanceModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsCameraDistanceModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsCameraDistanceModifierParams), ScaleVsCameraDistanceModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsCameraDistanceModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsCameraDistanceModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsCameraDistanceModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsCameraDistanceModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsCameraDistanceModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsCameraDistanceModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsCameraDistanceModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsCameraDistanceModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsCameraDistanceModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsCameraDistanceModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsCameraDistanceModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsCameraDistanceModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsCameraDistanceModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsDensity2DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsDensity2DModifierParams.h new file mode 100644 index 00000000..fb5f0e4f --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsDensity2DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsDensity2DModifierParams_h +#define HEADER_ScaleVsDensity2DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsDensity2DModifierParamsNS +{ + +struct scaleDensityStruct_Type; + +struct scaleDensityStruct_DynamicArray1D_Type +{ + scaleDensityStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleDensityStruct_Type +{ + float density; + physx::PxVec2 scale; +}; + +struct ParametersStruct +{ + + scaleDensityStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x67c772d8, 0x2f573535, 0xdd3f3715, 0xea4c896d, }; + +} // namespace ScaleVsDensity2DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsDensity2DModifierParams : public NvParameterized::NvParameters, public ScaleVsDensity2DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsDensity2DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsDensity2DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsDensity2DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsDensity2DModifierParamsNS::checksum); + return ScaleVsDensity2DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsDensity2DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsDensity2DModifierParams* tmpThis = const_cast<ScaleVsDensity2DModifierParams*>(this); + return *(static_cast<ScaleVsDensity2DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsDensity2DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsDensity2DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsDensity2DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsDensity2DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsDensity2DModifierParams), ScaleVsDensity2DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsDensity2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsDensity2DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsDensity2DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsDensity2DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsDensity2DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsDensity2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsDensity2DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsDensity2DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsDensity2DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsDensity2DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsDensity2DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsDensity2DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsDensity2DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsDensity3DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsDensity3DModifierParams.h new file mode 100644 index 00000000..de04c5b1 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsDensity3DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsDensity3DModifierParams_h +#define HEADER_ScaleVsDensity3DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsDensity3DModifierParamsNS +{ + +struct scaleDensityStruct_Type; + +struct scaleDensityStruct_DynamicArray1D_Type +{ + scaleDensityStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleDensityStruct_Type +{ + float density; + physx::PxVec3 scale; +}; + +struct ParametersStruct +{ + + scaleDensityStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x0dddf0d6, 0x459996e0, 0x32b4d7ce, 0x8e0d1b52, }; + +} // namespace ScaleVsDensity3DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsDensity3DModifierParams : public NvParameterized::NvParameters, public ScaleVsDensity3DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsDensity3DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsDensity3DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsDensity3DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsDensity3DModifierParamsNS::checksum); + return ScaleVsDensity3DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsDensity3DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsDensity3DModifierParams* tmpThis = const_cast<ScaleVsDensity3DModifierParams*>(this); + return *(static_cast<ScaleVsDensity3DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsDensity3DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsDensity3DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsDensity3DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsDensity3DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsDensity3DModifierParams), ScaleVsDensity3DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsDensity3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsDensity3DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsDensity3DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsDensity3DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsDensity3DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsDensity3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsDensity3DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsDensity3DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsDensity3DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsDensity3DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsDensity3DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsDensity3DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsDensity3DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsDensityModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsDensityModifierParams.h new file mode 100644 index 00000000..3e1b38ea --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsDensityModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsDensityModifierParams_h +#define HEADER_ScaleVsDensityModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsDensityModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* scaleAxis; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x6f22ca8e, 0x609b223e, 0x81d9cacc, 0x9ca002f4, }; + +} // namespace ScaleVsDensityModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsDensityModifierParams : public NvParameterized::NvParameters, public ScaleVsDensityModifierParamsNS::ParametersStruct +{ +public: + ScaleVsDensityModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsDensityModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsDensityModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsDensityModifierParamsNS::checksum); + return ScaleVsDensityModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsDensityModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsDensityModifierParams* tmpThis = const_cast<ScaleVsDensityModifierParams*>(this); + return *(static_cast<ScaleVsDensityModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsDensityModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsDensityModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsDensityModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsDensityModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsDensityModifierParams), ScaleVsDensityModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsDensityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsDensityModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsDensityModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsDensityModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsDensityModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsDensityModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsDensityModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsDensityModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsDensityModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsDensityModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsDensityModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsDensityModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsDensityModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsLife2DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsLife2DModifierParams.h new file mode 100644 index 00000000..7b51e51b --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsLife2DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsLife2DModifierParams_h +#define HEADER_ScaleVsLife2DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsLife2DModifierParamsNS +{ + +struct scaleLifeStruct_Type; + +struct scaleLifeStruct_DynamicArray1D_Type +{ + scaleLifeStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleLifeStruct_Type +{ + float lifeRemaining; + physx::PxVec2 scale; +}; + +struct ParametersStruct +{ + + scaleLifeStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x6db3956a, 0xa58c530d, 0xff315c26, 0xddb49833, }; + +} // namespace ScaleVsLife2DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsLife2DModifierParams : public NvParameterized::NvParameters, public ScaleVsLife2DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsLife2DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsLife2DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsLife2DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsLife2DModifierParamsNS::checksum); + return ScaleVsLife2DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsLife2DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsLife2DModifierParams* tmpThis = const_cast<ScaleVsLife2DModifierParams*>(this); + return *(static_cast<ScaleVsLife2DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsLife2DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsLife2DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsLife2DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsLife2DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsLife2DModifierParams), ScaleVsLife2DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsLife2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsLife2DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsLife2DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsLife2DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsLife2DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsLife2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsLife2DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsLife2DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsLife2DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsLife2DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsLife2DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsLife2DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsLife2DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsLife3DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsLife3DModifierParams.h new file mode 100644 index 00000000..d1dcb372 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsLife3DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsLife3DModifierParams_h +#define HEADER_ScaleVsLife3DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsLife3DModifierParamsNS +{ + +struct scaleLifeStruct_Type; + +struct scaleLifeStruct_DynamicArray1D_Type +{ + scaleLifeStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleLifeStruct_Type +{ + float lifeRemaining; + physx::PxVec3 scale; +}; + +struct ParametersStruct +{ + + scaleLifeStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xbaddcfda, 0x2f4deda9, 0x2c23286e, 0xf19659fd, }; + +} // namespace ScaleVsLife3DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsLife3DModifierParams : public NvParameterized::NvParameters, public ScaleVsLife3DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsLife3DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsLife3DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsLife3DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsLife3DModifierParamsNS::checksum); + return ScaleVsLife3DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsLife3DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsLife3DModifierParams* tmpThis = const_cast<ScaleVsLife3DModifierParams*>(this); + return *(static_cast<ScaleVsLife3DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsLife3DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsLife3DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsLife3DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsLife3DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsLife3DModifierParams), ScaleVsLife3DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsLife3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsLife3DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsLife3DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsLife3DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsLife3DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsLife3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsLife3DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsLife3DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsLife3DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsLife3DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsLife3DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsLife3DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsLife3DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsLifeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsLifeModifierParams.h new file mode 100644 index 00000000..d087f4bc --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsLifeModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsLifeModifierParams_h +#define HEADER_ScaleVsLifeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsLifeModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* scaleAxis; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xfed4c822, 0x131f7e2d, 0x1bedc356, 0xcbf77236, }; + +} // namespace ScaleVsLifeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsLifeModifierParams : public NvParameterized::NvParameters, public ScaleVsLifeModifierParamsNS::ParametersStruct +{ +public: + ScaleVsLifeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsLifeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsLifeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsLifeModifierParamsNS::checksum); + return ScaleVsLifeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsLifeModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsLifeModifierParams* tmpThis = const_cast<ScaleVsLifeModifierParams*>(this); + return *(static_cast<ScaleVsLifeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsLifeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsLifeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsLifeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsLifeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsLifeModifierParams), ScaleVsLifeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsLifeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsLifeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsLifeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsLifeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsLifeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsLifeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsLifeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsLifeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsLifeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsLifeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsLifeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperature2DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperature2DModifierParams.h new file mode 100644 index 00000000..59ebbf6d --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperature2DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsTemperature2DModifierParams_h +#define HEADER_ScaleVsTemperature2DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsTemperature2DModifierParamsNS +{ + +struct scaleTemperatureStruct_Type; + +struct scaleTemperatureStruct_DynamicArray1D_Type +{ + scaleTemperatureStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleTemperatureStruct_Type +{ + float temperature; + physx::PxVec2 scale; +}; + +struct ParametersStruct +{ + + scaleTemperatureStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xd5330296, 0xc6fa1947, 0x152d1b30, 0x07453e5c, }; + +} // namespace ScaleVsTemperature2DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsTemperature2DModifierParams : public NvParameterized::NvParameters, public ScaleVsTemperature2DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsTemperature2DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsTemperature2DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsTemperature2DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsTemperature2DModifierParamsNS::checksum); + return ScaleVsTemperature2DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsTemperature2DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsTemperature2DModifierParams* tmpThis = const_cast<ScaleVsTemperature2DModifierParams*>(this); + return *(static_cast<ScaleVsTemperature2DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsTemperature2DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsTemperature2DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsTemperature2DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsTemperature2DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsTemperature2DModifierParams), ScaleVsTemperature2DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsTemperature2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsTemperature2DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsTemperature2DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsTemperature2DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsTemperature2DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsTemperature2DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsTemperature2DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsTemperature2DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsTemperature2DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsTemperature2DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsTemperature2DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsTemperature2DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsTemperature2DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperature3DModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperature3DModifierParams.h new file mode 100644 index 00000000..986e223b --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperature3DModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsTemperature3DModifierParams_h +#define HEADER_ScaleVsTemperature3DModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsTemperature3DModifierParamsNS +{ + +struct scaleTemperatureStruct_Type; + +struct scaleTemperatureStruct_DynamicArray1D_Type +{ + scaleTemperatureStruct_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct scaleTemperatureStruct_Type +{ + float temperature; + physx::PxVec3 scale; +}; + +struct ParametersStruct +{ + + scaleTemperatureStruct_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x25b25469, 0xa653dacc, 0x1c3167df, 0xd3a6b16f, }; + +} // namespace ScaleVsTemperature3DModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsTemperature3DModifierParams : public NvParameterized::NvParameters, public ScaleVsTemperature3DModifierParamsNS::ParametersStruct +{ +public: + ScaleVsTemperature3DModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsTemperature3DModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsTemperature3DModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsTemperature3DModifierParamsNS::checksum); + return ScaleVsTemperature3DModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsTemperature3DModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsTemperature3DModifierParams* tmpThis = const_cast<ScaleVsTemperature3DModifierParams*>(this); + return *(static_cast<ScaleVsTemperature3DModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsTemperature3DModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsTemperature3DModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsTemperature3DModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsTemperature3DModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsTemperature3DModifierParams), ScaleVsTemperature3DModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsTemperature3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsTemperature3DModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsTemperature3DModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsTemperature3DModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsTemperature3DModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsTemperature3DModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsTemperature3DModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsTemperature3DModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsTemperature3DModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsTemperature3DModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsTemperature3DModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsTemperature3DModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsTemperature3DModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperatureModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperatureModifierParams.h new file mode 100644 index 00000000..5d4ee275 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ScaleVsTemperatureModifierParams.h @@ -0,0 +1,245 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ScaleVsTemperatureModifierParams_h +#define HEADER_ScaleVsTemperatureModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ScaleVsTemperatureModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + const char* scaleAxis; + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0xd0fc7da0, 0x19500653, 0x8b0cfc22, 0xa80392bd, }; + +} // namespace ScaleVsTemperatureModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ScaleVsTemperatureModifierParams : public NvParameterized::NvParameters, public ScaleVsTemperatureModifierParamsNS::ParametersStruct +{ +public: + ScaleVsTemperatureModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ScaleVsTemperatureModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ScaleVsTemperatureModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ScaleVsTemperatureModifierParamsNS::checksum); + return ScaleVsTemperatureModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ScaleVsTemperatureModifierParamsNS::ParametersStruct& parameters(void) const + { + ScaleVsTemperatureModifierParams* tmpThis = const_cast<ScaleVsTemperatureModifierParams*>(this); + return *(static_cast<ScaleVsTemperatureModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ScaleVsTemperatureModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ScaleVsTemperatureModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ScaleVsTemperatureModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ScaleVsTemperatureModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ScaleVsTemperatureModifierParams), ScaleVsTemperatureModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ScaleVsTemperatureModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsTemperatureModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ScaleVsTemperatureModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ScaleVsTemperatureModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ScaleVsTemperatureModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ScaleVsTemperatureModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ScaleVsTemperatureModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ScaleVsTemperatureModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ScaleVsTemperatureModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ScaleVsTemperatureModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ScaleVsTemperatureModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ScaleVsTemperatureModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ScaleVsTemperatureModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/SimpleScaleModifierParams.h b/APEX_1.4/module/iofx/include/autogen/SimpleScaleModifierParams.h new file mode 100644 index 00000000..cc86d886 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/SimpleScaleModifierParams.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_SimpleScaleModifierParams_h +#define HEADER_SimpleScaleModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace SimpleScaleModifierParamsNS +{ + + + +struct ParametersStruct +{ + + physx::PxVec3 scaleFactor; + +}; + +static const uint32_t checksum[] = { 0x7a1ac6ca, 0x76ef1cd2, 0x991bfe05, 0x30c11a09, }; + +} // namespace SimpleScaleModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class SimpleScaleModifierParams : public NvParameterized::NvParameters, public SimpleScaleModifierParamsNS::ParametersStruct +{ +public: + SimpleScaleModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~SimpleScaleModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("SimpleScaleModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(SimpleScaleModifierParamsNS::checksum); + return SimpleScaleModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const SimpleScaleModifierParamsNS::ParametersStruct& parameters(void) const + { + SimpleScaleModifierParams* tmpThis = const_cast<SimpleScaleModifierParams*>(this); + return *(static_cast<SimpleScaleModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + SimpleScaleModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<SimpleScaleModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class SimpleScaleModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + SimpleScaleModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(SimpleScaleModifierParams), SimpleScaleModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, SimpleScaleModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SimpleScaleModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(SimpleScaleModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, SimpleScaleModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, SimpleScaleModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, SimpleScaleModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SimpleScaleModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of SimpleScaleModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (SimpleScaleModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (SimpleScaleModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (SimpleScaleModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (SimpleScaleModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (SimpleScaleModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/SpriteIofxParameters.h b/APEX_1.4/module/iofx/include/autogen/SpriteIofxParameters.h new file mode 100644 index 00000000..28292c11 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/SpriteIofxParameters.h @@ -0,0 +1,240 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_SpriteIofxParameters_h +#define HEADER_SpriteIofxParameters_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace SpriteIofxParametersNS +{ + + +struct REF_DynamicArray1D_Type +{ + NvParameterized::Interface** buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + + +struct ParametersStruct +{ + + NvParameterized::Interface* spriteMaterialName; + REF_DynamicArray1D_Type spawnModifierList; + REF_DynamicArray1D_Type continuousModifierList; + +}; + +static const uint32_t checksum[] = { 0x9763d523, 0x7dae1ae1, 0x3bb7aa9d, 0x67a8d368, }; + +} // namespace SpriteIofxParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class SpriteIofxParameters : public NvParameterized::NvParameters, public SpriteIofxParametersNS::ParametersStruct +{ +public: + SpriteIofxParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~SpriteIofxParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("SpriteIofxParameters"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)4; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(SpriteIofxParametersNS::checksum); + return SpriteIofxParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const SpriteIofxParametersNS::ParametersStruct& parameters(void) const + { + SpriteIofxParameters* tmpThis = const_cast<SpriteIofxParameters*>(this); + return *(static_cast<SpriteIofxParametersNS::ParametersStruct*>(tmpThis)); + } + + SpriteIofxParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<SpriteIofxParametersNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class SpriteIofxParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + SpriteIofxParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(SpriteIofxParameters), SpriteIofxParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, SpriteIofxParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SpriteIofxParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(SpriteIofxParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, SpriteIofxParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, SpriteIofxParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, SpriteIofxParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SpriteIofxParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of SpriteIofxParameters here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (SpriteIofxParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (SpriteIofxParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (SpriteIofxParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (SpriteIofxParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (SpriteIofxParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/SubtextureVsLifeModifierParams.h b/APEX_1.4/module/iofx/include/autogen/SubtextureVsLifeModifierParams.h new file mode 100644 index 00000000..59793101 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/SubtextureVsLifeModifierParams.h @@ -0,0 +1,244 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_SubtextureVsLifeModifierParams_h +#define HEADER_SubtextureVsLifeModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace SubtextureVsLifeModifierParamsNS +{ + +struct vec2_Type; + +struct vec2_DynamicArray1D_Type +{ + vec2_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct vec2_Type +{ + float x; + float y; +}; + +struct ParametersStruct +{ + + vec2_DynamicArray1D_Type controlPoints; + +}; + +static const uint32_t checksum[] = { 0x38be217d, 0xe6774f18, 0x591a0a04, 0x64e61b1e, }; + +} // namespace SubtextureVsLifeModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class SubtextureVsLifeModifierParams : public NvParameterized::NvParameters, public SubtextureVsLifeModifierParamsNS::ParametersStruct +{ +public: + SubtextureVsLifeModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~SubtextureVsLifeModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("SubtextureVsLifeModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(SubtextureVsLifeModifierParamsNS::checksum); + return SubtextureVsLifeModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const SubtextureVsLifeModifierParamsNS::ParametersStruct& parameters(void) const + { + SubtextureVsLifeModifierParams* tmpThis = const_cast<SubtextureVsLifeModifierParams*>(this); + return *(static_cast<SubtextureVsLifeModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + SubtextureVsLifeModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<SubtextureVsLifeModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class SubtextureVsLifeModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + SubtextureVsLifeModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(SubtextureVsLifeModifierParams), SubtextureVsLifeModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, SubtextureVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SubtextureVsLifeModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(SubtextureVsLifeModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, SubtextureVsLifeModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, SubtextureVsLifeModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, SubtextureVsLifeModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class SubtextureVsLifeModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of SubtextureVsLifeModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (SubtextureVsLifeModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (SubtextureVsLifeModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (SubtextureVsLifeModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (SubtextureVsLifeModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (SubtextureVsLifeModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/include/autogen/ViewDirectionSortingModifierParams.h b/APEX_1.4/module/iofx/include/autogen/ViewDirectionSortingModifierParams.h new file mode 100644 index 00000000..eea2ddf0 --- /dev/null +++ b/APEX_1.4/module/iofx/include/autogen/ViewDirectionSortingModifierParams.h @@ -0,0 +1,230 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ViewDirectionSortingModifierParams_h +#define HEADER_ViewDirectionSortingModifierParams_h + +#include "NvParametersTypes.h" + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "NvParameters.h" +#include "NvTraitsInternal.h" +#endif + +namespace nvidia +{ +namespace iofx +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ViewDirectionSortingModifierParamsNS +{ + + + +struct ParametersStruct +{ + + const char* sortType; + +}; + +static const uint32_t checksum[] = { 0x273be54c, 0xc9bfbfeb, 0x0523921d, 0x48c3bc2d, }; + +} // namespace ViewDirectionSortingModifierParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ViewDirectionSortingModifierParams : public NvParameterized::NvParameters, public ViewDirectionSortingModifierParamsNS::ParametersStruct +{ +public: + ViewDirectionSortingModifierParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ViewDirectionSortingModifierParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ViewDirectionSortingModifierParams"); + } + + const char* className(void) const + { + return(staticClassName()); + } + + static const uint32_t ClassVersion = ((uint32_t)0 << 16) + (uint32_t)0; + + static uint32_t staticVersion(void) + { + return ClassVersion; + } + + uint32_t version(void) const + { + return(staticVersion()); + } + + static const uint32_t ClassAlignment = 8; + + static const uint32_t* staticChecksum(uint32_t& bits) + { + bits = 8 * sizeof(ViewDirectionSortingModifierParamsNS::checksum); + return ViewDirectionSortingModifierParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ViewDirectionSortingModifierParamsNS::ParametersStruct& parameters(void) const + { + ViewDirectionSortingModifierParams* tmpThis = const_cast<ViewDirectionSortingModifierParams*>(this); + return *(static_cast<ViewDirectionSortingModifierParamsNS::ParametersStruct*>(tmpThis)); + } + + ViewDirectionSortingModifierParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<ViewDirectionSortingModifierParamsNS::ParametersStruct*>(this)); + } + + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle) const; + virtual NvParameterized::ErrorType getParameterHandle(const char* long_name, NvParameterized::Handle& handle); + + void initDefaults(void); + +protected: + + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void); + virtual const NvParameterized::DefinitionImpl* getParameterDefinitionTree(void) const; + + + virtual void getVarPtr(const NvParameterized::Handle& handle, void*& ptr, size_t& offset) const; + +private: + + void buildTree(void); + void initDynamicArrays(void); + void initStrings(void); + void initReferences(void); + void freeDynamicArrays(void); + void freeStrings(void); + void freeReferences(void); + + static bool mBuiltFlag; + static NvParameterized::MutexType mBuiltFlagMutex; +}; + +class ViewDirectionSortingModifierParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ViewDirectionSortingModifierParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ViewDirectionSortingModifierParams), ViewDirectionSortingModifierParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ViewDirectionSortingModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ViewDirectionSortingModifierParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ViewDirectionSortingModifierParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ViewDirectionSortingModifierParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ViewDirectionSortingModifierParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ViewDirectionSortingModifierParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ViewDirectionSortingModifierParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ViewDirectionSortingModifierParams here + // but it may call default constructors of members and spoil the data + NV_PARAM_PLACEMENT_NEW(bufObj, NvParameterized::NvParameters)(paramTraits, bufStart, refCount); + + // Init vtable (everything else is already initialized) + *(const char**)bufObj = vptr; + + return (ViewDirectionSortingModifierParams*)bufObj; + } + + virtual const char* getClassName() + { + return (ViewDirectionSortingModifierParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ViewDirectionSortingModifierParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ViewDirectionSortingModifierParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ViewDirectionSortingModifierParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace iofx +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/APEX_1.4/module/iofx/src/IofxActorCPU.cpp b/APEX_1.4/module/iofx/src/IofxActorCPU.cpp new file mode 100644 index 00000000..25663b71 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxActorCPU.cpp @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "SceneIntl.h" +#include "Modifier.h" +#include "IofxActor.h" +#include "IofxActorCPU.h" +#include "IofxAssetImpl.h" +#include "IofxSceneCPU.h" +#include "IosObjectData.h" + +#include "ModuleIofxImpl.h" + +#include "ARLSort.h" + + +namespace nvidia +{ +namespace iofx +{ + +void TaskModifiers::run() +{ + setProfileStat((uint16_t) mOwner.mWorkingRange.objectCount); + mOwner.updateBounds(); + mOwner.runModifiers(); +} + + +#pragma warning(disable: 4355) // 'this' : used in base member initializer list + +IofxActorCPU::IofxActorCPU(ResID renderResID, IofxScene* iscene, IofxManager& mgr) + : IofxActorImpl(renderResID, iscene, mgr) + , mModifierTask(*this) +{ +} + +void IofxActorCPU::updateBounds() +{ + mWorkingBounds.setEmpty(); + + const IosObjectCpuData& objData = *static_cast<const IosObjectCpuData*>(mMgr.mWorkingIosData); + + for (uint32_t id = 0; id < mWorkingRange.objectCount; id++) + { + uint32_t outputID = mWorkingRange.startIndex + id; + + uint32_t stateID = objData.outputToState[ outputID ]; + PX_ASSERT(stateID != IosBufferDescIntl::NOT_A_PARTICLE); + PX_ASSERT(stateID < objData.maxStateID); + + uint32_t inputID = objData.pmaInStateToInput->get(stateID); + PX_ASSERT(inputID != IosBufferDescIntl::NOT_A_PARTICLE); + inputID &= ~IosBufferDescIntl::NEW_PARTICLE_FLAG; + PX_ASSERT(inputID < objData.maxInputCount); + + // include particle in renderable bounds + mWorkingBounds.include(objData.pmaPositionMass->get(inputID).getXYZ()); + } +} + +PX_INLINE void MeshInput::load(const IosObjectBaseData& objData, uint32_t pos) +{ + position = objData.pmaPositionMass->get(pos).getXYZ(); + mass = objData.pmaPositionMass->get(pos).w; + velocity = objData.pmaVelocityLife->get(pos).getXYZ(); + liferemain = objData.pmaVelocityLife->get(pos).w; + density = objData.pmaDensity ? objData.pmaDensity->get(pos) : 0; + collisionNormal = objData.pmaCollisionNormalFlags ? objData.pmaCollisionNormalFlags->get(pos).getXYZ() : PxVec3(0.0f); + collisionFlags = objData.pmaCollisionNormalFlags ? *(const uint32_t*)(&objData.pmaCollisionNormalFlags->get(pos).w) : 0; + + userData = objData.pmaUserData ? objData.pmaUserData->get(pos) : 0; +} + +PX_INLINE void SpriteInput::load(const IosObjectBaseData& objData, uint32_t pos) +{ + position = objData.pmaPositionMass->get(pos).getXYZ(); + mass = objData.pmaPositionMass->get(pos).w; + velocity = objData.pmaVelocityLife->get(pos).getXYZ(); + liferemain = objData.pmaVelocityLife->get(pos).w; + density = objData.pmaDensity ? objData.pmaDensity->get(pos) : 0; + + userData = objData.pmaUserData ? objData.pmaUserData->get(pos) : 0; +} + + +void IofxActorCPU::runModifiers() +{ + mWorkingVisibleCount = mWorkingRange.objectCount; + + IosObjectCpuData* obj = DYNAMIC_CAST(IosObjectCpuData*)(mMgr.mWorkingIosData); + if (mMgr.mIsMesh) + { + IofxSharedRenderDataMeshImpl* meshRenderData = DYNAMIC_CAST(IofxSharedRenderDataMeshImpl*)(obj->renderData); + const IofxMeshRenderLayout& meshRenderLayout = meshRenderData->getRenderLayout(); + + MeshOutputLayout outputLayout; + PX_COMPILE_TIME_ASSERT(sizeof(outputLayout.offsets) == sizeof(meshRenderLayout.offsets)); + ::memcpy(outputLayout.offsets, meshRenderLayout.offsets, sizeof(outputLayout.offsets)); + outputLayout.stride = meshRenderLayout.stride; + + updateParticles<MeshInput, MeshPublicState, MeshPrivateState>(*obj, + outputLayout, + static_cast<uint8_t*>(meshRenderData->getBufferMappedPtr()) + ); + } + else + { + if (mDistanceSortingEnabled) + { + const ObjectRange& range = mWorkingRange; + + mWorkingVisibleCount = 0; + PX_ASSERT(obj->sortingKeys != NULL); + for (uint32_t outputId = range.startIndex; outputId < range.startIndex + range.objectCount ; outputId++) + { + uint32_t stateId = obj->outputToState[ outputId ]; + PX_ASSERT(stateId != IosBufferDescIntl::NOT_A_PARTICLE); + uint32_t inputId = obj->pmaInStateToInput->get(stateId); + inputId &= ~IosBufferDescIntl::NEW_PARTICLE_FLAG; + + const PxVec3 position = obj->pmaPositionMass->get(inputId).getXYZ(); + float sortDistance = obj->zNear + (obj->eyePosition - position).dot(obj->eyeDirection); + + //build uint key for radix sorting (flip float) + uint32_t key = *reinterpret_cast<const uint32_t*>(&sortDistance); + uint32_t mask = -int32_t(key >> 31) | 0x80000000; + key ^= mask; + + obj->sortingKeys[ outputId ] = key; + if ((key & 0x80000000) == 0) ++mWorkingVisibleCount; + } + + uint32_t* keys = obj->sortingKeys + range.startIndex; + uint32_t* values = obj->outputToState + range.startIndex; + iofx::ARLSort<uint32_t, uint32_t>::sort(keys, values, (int32_t)range.objectCount); + + if (range.objectCount > 0) + { + PX_ASSERT(values[range.objectCount - 1] < obj->maxStateID); + } + } + + IofxSharedRenderDataSpriteImpl* spriteRenderData = DYNAMIC_CAST(IofxSharedRenderDataSpriteImpl*)(obj->renderData); + const IofxSpriteRenderLayout& spriteRenderLayout = spriteRenderData->getRenderLayout(); + if (spriteRenderLayout.surfaceCount > 0) + { + SpriteTextureOutputLayout outputLayout; + bool result = true; + for (uint32_t i = 0; i < spriteRenderLayout.surfaceCount; ++i) + { + UserRenderSurface::MappedInfo mappedInfo; + if (spriteRenderData->getSurfaceMappedInfo(i, mappedInfo)) + { + const UserRenderSurfaceDesc& surfaceDesc = spriteRenderLayout.surfaceDescs[i]; + outputLayout.textureData[i].layout = static_cast<uint16_t>(spriteRenderLayout.surfaceElements[i]); + + outputLayout.texturePtr[i] = static_cast<uint8_t*>(mappedInfo.pData); + + const uint32_t surfaceWidth = uint32_t(surfaceDesc.width); + const uint32_t surfacePitch = mappedInfo.rowPitch; + + PX_ASSERT(isPowerOfTwo(surfaceWidth)); + outputLayout.textureData[i].widthShift = static_cast<uint8_t>(highestSetBit(surfaceWidth)); + PX_ASSERT(isPowerOfTwo(surfacePitch)); + outputLayout.textureData[i].pitchShift = static_cast<uint8_t>(highestSetBit(surfacePitch)); + } + else + { + result = false; + break; + } + } + outputLayout.textureCount = result ? spriteRenderLayout.surfaceCount : 0; + + updateParticles<SpriteInput, SpritePublicState, SpritePrivateState>(*obj, outputLayout, NULL); + } + else + { + SpriteOutputLayout outputLayout; + /* Copy user-defined semantics offsets to output offsets */ + PX_COMPILE_TIME_ASSERT(sizeof(outputLayout.offsets) == sizeof(spriteRenderLayout.offsets)); + ::memcpy(outputLayout.offsets, spriteRenderLayout.offsets, sizeof(outputLayout.offsets)); + outputLayout.stride = spriteRenderLayout.stride; + + updateParticles<SpriteInput, SpritePublicState, SpritePrivateState>(*obj, + outputLayout, + static_cast<uint8_t*>(spriteRenderData->getBufferMappedPtr()) + ); + } + } +} + +class ModifierParamsMapperCPUimpl : public ModifierParamsMapperCPU +{ + template <typename T> + void _mapValue(size_t offset, T value) + { + if (mData != 0) + { + *(T*)(mData + mParamsOffset + offset) = value; + } + } + +public: + virtual void beginParams(void* , size_t size, size_t align, uint32_t) + { + mParamsOffset = (mTotalSize + (uint32_t)align - 1) & ~((uint32_t)align - 1); + mTotalSize = mParamsOffset + (uint32_t)size; + } + virtual void endParams() + { + } + + virtual void mapValue(size_t offset, int32_t value) + { + _mapValue(offset, value); + } + virtual void mapValue(size_t offset, float value) + { + _mapValue(offset, value); + } + virtual void mapCurve(size_t offset, const nvidia::apex::Curve* curve) + { + _mapValue(offset, curve); + } + + ModifierParamsMapperCPUimpl() + { + reset(0); + } + + void reset(uint8_t* data) + { + mData = data; + mTotalSize = 0; + mParamsOffset = 0; + } + + uint32_t getTotalSize() const + { + return mTotalSize; + } + uint32_t getParamsOffset() const + { + return mParamsOffset; + } + +private: + uint8_t* mData; + + uint32_t mTotalSize; + uint32_t mParamsOffset; +}; + + +uint32_t IofxAssetSceneInstCPU::introspectModifiers(ModifierParamsMapperCPUimpl& introspector, ModifierInfo* list, const ModifierStack& stack, ModifierStage stage, uint32_t usageClass) +{ + uint32_t usageStage = ModifierUsageFromStage(stage); + uint32_t count = 0; + for (ModifierStack::ConstIterator it = stack.begin(); it != stack.end(); ++it) + { + //uint32_t type = (*it)->getModifierType(); + uint32_t usage = (*it)->getModifierUsage(); + if ((usage & usageStage) == usageStage && (usage & usageClass) == usageClass) + { + const ModifierImpl* modifier = ModifierImpl::castFrom(*it); + modifier->mapParamsCPU(introspector); + if (list != 0) + { + if (usageClass == ModifierUsage_Sprite) + { + list[count].updateSpriteFunc = modifier->getUpdateSpriteFunc(stage); + } + else + { + list[count].updateMeshFunc = modifier->getUpdateMeshFunc(stage); + } + + list[count].paramsOffset = introspector.getParamsOffset(); + } + ++count; + } + } + return count; +} + +IofxAssetSceneInstCPU::IofxAssetSceneInstCPU(IofxAssetImpl* asset, uint32_t semantics, IofxScene* scene) + : IofxAssetSceneInst(asset, semantics) +{ + PX_UNUSED(scene); + + const ModifierStack& spawnModifiers = asset->getModifierStack(ModifierStage_Spawn); + const ModifierStack& continuousModifiers = asset->getModifierStack(ModifierStage_Continuous); + + // set the particle buffer type here + uint32_t usageClass = (asset->getMeshAssetCount() > 0) ? ModifierUsage_Mesh : ModifierUsage_Sprite; + + //collect params + ModifierParamsMapperCPUimpl paramsMapper; + + uint32_t spawnModifierCount = introspectModifiers(paramsMapper, 0, spawnModifiers, ModifierStage_Spawn, usageClass); + uint32_t continuousModifierCount = introspectModifiers(paramsMapper, 0, continuousModifiers, ModifierStage_Continuous, usageClass); + + mSpawnModifiersList.resize(spawnModifierCount); + mContinuousModifiersList.resize(continuousModifierCount); + + mModifiersParamsBuffer.resize(paramsMapper.getTotalSize()); + + paramsMapper.reset(mModifiersParamsBuffer.begin()); + + introspectModifiers(paramsMapper, mSpawnModifiersList.begin(), spawnModifiers, ModifierStage_Spawn, usageClass); + introspectModifiers(paramsMapper, mContinuousModifiersList.begin(), continuousModifiers, ModifierStage_Continuous, usageClass); +} + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/IofxActorImpl.cpp b/APEX_1.4/module/iofx/src/IofxActorImpl.cpp new file mode 100644 index 00000000..6996e880 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxActorImpl.cpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "ApexSDKIntl.h" +#include "SceneIntl.h" +#include "IofxActor.h" +#include "IofxActorImpl.h" +#include "IofxSceneCPU.h" +#include "IofxSceneGPU.h" +#include "RenderVolumeImpl.h" +#include "IosObjectData.h" +#include "IofxRenderData.h" + +#include "ModuleIofxImpl.h" + +namespace nvidia +{ +namespace iofx +{ + +IofxActorImpl::IofxActorImpl(ResID renderResID, IofxScene* iscene, IofxManager& mgr) + : mRenderResID(renderResID) + , mIofxScene(iscene) + , mMgr(mgr) + , mRenderVolume(NULL) // IOS will set this after creation + , mSemantics(0) + , mActiveRenderable(NULL) +{ + //asset.add(*this); + + mResultBounds.setEmpty(); + mResultRange.startIndex = 0; + mResultRange.objectCount = 0; + mResultVisibleCount = 0; + + addSelfToContext(*iscene->mApexScene->getApexContext()); // Add self to ApexScene + addSelfToContext(*iscene); // Add self to IofxScene +} + +IofxActorImpl::~IofxActorImpl() +{ +} + +void IofxActorImpl::getLodRange(float& min, float& max, bool& intOnly) const +{ + READ_ZONE(); + PX_UNUSED(min); + PX_UNUSED(max); + PX_UNUSED(intOnly); + APEX_INVALID_OPERATION("not implemented"); +} + + +float IofxActorImpl::getActiveLod() const +{ + READ_ZONE(); + APEX_INVALID_OPERATION("BasicIosActor does not support this operation"); + return -1.0f; +} + + +void IofxActorImpl::forceLod(float lod) +{ + WRITE_ZONE(); + PX_UNUSED(lod); + APEX_INVALID_OPERATION("not implemented"); +} + +void IofxActorImpl::release() +{ + if (mInRelease) + { + return; + } + mInRelease = true; + destroy(); +} + + +void IofxActorImpl::destroy() +{ + if (mRenderVolume) + { + mRenderVolume->removeIofxActor(*this); + } + + // Removes self from scenes and IOFX manager + // should be called after mRenderVolume->removeIofxActor to avoid dead-lock!!! + ApexActor::destroy(); + + for (uint32_t i = 0 ; i < mRenderableArray.size() ; i++) + { + IofxRenderableImpl* renderable = mRenderableArray[i]; + if (renderable != NULL) + { + renderable->release(); + } + } + mRenderableArray.clear(); + + delete this; +} + +bool IofxActorImpl::prepareRenderables(IosObjectBaseData* obj) +{ + if (mResultRange.objectCount > 0 && obj->renderData->checkSemantics(mSemantics)) + { + const uint32_t instanceID = obj->renderData->getInstanceID(); + if (mRenderableArray.size() <= instanceID) + { + mRenderableArray.resize(instanceID + 1, NULL); + } + mActiveRenderable = mRenderableArray[instanceID]; + if (mActiveRenderable == NULL) + { + if (mMgr.mIsMesh) + { + mActiveRenderable = PX_NEW(IofxMeshRenderable)(mIofxScene, mRenderResID); + } + else + { + mActiveRenderable = PX_NEW(IofxSpriteRenderable)(mIofxScene, mRenderResID); + } + mRenderableArray[instanceID] = mActiveRenderable; + } + + mActiveRenderable->update(obj->renderData, mResultBounds, mResultRange.startIndex, mResultRange.objectCount, mResultVisibleCount); + return true; + } + else + { + mActiveRenderable = NULL; + return false; + } +} + +IofxRenderable* IofxActorImpl::acquireRenderableReference() +{ + return mActiveRenderable ? mActiveRenderable->incrementReferenceCount() : NULL; +} + + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/IofxAssetImpl.cpp b/APEX_1.4/module/iofx/src/IofxAssetImpl.cpp new file mode 100644 index 00000000..b04211a9 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxAssetImpl.cpp @@ -0,0 +1,1138 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "ApexUsingNamespace.h" +#include "IofxAssetImpl.h" +#include "IofxActorImpl.h" +#include "IofxScene.h" +#include "ModuleIofxImpl.h" +#include "Modifier.h" +#include "ModifierImpl.h" +#include "SceneIntl.h" +#include "IofxManagerIntl.h" +//#include "ApexSharedSerialization.h" +#include "CurveImpl.h" + +namespace nvidia +{ +namespace iofx +{ + + +IofxAssetImpl::IofxAssetImpl(ModuleIofxImpl* module, ResourceList& list, const char* name) : + mRenderMeshAssetTracker(module->mSdk, RENDER_MESH_AUTHORING_TYPE_NAME), + mSpriteMaterialAssetTracker(module->mSdk), + mModule(module), + mName(name), + mSpriteSemanticBitmap(0), + mMeshSemanticBitmap(0) +{ + using namespace IofxAssetParametersNS; + + NvParameterized::Traits* traits = GetInternalApexSDK()->getParameterizedTraits(); + mParams = (IofxAssetParameters*)traits->createNvParameterized(IofxAssetParameters::staticClassName()); + + PX_ASSERT(mParams); + + // LRR: Hmmmm, these will never be setup for authors, it's a good thing we can't create actors from authors! + mRenderMeshList = NULL; + mSpriteParams = NULL; + + list.add(*this); +} + +IofxAssetImpl::IofxAssetImpl(ModuleIofxImpl* module, + ResourceList& list, + NvParameterized::Interface* params, + const char* name) : + mRenderMeshAssetTracker(module->mSdk, RENDER_MESH_AUTHORING_TYPE_NAME), + mSpriteMaterialAssetTracker(module->mSdk), + mParams((IofxAssetParameters*)params), + mSpriteParams(NULL), + mModule(module), + mName(name), + mSpriteSemanticBitmap(0), + mMeshSemanticBitmap(0) +{ + using namespace MeshIofxParametersNS; + + if (mParams->iofxType && + !nvidia::strcmp(mParams->iofxType->className(), MeshIofxParameters::staticClassName())) + { + MeshIofxParameters* mIofxParams = static_cast<MeshIofxParameters*>(mParams->iofxType); + + ParamDynamicArrayStruct* tmpStructPtr = (ParamDynamicArrayStruct*) & (mIofxParams->renderMeshList); + mRenderMeshList = PX_NEW(ParamArray<meshProperties_Type>)(mIofxParams, "renderMeshList", tmpStructPtr); + } + else + { + mRenderMeshList = NULL; + } + + if (mParams->iofxType && + !nvidia::strcmp(mParams->iofxType->className(), SpriteIofxParameters::staticClassName())) + { + mSpriteParams = static_cast<SpriteIofxParameters*>(mParams->iofxType); + } + + + // call this now to "initialize" the asset + postDeserialize(); + + list.add(*this); +} + +IofxAssetImpl::~IofxAssetImpl() +{ + for (uint32_t i = mSpawnModifierStack.size(); i--;) + { + delete mSpawnModifierStack[i]; + } + + for (uint32_t i = mContinuousModifierStack.size(); i--;) + { + delete mContinuousModifierStack[i]; + } +} + +void IofxAssetImpl::destroy() +{ + /* Assets that were forceloaded or loaded by actors will be automatically + * released by the ApexAssetTracker member destructors. + */ + if (mParams) + { + mParams->destroy(); + mParams = NULL; + } + + if (mRenderMeshList) + { + PX_DELETE(mRenderMeshList); + } + +#if IOFX_SLOW_COMPOSITE_MODIFIERS + // destroy any color vs life params that we may have laying around + for (uint32_t i = 0; i < mCompositeParams.size(); i++) + { + mCompositeParams[i]->destroy(); + } + mCompositeParams.clear(); +#endif + + // this will release all of this asset's IOFX actors, which is necessary, otherwise + // the IOFX actors will have their APEX Render Meshes ripped out from underneath them + ResourceList::clear(); + + delete this; +} + +void IofxAssetImpl::release() +{ + mModule->mSdk->releaseAsset(*this); +} + +void IofxAssetImpl::removeAllActors() +{ + ApexContext::removeAllActors(); +} + +void IofxAssetImpl::addDependentActor(ApexActor* actor) +{ + WRITE_ZONE(); + if (actor) + { + actor->addSelfToContext(*this); + } +} + + + +void IofxAssetImpl::preSerialize(void* userData_) +{ + PX_UNUSED(userData_); +} + +void IofxAssetImpl::postDeserialize(void* userData_) +{ + PX_UNUSED(userData_); + + NvParameterized::Traits* traits = GetInternalApexSDK()->getParameterizedTraits(); + + PX_ASSERT(mParams->iofxType); + if (!mParams->iofxType) + { + return; + } + + initializeAssetNameTable(); + + // destroy the old modifier stacks + for (uint32_t i = mSpawnModifierStack.size(); i--;) + { + delete mSpawnModifierStack[i]; + } + mSpawnModifierStack.resize(0); + + for (uint32_t i = mContinuousModifierStack.size(); i--;) + { + delete mContinuousModifierStack[i]; + } + mContinuousModifierStack.resize(0); + +#if IOFX_SLOW_COMPOSITE_MODIFIERS + // destroy any color vs life params that we may have laying around + for (uint32_t i = 0; i < mCompositeParams.size(); i++) + { + mCompositeParams[i]->destroy(); + } + mCompositeParams.clear(); +#endif + + const char* handleNameList[] = { "spawnModifierList", "continuousModifierList" }; + +// 'param' and 'newMod' are defined in the local scope where this macro is used +#define _MODIFIER(Type) \ + else if( !nvidia::strcmp(param->className(), #Type "ModifierParams") ) \ + { \ + newMod = PX_NEW( Type##ModifierImpl )( (Type##ModifierParams *)param ); \ + } + + for (uint32_t i = 0; i < 2; i++) + { + NvParameterized::Handle h(*mParams->iofxType); + mParams->iofxType->getParameterHandle(handleNameList[i], h); + int listSize = 0; + h.getArraySize(listSize); + + for (int j = 0; j < listSize; j++) + { + NvParameterized::Interface* param = 0; + NvParameterized::Handle ih(*mParams->iofxType); + Modifier* newMod = 0; + + h.getChildHandle(j, ih); + ih.getParamRef(param); + PX_ASSERT(param); + if (!param) + { + continue; + } + + if (newMod != 0) //this'll never happen :-) + {} + +#include "ModifierList.h" + +#if IOFX_SLOW_COMPOSITE_MODIFIERS + // LRR: there is a better way to do this, but I don't have time at the moment to + // make this any cleaner + + // special case, we don't currently have an initial color modifier, just insert + // a colorVsLife modifier for each color channel + else if (!nvidia::strcmp(param->className(), "InitialColorModifierParams")) + { + InitialColorModifierParams* icParams = (InitialColorModifierParams*)param; + + for (uint32_t colorIdx = 0; colorIdx < 4; colorIdx++) + { + ColorVsLifeModifierParams* p = (ColorVsLifeModifierParams*) + traits->createNvParameterized(ColorVsLifeModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ColorVsLifeModifierImpl* cvlMod = PX_NEW(ColorVsLifeModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the color channel + cvlMod->setColorChannel((ColorChannel)colorIdx); + + // set the curve + CurveImpl curve; + curve.addControlPoint(Vec2R(0.0f, icParams->color[colorIdx])); + curve.addControlPoint(Vec2R(1.0f, icParams->color[colorIdx])); + + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ColorVsLifeCompositeModifierParams")) + { + // setup an array so we can get the control points easily + ColorVsLifeCompositeModifierParams* cParams = (ColorVsLifeCompositeModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (uint32_t colorIdx = 0; colorIdx < 4; colorIdx++) + { + + ColorVsLifeModifierParams* p = (ColorVsLifeModifierParams*) + traits->createNvParameterized(ColorVsLifeModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ColorVsLifeModifierImpl* cvlMod = PX_NEW(ColorVsLifeModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the color channel + cvlMod->setColorChannel((ColorChannel)colorIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].lifeRemaining, + cParams->controlPoints.buf[cpIdx].color[colorIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ColorVsDensityCompositeModifierParams")) + { + ColorVsDensityCompositeModifierParams* cParams = (ColorVsDensityCompositeModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (uint32_t colorIdx = 0; colorIdx < 4; colorIdx++) + { + + ColorVsDensityModifierParams* p = (ColorVsDensityModifierParams*) + traits->createNvParameterized(ColorVsDensityModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ColorVsDensityModifierImpl* cvlMod = PX_NEW(ColorVsDensityModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the color channel + cvlMod->setColorChannel((ColorChannel)colorIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].density, + cParams->controlPoints.buf[cpIdx].color[colorIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ColorVsVelocityCompositeModifierParams")) + { + // setup an array so we can get the control points easily + ColorVsVelocityCompositeModifierParams* cParams = (ColorVsVelocityCompositeModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (uint32_t colorIdx = 0; colorIdx < 4; colorIdx++) + { + + ColorVsVelocityModifierParams* p = (ColorVsVelocityModifierParams*) + traits->createNvParameterized(ColorVsVelocityModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ColorVsVelocityModifierImpl* cvlMod = PX_NEW(ColorVsVelocityModifierImpl)(p); + PX_ASSERT(cvlMod); + + cvlMod->setVelocity0(cParams->velocity0); + cvlMod->setVelocity1(cParams->velocity1); + + // set the color channel + cvlMod->setColorChannel((ColorChannel)colorIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].velocity, + cParams->controlPoints.buf[cpIdx].color[colorIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ScaleVsLife2DModifierParams")) + { + // setup an array so we can get the control points easily + ScaleVsLife2DModifierParams* cParams = (ScaleVsLife2DModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (int32_t axisIdx = 0; axisIdx < 2; axisIdx++) + { + ScaleVsLifeModifierParams* p = (ScaleVsLifeModifierParams*) + traits->createNvParameterized(ScaleVsLifeModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ScaleVsLifeModifierImpl* cvlMod = PX_NEW(ScaleVsLifeModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the scale axis + cvlMod->setScaleAxis((ScaleAxis)axisIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].lifeRemaining, + cParams->controlPoints.buf[cpIdx].scale[axisIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ScaleVsLife3DModifierParams")) + { + // setup an array so we can get the control points easily + ScaleVsLife3DModifierParams* cParams = (ScaleVsLife3DModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (uint32_t axisIdx = 0; axisIdx < 3; axisIdx++) + { + ScaleVsLifeModifierParams* p = (ScaleVsLifeModifierParams*) + traits->createNvParameterized(ScaleVsLifeModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ScaleVsLifeModifierImpl* cvlMod = PX_NEW(ScaleVsLifeModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the scale axis + cvlMod->setScaleAxis((ScaleAxis)axisIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].lifeRemaining, + cParams->controlPoints.buf[cpIdx].scale[axisIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ScaleVsDensity2DModifierParams")) + { + // setup an array so we can get the control points easily + ScaleVsDensity2DModifierParams* cParams = (ScaleVsDensity2DModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (int32_t axisIdx = 0; axisIdx < 2; axisIdx++) + { + ScaleVsDensityModifierParams* p = (ScaleVsDensityModifierParams*) + traits->createNvParameterized(ScaleVsDensityModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ScaleVsDensityModifierImpl* cvlMod = PX_NEW(ScaleVsDensityModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the scale axis + cvlMod->setScaleAxis((ScaleAxis)axisIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].density, + cParams->controlPoints.buf[cpIdx].scale[axisIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ScaleVsDensity3DModifierParams")) + { + // setup an array so we can get the control points easily + ScaleVsDensity3DModifierParams* cParams = (ScaleVsDensity3DModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (uint32_t axisIdx = 0; axisIdx < 3; axisIdx++) + { + ScaleVsDensityModifierParams* p = (ScaleVsDensityModifierParams*) + traits->createNvParameterized(ScaleVsDensityModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ScaleVsDensityModifierImpl* cvlMod = PX_NEW(ScaleVsDensityModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the scale axis + cvlMod->setScaleAxis((ScaleAxis)axisIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].density, + cParams->controlPoints.buf[cpIdx].scale[axisIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ScaleVsCameraDistance2DModifierParams")) + { + // setup an array so we can get the control points easily + ScaleVsCameraDistance2DModifierParams* cParams = (ScaleVsCameraDistance2DModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (int32_t axisIdx = 0; axisIdx < 2; axisIdx++) + { + ScaleVsCameraDistanceModifierParams* p = (ScaleVsCameraDistanceModifierParams*) + traits->createNvParameterized(ScaleVsCameraDistanceModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ScaleVsCameraDistanceModifierImpl* cvlMod = PX_NEW(ScaleVsCameraDistanceModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the scale axis + cvlMod->setScaleAxis((ScaleAxis)axisIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].cameraDistance, + cParams->controlPoints.buf[cpIdx].scale[axisIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } + + else if (!nvidia::strcmp(param->className(), "ScaleVsCameraDistance3DModifierParams")) + { + // setup an array so we can get the control points easily + ScaleVsCameraDistance3DModifierParams* cParams = (ScaleVsCameraDistance3DModifierParams*)param; + + if (cParams->controlPoints.arraySizes[0] == 0) + { + continue; + } + + for (uint32_t axisIdx = 0; axisIdx < 3; axisIdx++) + { + ScaleVsCameraDistanceModifierParams* p = (ScaleVsCameraDistanceModifierParams*) + traits->createNvParameterized(ScaleVsCameraDistanceModifierParams::staticClassName()); + + // save these parameterized classes off for later, we'll need to destroy them + mCompositeParams.pushBack(p); + + ScaleVsCameraDistanceModifierImpl* cvlMod = PX_NEW(ScaleVsCameraDistanceModifierImpl)(p); + PX_ASSERT(cvlMod); + + // set the scale axis + cvlMod->setScaleAxis((ScaleAxis)axisIdx); + + // set the curve + CurveImpl curve; + for (int32_t cpIdx = 0; cpIdx < cParams->controlPoints.arraySizes[0]; cpIdx++) + { + curve.addControlPoint(Vec2R(cParams->controlPoints.buf[cpIdx].cameraDistance, + cParams->controlPoints.buf[cpIdx].scale[axisIdx])); + } + cvlMod->setFunction(&curve); + + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(cvlMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(cvlMod->getModifierMeshSemantics()); + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(cvlMod); + } + } +#endif /* IOFX_SLOW_COMPOSITE_MODIFIERS */ + + if (newMod) + { + // save which sprite render semantics this modifier will update + setSpriteSemanticsUsed(newMod->getModifierSpriteSemantics()); + setMeshSemanticsUsed(newMod->getModifierMeshSemantics()); + + ModifierStack& activeStack = getModifierStack(i); + activeStack.pushBack(newMod); + } + + } + } + + bool useFloat4Color = mParams->renderOutput.useFloat4Color; + if (!useFloat4Color) + { + //detect if some Color modifier has a color component value greater than 1 + for (uint32_t modStage = 0; modStage < 2; modStage++) + { + const ModifierStack& activeStack = getModifierStack(modStage); + + uint32_t modCount = activeStack.size(); + for (uint32_t modIndex = 0; modIndex < modCount; modIndex++) + { + const nvidia::apex::Curve* pColorCurve = 0; + + const Modifier* pModifier = activeStack[modIndex]; + switch (pModifier->getModifierType()) + { + case ModifierType_ColorVsLife: + pColorCurve = static_cast<const ColorVsLifeModifier*>(pModifier)->getFunction(); + break; + case ModifierType_ColorVsDensity: + pColorCurve = static_cast<const ColorVsDensityModifier*>(pModifier)->getFunction(); + break; + default: + break; + } + + if (pColorCurve) + { + uint32_t pointsCount; + const Vec2R* pPoints = pColorCurve->getControlPoints(pointsCount); + + for (uint32_t i = 0; i < pointsCount; i++) + { + if (pPoints[i].y > 1) + { + useFloat4Color = true; + break; + } + } + } + if (useFloat4Color) + { + break; + } + } + if (useFloat4Color) + { + break; + } + } + } + + if (mParams->renderOutput.useUserSemantic) + { + mMeshSemanticBitmap |= (1 << IofxRenderSemantic::USER_DATA); + mSpriteSemanticBitmap |= (1 << IofxRenderSemantic::USER_DATA); + } +} + +const char* IofxAssetImpl::getSpriteMaterialName() const +{ + READ_ZONE(); + if (mSpriteParams && + mSpriteParams->spriteMaterialName && + mSpriteParams->spriteMaterialName->name() && + mSpriteParams->spriteMaterialName->name()[0]) + { + return mSpriteParams->spriteMaterialName->name(); + } + else + { + return NULL; + } +} + +const char* IofxAssetImpl::getMeshAssetName(uint32_t index) const +{ + READ_ZONE(); + if (mRenderMeshList && index < (*mRenderMeshList).size() && (*mRenderMeshList)[index].meshAssetName) + { + return (*mRenderMeshList)[index].meshAssetName->name(); + } + else + { + return NULL; + } +} + +uint32_t IofxAssetImpl::getMeshAssetWeight(uint32_t index) const +{ + READ_ZONE(); + if (mRenderMeshList && index < (*mRenderMeshList).size()) + { + return (*mRenderMeshList)[index].weight; + } + else + { + return 0; + } +} + +bool IofxAssetImpl::isOpaqueMesh(uint32_t index) const +{ + if (mRenderMeshList && index < (*mRenderMeshList).size() && (*mRenderMeshList)[index].meshAssetName) + { + return nvidia::strcmp((*mRenderMeshList)[index].meshAssetName->className(), "ApexOpaqueMesh") == 0; + } + else + { + return false; + } +} + +uint32_t IofxAssetImpl::forceLoadAssets() +{ + WRITE_ZONE(); + uint32_t assetLoadedCount = 0; + + assetLoadedCount += mRenderMeshAssetTracker.forceLoadAssets(); + assetLoadedCount += mSpriteMaterialAssetTracker.forceLoadAssets(); + + return assetLoadedCount; +} + +void IofxAssetImpl::initializeAssetNameTable() +{ + // clean up asset tracker list + mRenderMeshAssetTracker.removeAllAssetNames(); + mSpriteMaterialAssetTracker.removeAllAssetNames(); + + if (mRenderMeshList) + { + /* initialize the rendermesh asset name to resID tables */ + for (uint32_t i = 0; i < (*mRenderMeshList).size(); i++) + { + const char* name = ""; + if ((*mRenderMeshList)[i].meshAssetName) + { + name = (*mRenderMeshList)[i].meshAssetName->name(); + } + mRenderMeshAssetTracker.addAssetName(name, isOpaqueMesh(i)); + } + } + else + { + /* initialize the sprite material name to resID tables */ + if (getSpriteMaterialName()) + { + mSpriteMaterialAssetTracker.addAssetName(getSpriteMaterialName(), false); + } + } +} + +void IofxAssetImpl::setSpriteSemanticsUsed(uint32_t spriteSemanticsBitmap) +{ + mSpriteSemanticBitmap |= spriteSemanticsBitmap; +} +void IofxAssetImpl::setMeshSemanticsUsed(uint32_t meshSemanticsBitmap) +{ + mMeshSemanticBitmap |= meshSemanticsBitmap; +} + +uint32_t IofxAssetImpl::getPubStateSize() const +{ + return mSpriteParams ? sizeof(SpritePublicState) : sizeof(MeshPublicState); +} + +uint32_t IofxAssetImpl::getPrivStateSize() const +{ + return mSpriteParams ? sizeof(SpritePrivateState) : sizeof(MeshPrivateState); +} + +bool IofxAssetImpl::isSortingEnabled() const +{ + const ModifierStack& stack = getModifierStack(ModifierStage_Continuous); + for (ModifierStack::ConstIterator it = stack.begin(); it != stack.end(); ++it) + { + if ((*it)->getModifierType() == ModifierType_ViewDirectionSorting) + { + return true; + } + } + + return false; +} + +#ifndef WITHOUT_APEX_AUTHORING + +void IofxAssetAuthoringImpl::release() +{ + delete this; +} + +const char* IofxAssetAuthoringImpl::getObjTypeName() const +{ + return IofxAssetImpl::getObjTypeName(); +} + +#if IOFX_AUTHORING_API_ENABLED + +void IofxAssetAuthoringImpl::setMeshAssetCount(const uint32_t meshCount) +{ + (*mRenderMeshList).resize(meshCount); +} + +void IofxAssetAuthoringImpl::setSpriteMaterialName(const char* inSpriteMaterialName) +{ + if ((*mRenderMeshList).size()) + { + APEX_INVALID_OPERATION("Unable to set Sprite Material Name (%s). Systems can be either Mesh or Sprite, but not both. This system is already a Mesh.", getSpriteMaterialName()); + return; + } + + NvParameterized::Handle h(*mParams); + NvParameterized::Interface* refParam; + + mParams->getParameterHandle("spriteMaterialName", h); + mParams->initParamRef(h, NULL, true); + mParams->getParamRef(h, refParam); + + PX_ASSERT(refParam); + if (refParam) + { + refParam->setName(inSpriteMaterialName); + } +} + +void IofxAssetAuthoringImpl::setMeshAssetName(const char* meshAssetName, uint32_t meshIndex) +{ + if (getSpriteMaterialName()) + { + APEX_INVALID_OPERATION("Unable to set Mesh Material Name (%s). Systems can be either Mesh or Sprite, but not both. This system is already a Sprite.", meshAssetName); + return; + } + + PX_ASSERT(meshIndex < (*mRenderMeshList).size()); + + NvParameterized::Handle arrayHandle(*mParams), indexHandle(*mParams), childHandle(*mParams); + NvParameterized::Interface* refPtr; + + mParams->getParameterHandle("renderMeshList", arrayHandle); + arrayHandle.getChildHandle(meshIndex, indexHandle); + + indexHandle.getChildHandle(mParams, "meshAssetName", childHandle); + mParams->initParamRef(childHandle, NULL, true); + mParams->getParamRef(childHandle, refPtr); + PX_ASSERT(refPtr); + if (refPtr) + { + refPtr->setName(meshAssetName); + } +} + +void IofxAssetAuthoringImpl::setMeshAssetWeight(const uint32_t weight, uint32_t meshIndex) +{ + if (getSpriteMaterialName()) + { + APEX_INVALID_OPERATION("Unable to set Mesh Material Weight (%d). Systems can be either Mesh or Sprite, but not both. This system is already a Sprite.", weight); + return; + } + + PX_ASSERT(meshIndex < (*mRenderMeshList).size()); + (*mRenderMeshList)[meshIndex].weight = weight; +} + + +Modifier* IofxAssetAuthoringImpl::createModifier(uint32_t modStage, uint32_t modType) +{ + // create a modifier to go in this particular modifier stage + // we'll need a handle to the correct mod stage list, pass that and the Param Obj to CreateModifier, + // it will resize the array (+1), then pass the correct string to initParamRef() + // Then it can pass the new ref param to the mod constructor + NvParameterized::Handle h(*mParams), ih(*mParams); + int modStackSize = 0; + + getModifierStack(modStage, h); + + // resize the array + mParams->getArraySize(h, modStackSize); + mParams->resizeArray(h, ++modStackSize); + + h.getChildHandle(modStackSize - 1, ih); + + Modifier* retVal = CreateModifier((ModifierTypeEnum)modType, mParams, ih); + + uint32_t assetTarget = getAssetTarget(); + // We don't yet know what type this is, which is invalid. + if (assetTarget == 0) + { + // delete the new param ref and re-resize array + NvParameterized::Interface* refParam = 0; + mParams->getParamRef(ih, refParam); + PX_ASSERT(refParam); + if (refParam) + { + refParam->destroy(); + } + mParams->resizeArray(h, modStackSize - 1); + + delete retVal; + retVal = 0; + APEX_INVALID_OPERATION("Specifying modifiers before specifying the mesh or sprite asset is invalid"); + return retVal; + } + + // The modifier only supports certain semantics, so let's test those now. + const uint32_t supportedUsage = retVal->getModifierUsage(); + + if ((supportedUsage & assetTarget) != assetTarget) + { + // delete the new param ref and re-resize array + NvParameterized::Interface* refParam = 0; + mParams->getParamRef(ih, refParam); + PX_ASSERT(refParam); + if (refParam) + { + refParam->destroy(); + } + mParams->resizeArray(h, modStackSize - 1); + + delete retVal; + retVal = 0; + APEX_INVALID_OPERATION("The specified modifier doesn't work on that system type (e.g. Sprite ModifierImpl on a Mesh System or vice-versa)."); + return retVal; + } + + uint32_t stageBits = ModifierUsageFromStage(ModifierStage(modStage)); + if ((supportedUsage & stageBits) != stageBits) + { + // delete the new param ref and re-resize array + NvParameterized::Interface* refParam = 0; + mParams->getParamRef(ih, refParam); + PX_ASSERT(refParam); + if (refParam) + { + refParam->destroy(); + } + mParams->resizeArray(h, modStackSize - 1); + + delete retVal; + retVal = 0; + APEX_INVALID_OPERATION("The specified modifier doesn't work in that stage."); + return retVal; + } + + ModifierStack& activeStack = getModifierStack(modStage); + + activeStack.pushBack(retVal); + return retVal; +} + +void IofxAssetAuthoringImpl::removeModifier(uint32_t modStage, uint32_t position) +{ + if (modStage >= ModifierStage_Count) + { + APEX_INVALID_OPERATION("Invalid modifier stage"); + return; + } + + ModifierStack& activeStack = getModifierStack(modStage); + + if (position >= activeStack.size()) + { + APEX_INVALID_OPERATION("position %d is greater than modifier stack size: %d", position, activeStack.size()); + return; + } + + // remove from ModifierStack (runtime) + activeStack.replaceWithLast(position); + + // remove from NvParameterized data + NvParameterized::Handle h(*mParams), ih(*mParams); + NvParameterized::Interface* modParams = 0; + int modStackSize = 0; + + // 1. get the correct stack + getModifierStack(modStage, h); + + // 2. get the NvParameterized::Interface* for the position + mParams->getArraySize(h, modStackSize); + h.getChildHandle(position, ih); + mParams->getParamRef(ih, modParams); + PX_ASSERT(modParams); + + // 3. destroy it + modParams->destroy(); + + // 4. copy the last member of the stack to position + if (position != (uint32_t)modStackSize - 1) + { + NvParameterized::Handle lastH(*mParams); + h.getChildHandle(modStackSize - 1, lastH); + mParams->getParamRef(lastH, modParams); + mParams->setParamRef(ih, modParams); + } + + // 5. resize the stack + mParams->resizeArray(h, modStackSize - 1); +} + +uint32_t IofxAssetAuthoringImpl::getModifierCount(uint32_t modStage) const +{ + if (modStage >= ModifierStage_Count) + { + APEX_INVALID_OPERATION("Invalid modifier stage"); + return 0; + } + + const ModifierStack& activeStack = getModifierStack(modStage); + return activeStack.size(); +} + +uint32_t IofxAssetAuthoringImpl::findModifier(uint32_t modStage, Modifier* modifier) +{ + if (modStage >= ModifierStage_Count) + { + APEX_INVALID_OPERATION("Invalid modifier stage"); + return 0; + } + + const ModifierStack& activeStack = getModifierStack(modStage); + + for (uint32_t i = 0; i < activeStack.size(); i++) + { + if (activeStack[i] == modifier) + { + return i; + } + } + + return 0xffffffff; +} + +Modifier* IofxAssetAuthoringImpl::getModifier(uint32_t modStage, uint32_t position) const +{ + if (modStage >= ModifierStage_Count) + { + APEX_INVALID_OPERATION("Invalid modifier stage"); + return 0; + } + + const ModifierStack& activeStack = getModifierStack(modStage); + + if (position >= activeStack.size()) + { + APEX_INVALID_OPERATION("position %d is greater than modifier stack size: %d", position, activeStack.size()); + return 0; + } + + // remove from ModifierStack (runtime) + return activeStack[ position ]; +} + +uint32_t IofxAssetAuthoringImpl::getAssetTarget() const +{ + uint32_t retVal = 0; + if (getSpriteMaterialName()) + { + retVal |= ModifierUsage_Sprite; + } + else if ((*mRenderMeshList).size()) + { + retVal |= ModifierUsage_Mesh; + } + + return retVal; +} + +#endif /* IOFX_AUTHORING_API_ENABLED */ + +#endif + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/IofxManager.cpp b/APEX_1.4/module/iofx/src/IofxManager.cpp new file mode 100644 index 00000000..490fe3c7 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxManager.cpp @@ -0,0 +1,1291 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "PsArray.h" +#include "SceneIntl.h" +#include "ModuleIofxImpl.h" +#include "IofxManager.h" +#include "IofxSceneCPU.h" +#include "IofxAssetImpl.h" +#include "IosObjectData.h" +#include "IofxRenderData.h" + +#include "IofxActorCPU.h" + +#if APEX_CUDA_SUPPORT +#include "ApexCuda.h" // APEX_CUDA_MEM_ALIGN_UP_32BIT +#include "ApexMirroredArray.h" +#if ENABLE_TEST +#include "IofxTestManagerGPU.h" +#define IOFX_MANAGER_GPU IofxTestManagerGPU +#else +#include "IofxManagerGPU.h" +#define IOFX_MANAGER_GPU IofxManagerGPU +#endif +#endif + +#define BASE_SPRITE_SEMANTICS (1<<IofxRenderSemantic::POSITION) | \ + (1<<IofxRenderSemantic::VELOCITY) | \ + (1<<IofxRenderSemantic::LIFE_REMAIN) + +#define BASE_MESH_SEMANTICS (1<<IofxRenderSemantic::POSITION) | \ + (1<<IofxRenderSemantic::SCALE) | \ + (1<<IofxRenderSemantic::ROTATION) | \ + (1<<IofxRenderSemantic::VELOCITY) | \ + (1<<IofxRenderSemantic::LIFE_REMAIN) + +namespace nvidia +{ +namespace iofx +{ + +#pragma warning(disable: 4355) // 'this' : used in base member initializer list + + +IofxManager::IofxManager(IofxScene& scene, const IofxManagerDescIntl& desc, bool isMesh) + : mPostUpdateTaskID(0) + , mIofxScene(&scene) + , mIosAssetName(desc.iosAssetName) + , mWorkingIosData(NULL) + , mResultIosData(NULL) + , mStagingIosData(NULL) + , mTargetSemantics(0) + , mRenderState(RENDER_WAIT_FOR_DATA_ALLOC) + , mInteropFlags(RenderInteropFlags::NO_INTEROP) + , positionMass(*scene.mApexScene, PX_ALLOC_INFO("positionMass", PARTICLES)) + , velocityLife(*scene.mApexScene, PX_ALLOC_INFO("velocityLife", PARTICLES)) + , collisionNormalFlags(*scene.mApexScene, PX_ALLOC_INFO("collisionNormalFlags", PARTICLES)) + , density(*scene.mApexScene, PX_ALLOC_INFO("density", PARTICLES)) + , actorIdentifiers(*scene.mApexScene, PX_ALLOC_INFO("actorIdentifiers", PARTICLES)) + , inStateToInput(*scene.mApexScene, PX_ALLOC_INFO("inStateToInput", PARTICLES)) + , outStateToInput(*scene.mApexScene, PX_ALLOC_INFO("outStateToInput", PARTICLES)) + , userData(*scene.mApexScene, PX_ALLOC_INFO("userData", PARTICLES)) + , pubStateSize(0) + , privStateSize(0) + , mStateSwap(false) + , mTotalElapsedTime(0) + , mIsMesh(isMesh) + , mDistanceSortingEnabled(false) + , mCudaIos(desc.iosOutputsOnDevice) + , mCudaModifiers(false) + , mCudaPipeline(NULL) + , mSimulateTask(*this) +#if APEX_CUDA_SUPPORT + , mCopyQueue(*scene.mApexScene->getTaskManager()->getGpuDispatcher()) +#endif + , mLastNumObjects(0) + , mLastMaxInputID(0) + , mOnStartCallback(NULL) + , mOnFinishCallback(NULL) +{ + scene.mActorManagers.add(*this); + + mBounds.setEmpty(); + + mInStateOffset = 0; + mOutStateOffset = desc.maxObjectCount; + + // The decision whether to use GPU IOFX Modifiers is separate from whether the IOS + // outputs will come from the GPU or not +#if APEX_CUDA_SUPPORT + PxGpuDispatcher* gd = scene.mApexScene->getTaskManager()->getGpuDispatcher(); + if (gd && gd->getCudaContextManager()->contextIsValid() && !scene.mModule->mCudaDisabled) + { + mCudaModifiers = true; + // detect interop + if (gd->getCudaContextManager()->getInteropMode() != PxCudaInteropMode::NO_INTEROP && !scene.mModule->mInteropDisabled) + { + mInteropFlags = RenderInteropFlags::CUDA_INTEROP; + } + const uint32_t dataCount = 3u; + for (uint32_t i = 0 ; i < dataCount ; i++) + { + IosObjectGpuData* gpuIosData = PX_NEW(IosObjectGpuData)(i); + mObjData.pushBack(gpuIosData); + } + + mOutStateOffset = APEX_CUDA_MEM_ALIGN_UP_32BIT(desc.maxObjectCount); + mCudaPipeline = PX_NEW(IOFX_MANAGER_GPU)(*mIofxScene->mApexScene, desc, *this); + } + else +#endif + { + const uint32_t dataCount = 3u; + for (uint32_t i = 0 ; i < dataCount ; i++) + { + IosObjectCpuData* cpuIosData = PX_NEW(IosObjectCpuData)(i); + mObjData.pushBack(cpuIosData); + } + } + + mWorkingIosData = mObjData[0]; + mResultIosData = mObjData[1]; + mStagingIosData = mObjData[2]; + + // Create & Assign Shared Render Data + for (uint32_t i = 0 ; i < mObjData.size() ; i++) + { + if (mIsMesh) + { + mObjData[i]->renderData = PX_NEW(IofxSharedRenderDataMeshImpl)(i, mInteropFlags); + } + else + { + mObjData[i]->renderData = PX_NEW(IofxSharedRenderDataSpriteImpl)(i, mInteropFlags); + } + } + + ApexMirroredPlace::Enum place = ApexMirroredPlace::CPU; +#if APEX_CUDA_SUPPORT + if (mCudaIos || mCudaModifiers) + { + place = ApexMirroredPlace::CPU_GPU; + } +#endif + { + positionMass.setSize(desc.maxInputCount, place); + velocityLife.setSize(desc.maxInputCount, place); + if (desc.iosSupportsCollision) + { + collisionNormalFlags.setSize(desc.maxInputCount, place); + } + if (desc.iosSupportsDensity) + { + density.setSize(desc.maxInputCount, place); + } + actorIdentifiers.setSize(desc.maxInputCount, place); + inStateToInput.setSize(desc.maxInStateCount, place); + outStateToInput.setSize(desc.maxObjectCount, place); + + if (desc.iosSupportsUserData) + { + userData.setSize(desc.maxInputCount, place); + } + + mSimBuffers.pmaPositionMass = &positionMass; + mSimBuffers.pmaVelocityLife = &velocityLife; + mSimBuffers.pmaCollisionNormalFlags = desc.iosSupportsCollision ? &collisionNormalFlags : NULL; + mSimBuffers.pmaDensity = desc.iosSupportsDensity ? &density : NULL; + mSimBuffers.pmaActorIdentifiers = &actorIdentifiers; + mSimBuffers.pmaInStateToInput = &inStateToInput; + mSimBuffers.pmaOutStateToInput = &outStateToInput; + mSimBuffers.pmaUserData = desc.iosSupportsUserData ? &userData : NULL; + } + + if (!mCudaModifiers) + { + mOutputToState.resize(desc.maxObjectCount); + } + + /* Initialize IOS object data structures */ + for (uint32_t i = 0 ; i < mObjData.size() ; i++) + { + mObjData[i]->pmaPositionMass = mSimBuffers.pmaPositionMass; + mObjData[i]->pmaVelocityLife = mSimBuffers.pmaVelocityLife; + mObjData[i]->pmaCollisionNormalFlags = mSimBuffers.pmaCollisionNormalFlags; + mObjData[i]->pmaDensity = mSimBuffers.pmaDensity; + mObjData[i]->pmaActorIdentifiers = mSimBuffers.pmaActorIdentifiers; + mObjData[i]->pmaInStateToInput = mSimBuffers.pmaInStateToInput; + mObjData[i]->pmaOutStateToInput = mSimBuffers.pmaOutStateToInput; + mObjData[i]->pmaUserData = mSimBuffers.pmaUserData; + + mObjData[i]->iosAssetName = desc.iosAssetName; + mObjData[i]->iosOutputsOnDevice = desc.iosOutputsOnDevice; + mObjData[i]->iosSupportsDensity = desc.iosSupportsDensity; + mObjData[i]->iosSupportsCollision = desc.iosSupportsCollision; + mObjData[i]->iosSupportsUserData = desc.iosSupportsUserData; + mObjData[i]->maxObjectCount = desc.maxObjectCount; + mObjData[i]->maxInputCount = desc.maxInputCount; + mObjData[i]->maxInStateCount = desc.maxInStateCount; + } +} + +IofxManager::~IofxManager() +{ + for (uint32_t i = 0; i < pubState.slices.size(); ++i) + { + delete pubState.slices[i]; + } + + for (uint32_t i = 0; i < privState.slices.size(); ++i) + { + delete privState.slices[i]; + } +} + +void IofxManager::destroy() +{ +#if APEX_CUDA_SUPPORT + if (mCudaPipeline) + { + mCudaPipeline->release(); + } +#endif + for (uint32_t i = 0 ; i < mObjData.size() ; i++) + { + PX_DELETE(mObjData[i]); + } + + delete this; +} + + +void IofxManager::release() +{ + mIofxScene->releaseIofxManager(this); +} + +#if !APEX_CUDA_SUPPORT +/* Stubs for console builds */ +void IofxManager::fillMapUnmapArraysForInterop(nvidia::Array<CUgraphicsResource> &, nvidia::Array<CUgraphicsResource> &) {} +void IofxManager::mapBufferResultsForInterop(bool, bool) {} +#endif + +void IofxManager::prepareRenderables() +{ + const uint32_t targetSemantics = mTargetSemantics; + + switch (mRenderState) + { + case RENDER_READY: + //PX_ASSERT(mResultIosData->renderData->getBufferIsMapped() == true); + mResultIosData->renderData->unmap(); + + //PX_ASSERT(mStagingIosData->renderData->getBufferIsMapped() == false); + mStagingIosData->updateSemantics(*mIofxScene, targetSemantics); + mStagingIosData->renderData->map(); + + nvidia::swap(mStagingIosData, mResultIosData); + + mRenderState = RENDER_WAIT_FOR_NEW; + break; + case RENDER_WAIT_FOR_DATA_ALLOC: + if (targetSemantics != 0) + { + mResultIosData->updateSemantics(*mIofxScene, targetSemantics); + mResultIosData->renderData->map(); + mStagingIosData->updateSemantics(*mIofxScene, targetSemantics); + mStagingIosData->renderData->map(); + + mRenderState = RENDER_WAIT_FOR_FETCH_RESULT; + } + //go to default case here! + default: + return; + }; + + // mLiveRenderVolumesLock is allready locked in IofxScene::prepareRenderables + for (uint32_t i = 0 ; i < mIofxScene->mLiveRenderVolumes.size() ; i++) + { + RenderVolumeImpl* vol = mIofxScene->mLiveRenderVolumes[i]; + // all render volumes are allready locked in IofxScene::prepareRenderables + + uint32_t iofxActorCount; + IofxActor* const* iofxActorList = vol->lockIofxActorList(iofxActorCount); + for (uint32_t iofxActorIndex = 0; iofxActorIndex < iofxActorCount; ++iofxActorIndex) + { + IofxActorImpl* iofxActor = DYNAMIC_CAST(IofxActorImpl*)( iofxActorList[iofxActorIndex] ); + if (&iofxActor->mMgr == this) + { + iofxActor->prepareRenderables(mStagingIosData); + } + } + vol->unlockIofxActorList(); + } +} + +float IofxManager::getObjectRadius() const +{ + return mObjData[0] ? mObjData[0]->radius : 0.0f; +} + +void IofxManager::setSimulationParameters(float radius, const PxVec3& up, float gravity, float restDensity) +{ + /* Initialize IOS object data structures */ + for (uint32_t i = 0 ; i < mObjData.size() ; i++) + { + mObjData[i]->radius = radius; + mObjData[i]->upVector = up; + mObjData[i]->gravity = gravity; + mObjData[i]->restDensity = restDensity; + } +} + +void IofxManager::createSimulationBuffers(IosBufferDescIntl& outDesc) +{ + outDesc = mSimBuffers; +} + +/* Called by owning IOS actor during simulation startup, only if + * the IOS is going to simulate this frame, so it is safe to submit + * tasks from here. postUpdateTaskID is the ID for an IOS task + * that should run after IOFX modifiers. If the IOFX Manager adds + * no dependencies, postUpdateTaskID task will run right after + * updateEffectsData() returns. If updateEffectsData() will be completely + * synchronous, it is safe to return (PxTaskID)0xFFFFFFFF here. + */ +PxTaskID IofxManager::getUpdateEffectsTaskID(PxTaskID postUpdateTaskID) +{ + PxTaskManager* tm = mIofxScene->mApexScene->getTaskManager(); + mPostUpdateTaskID = postUpdateTaskID; + if (mCudaModifiers) + { + return mCudaPipeline->launchGpuTasks(); + } + else + { + tm->submitUnnamedTask(mSimulateTask); + mSimulateTask.finishBefore(tm->getNamedTask(AST_PHYSX_FETCH_RESULTS)); + return mSimulateTask.getTaskID(); + } +} + + +void TaskUpdateEffects::run() +{ + setProfileStat((uint16_t) mOwner.mWorkingIosData->numParticles); + mOwner.cpuModifiers(); +} + +/// \brief Called by IOS actor before TaskUpdateEffects is scheduled to run +void IofxManager::updateEffectsData(float deltaTime, uint32_t numObjects, uint32_t maxInputID, uint32_t maxStateID, void* extraData) +{ + PX_ASSERT(maxStateID >= maxInputID && maxInputID >= numObjects); + + mLastNumObjects = numObjects; + mLastMaxInputID = maxInputID; + + if (mCudaIos && !mCudaModifiers) + { +#if APEX_CUDA_SUPPORT + /* Presumably, updateEffectsData() is being called from a DtoH GPU task */ + mCopyQueue.reset(CUstream(extraData), 8); + positionMass.copyDeviceToHostQ(mCopyQueue, maxInputID); + velocityLife.copyDeviceToHostQ(mCopyQueue, maxInputID); + if (mWorkingIosData->iosSupportsCollision) + { + collisionNormalFlags.copyDeviceToHostQ(mCopyQueue, maxInputID); + } + if (mWorkingIosData->iosSupportsDensity) + { + density.copyDeviceToHostQ(mCopyQueue, maxInputID); + } + if (mWorkingIosData->iosSupportsUserData) + { + userData.copyDeviceToHostQ(mCopyQueue, maxInputID); + } + actorIdentifiers.copyDeviceToHostQ(mCopyQueue, maxInputID); + inStateToInput.copyDeviceToHostQ(mCopyQueue, maxStateID); + mCopyQueue.flushEnqueued(); + + mIofxScene->mApexScene->getTaskManager()->getGpuDispatcher()->addCompletionPrereq(mSimulateTask); +#else + PX_UNUSED(extraData); + PX_ALWAYS_ASSERT(); +#endif + } + + /* Data from the IOS */ + mWorkingIosData->maxInputID = maxInputID; + mWorkingIosData->maxStateID = maxStateID; + mWorkingIosData->numParticles = numObjects; + + /* Data from the scene */ + mWorkingIosData->eyePosition = mIofxScene->mApexScene->getEyePosition(); + mWorkingIosData->eyeDirection = mIofxScene->mApexScene->getEyeDirection(); + + PxMat44 viewMtx = mIofxScene->mApexScene->getViewMatrix(); + PxMat44 projMtx = mIofxScene->mApexScene->getProjMatrix(); + mWorkingIosData->eyeAxisX = PxVec3(viewMtx.column0.x, viewMtx.column1.x, viewMtx.column2.x); + mWorkingIosData->eyeAxisY = PxVec3(viewMtx.column0.y, viewMtx.column1.y, viewMtx.column2.y); + mWorkingIosData->zNear = PxAbs(projMtx.column3.z / projMtx.column2.z); + + mWorkingIosData->deltaTime = deltaTime; + // TODO: Convert into uint32_t elapsed milliseconds + mTotalElapsedTime = numObjects ? mTotalElapsedTime + mWorkingIosData->deltaTime : 0; + mWorkingIosData->elapsedTime = mTotalElapsedTime; + + /* IOFX data */ + if (mCudaModifiers) + { + mCudaPipeline->launchPrep(); // calls allocOutputs + } +} + +void IofxManager::cpuModifiers() +{ + if (!mCudaIos && mOnStartCallback) + { + (*mOnStartCallback)(NULL); + } + uint32_t maxInputID, maxStateID, numObjects; + + maxInputID = mWorkingIosData->maxInputID; + maxStateID = mWorkingIosData->maxStateID; + numObjects = mWorkingIosData->numParticles; + + PX_UNUSED(numObjects); + + /* Swap state buffer pointers */ + + IosObjectCpuData* md = DYNAMIC_CAST(IosObjectCpuData*)(mWorkingIosData); + + md->inPubState = mStateSwap ? &pubState.a[0] : &pubState.b[0]; + md->outPubState = mStateSwap ? &pubState.b[0] : &pubState.a[0]; + + md->inPrivState = mStateSwap ? &privState.a[0] : &privState.b[0]; + md->outPrivState = mStateSwap ? &privState.b[0] : &privState.a[0]; + + swapStates(); + + /* Sort sprites */ + + if (!mIsMesh) + { + DYNAMIC_CAST(IosObjectCpuData*)(mWorkingIosData)->sortingKeys = + mDistanceSortingEnabled ? &mSortingKeys.front() : NULL; + } + + /* Volume Migration (1 pass) */ + + mCountPerActor.clear(); + mCountPerActor.resize(mActorTable.size() * mVolumeTable.size(), 0); + for (uint32_t input = 0 ; input < maxInputID ; input++) + { + IofxActorIDIntl& id = mWorkingIosData->pmaActorIdentifiers->get(input); + if (id.getActorClassID() == IofxActorIDIntl::IPX_ACTOR || id.getActorClassID() >= mActorClassTable.size()) + { + id.set(IofxActorIDIntl::NO_VOLUME, IofxActorIDIntl::IPX_ACTOR); + } + else + { + const PxVec3& pos = mWorkingIosData->pmaPositionMass->get(input).getXYZ(); + uint32_t curPri = 0; + uint16_t curVID = IofxActorIDIntl::NO_VOLUME; + + for (uint16_t i = 0 ; i < mVolumeTable.size() ; i++) + { + VolumeData& vd = mVolumeTable[ i ]; + if (vd.vol == NULL) + { + continue; + } + + const uint32_t bit = mActorClassTable.size() * i + id.getActorClassID(); + + // This volume owns this particle if: + // 1. The volume bounds contain the particle + // 2. The volume affects the particle's IOFX Asset + // 3. This volume has the highest priority or was the previous owner + if (vd.mBounds.contains(pos) && + (mVolumeActorClassBitmap[ bit >> 5 ] & (1u << (bit & 31))) && + (curVID == IofxActorIDIntl::NO_VOLUME || vd.mPri > curPri || (vd.mPri == curPri && id.getVolumeID() == i))) + { + curVID = i; + curPri = vd.mPri; + } + } + + id.setVolumeID(curVID); + } + + // Count particles in each actor + if (id.getVolumeID() != IofxActorIDIntl::NO_VOLUME) + { + const uint32_t actorID = mActorClassTable[ id.getActorClassID() ].actorID; + PX_ASSERT(actorID < mActorTable.size()); + const uint32_t aid = id.getVolumeID() * mActorTable.size() + actorID; + ++mCountPerActor[aid]; + } + } + + /* Prefix sum */ + mStartPerActor.clear(); + mStartPerActor.resize(mCountPerActor.size(), 0); + uint32_t sum = 0; + for (uint32_t i = 0 ; i < mStartPerActor.size() ; i++) + { + mStartPerActor[ i ] = sum; + sum += mCountPerActor[ i ]; + } + + IosObjectCpuData* objData = DYNAMIC_CAST(IosObjectCpuData*)(mWorkingIosData); + objData->outputToState = &mOutputToState.front(); + + /* Generate outputToState (1 pass) */ + mBuildPerActor.clear(); + mBuildPerActor.resize(mStartPerActor.size(), 0); + uint32_t homeless = 0; + for (uint32_t state = 0 ; state < maxStateID ; state++) + { + uint32_t input = objData->pmaInStateToInput->get(state); + if (input == IosBufferDescIntl::NOT_A_PARTICLE) + { + continue; + } + + input &= ~IosBufferDescIntl::NEW_PARTICLE_FLAG; + + const IofxActorIDIntl id = objData->pmaActorIdentifiers->get(input); + if (id.getVolumeID() == IofxActorIDIntl::NO_VOLUME) + { + objData->pmaOutStateToInput->get(sum + homeless) = input; + ++homeless; + } + else + { + PX_ASSERT(id.getActorClassID() != IofxActorIDIntl::IPX_ACTOR && id.getActorClassID() < mActorClassTable.size()); + const uint32_t actorID = mActorClassTable[ id.getActorClassID() ].actorID; + PX_ASSERT(actorID < mActorTable.size()); + const uint32_t aid = id.getVolumeID() * mActorTable.size() + actorID; + objData->outputToState[ mStartPerActor[aid] + mBuildPerActor[ aid ]++ ] = state; + } + } + + /* Step IOFX Actors */ + uint32_t aid = 0; + PxTaskManager* tm = mIofxScene->mApexScene->getTaskManager(); + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + VolumeData& d = mVolumeTable[ i ]; + if (d.vol == 0) + { + aid += mActorTable.size(); + continue; + } + + for (uint32_t j = 0 ; j < mActorTable.size(); j++) + { + if (d.mActors[ j ] == DEFERRED_IOFX_ACTOR && mActorTable[ j ] != NULL && + (mIofxScene->mModule->mDeferredDisabled || mCountPerActor[ aid ])) + { + IofxActorImpl* iofxActor = PX_NEW(IofxActorCPU)(mActorTable[j]->getRenderResID(), mIofxScene, *this); + if (d.vol->addIofxActor(*iofxActor)) + { + d.mActors[ j ] = iofxActor; + + initIofxActor(iofxActor, j, d.vol); + } + else + { + iofxActor->release(); + } + } + + IofxActorCPU* cpuIofx = DYNAMIC_CAST(IofxActorCPU*)(d.mActors[ j ]); + if (cpuIofx && cpuIofx != DEFERRED_IOFX_ACTOR) + { + if (mCountPerActor[ aid ]) + { + ObjectRange range; + range.objectCount = mCountPerActor[ aid ]; + range.startIndex = mStartPerActor[ aid ]; + PX_ASSERT(range.startIndex + range.objectCount <= numObjects); + + cpuIofx->mWorkingRange = range; + + cpuIofx->mModifierTask.setContinuation(*tm, tm->getTaskFromID(mPostUpdateTaskID)); + cpuIofx->mModifierTask.removeReference(); + } + else + { + cpuIofx->mWorkingVisibleCount = 0; + cpuIofx->mWorkingRange.objectCount = 0; + cpuIofx->mWorkingRange.startIndex = 0; + cpuIofx->mWorkingBounds.setEmpty(); + } + } + + aid++; + } + } + + if (!mCudaIos && mOnFinishCallback) + { + (*mOnFinishCallback)(NULL); + } +} + +void IofxManager::outputHostToDevice(PxGpuCopyDescQueue& copyQueue) +{ + if (mCudaIos && !mCudaModifiers) + { +#if APEX_CUDA_SUPPORT + actorIdentifiers.copyHostToDeviceQ(copyQueue, mLastMaxInputID); + outStateToInput.copyHostToDeviceQ(copyQueue, mLastNumObjects); +#else + PX_UNUSED(copyQueue); + PX_ALWAYS_ASSERT(); +#endif + } +} + + +void IofxManager::submitTasks() +{ + /* Discover new volumes, removed volumes */ + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + mVolumeTable[ i ].mFlags = 0; + } + + for (uint32_t i = 0 ; i < mIofxScene->mLiveRenderVolumes.size() ; i++) + { + getVolumeID(mIofxScene->mLiveRenderVolumes[ i ]); + } + + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + if (mVolumeTable[ i ].mFlags == 0) + { + mVolumeTable[ i ].vol = 0; + } + } + + /* Trim Volume, ActorID and ActorClassID tables */ + while (mVolumeTable.size() && mVolumeTable.back().vol == 0) + { + mVolumeTable.popBack(); + } + + if (!mActorTable.empty()) + { + int32_t lastValidID = -1; + for (int32_t cur = (int32_t)mActorTable.size() - 1; cur >= 0; --cur) + { + if (mActorTable[(uint32_t)cur] != NULL) + { + lastValidID = cur; + break; + } + } + if (lastValidID == -1) + { + mActorTable.clear(); + } + else + { + mActorTable.resize((uint32_t)lastValidID + 1); + } + } + + if (!mActorClassTable.empty()) + { + int32_t lastValidID = -1; + for (uint32_t cur = 0; cur < mActorClassTable.size(); cur += mActorClassTable[ cur ].count) + { + if (mActorClassTable[ cur ].client != NULL) + { + lastValidID = (int32_t)cur; + } + } + if (lastValidID == -1) + { + mActorClassTable.clear(); + } + else + { + mActorClassTable.resize((uint32_t)(lastValidID + mActorClassTable[ (uint32_t)lastValidID ].count)); + } + } + + const uint32_t volumeActorClassBitmapSize = (mVolumeTable.size() * mActorClassTable.size() + 31) >> 5; + mVolumeActorClassBitmap.resize(volumeActorClassBitmapSize); + for (uint32_t i = 0 ; i < volumeActorClassBitmapSize ; i++) + { + mVolumeActorClassBitmap[ i ] = 0; + } + + /* Add new IofxActors as necessary */ + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + VolumeData& d = mVolumeTable[ i ]; + + // First, ensure per-volume actor array can hold all ClassIDs + d.mActors.resize(mActorTable.size(), 0); + + if (d.vol == NULL) + { + continue; + } + + d.mBounds = d.vol->getOwnershipBounds(); + d.mPri = d.vol->getPriority(); + + for (uint32_t cur = 0; cur < mActorTable.size(); ++cur) + { + if (mActorTable[ cur ] != NULL) + { + if (!d.mActors[ cur ]) + { + d.mActors[ cur ] = DEFERRED_IOFX_ACTOR; + } + } + } + + d.vol->lockReader(); // for safety during affectsIofxAsset() calls + for (uint32_t cur = 0; cur < mActorClassTable.size(); ++cur) + { + const ActorClassData& acd = mActorClassTable[ cur ]; + if (acd.client != NULL && acd.actorID < mActorTable.size()) + { + IofxAssetImpl* iofxAsset = acd.client->getAssetSceneInst()->getAsset(); + if (iofxAsset && d.vol->affectsIofxAsset(*iofxAsset)) + { + const uint32_t bit = mActorClassTable.size() * i + cur; + mVolumeActorClassBitmap[ bit >> 5 ] |= (1u << (bit & 31)); + } + } + } + d.vol->unlockReader(); // for safety during affectsIofxAsset() calls + } + + uint32_t targetSemantics = 0; + mDistanceSortingEnabled = false; + { + for (AssetHashMap_t::Iterator it = mAssetHashMap.getIterator(); !it.done(); ++it) + { + IofxAssetImpl* iofxAsset = it->first; + IofxAssetSceneInst* iofxAssetSceneInst = it->second; + + targetSemantics |= iofxAssetSceneInst->getSemantics(); + if (!mDistanceSortingEnabled && iofxAsset->isSortingEnabled()) + { + mDistanceSortingEnabled = true; + if (!mCudaModifiers) + { + mSortingKeys.resize(mOutputToState.size()); + } + } + } + } + mTargetSemantics = targetSemantics; + + if (mCudaModifiers) + { + mCudaPipeline->submitTasks(); + } + + if (!addedAssets.empty()) + { + /* Calculate state sizes required by new assets */ + uint32_t newPubStateSize = 0, newPrivStateSize = 0; + for (uint32_t i = 0; i < addedAssets.size(); ++i) + { + newPubStateSize = PxMax(newPubStateSize, addedAssets[i]->getPubStateSize()); + newPrivStateSize = PxMax(newPrivStateSize, addedAssets[i]->getPrivStateSize()); + } + + uint32_t maxObjectCount = outStateToInput.getSize(), + totalCount = mOutStateOffset + maxObjectCount; + + // Allocate data for pubstates + while (newPubStateSize > pubStateSize) + { + pubStateSize += sizeof(IofxSlice); + + SliceArray* slice = new SliceArray(*mIofxScene->mApexScene, PX_ALLOC_INFO("slice", PARTICLES)); + +#if APEX_CUDA_SUPPORT + if (mCudaModifiers) + { + //slice->reserve(totalCount, ApexMirroredPlace::GPU); Recalculated on GPU + } + else +#endif + { + slice->reserve(totalCount, ApexMirroredPlace::CPU); + } + + pubState.slices.pushBack(slice); + + IofxSlice* p; +#if APEX_CUDA_SUPPORT + p = mCudaModifiers + ? pubState.slices.back()->getGpuPtr() + : pubState.slices.back()->getPtr(); +#else + p = pubState.slices.back()->getPtr(); +#endif + pubState.a.pushBack(p + mInStateOffset); + pubState.b.pushBack(p + mOutStateOffset); + } + + // Allocate data for privstates + while (newPrivStateSize > privStateSize) + { + privStateSize += sizeof(IofxSlice); + + SliceArray* slice = new SliceArray(*mIofxScene->mApexScene, PX_ALLOC_INFO("slice", PARTICLES)); + +#if APEX_CUDA_SUPPORT + if (mCudaModifiers) + { + slice->reserve(totalCount, ApexMirroredPlace::GPU); + } + else +#endif + { + slice->reserve(totalCount, ApexMirroredPlace::CPU); + } + + privState.slices.pushBack(slice); + + IofxSlice* p; +#if APEX_CUDA_SUPPORT + p = mCudaModifiers + ? privState.slices.back()->getGpuPtr() + : privState.slices.back()->getPtr(); +#else + p = privState.slices.back()->getPtr(); +#endif + privState.a.pushBack(p + mInStateOffset); + privState.b.pushBack(p + mOutStateOffset); + } + + addedAssets.clear(); + } +} + +void IofxManager::swapStates() +{ + mStateSwap = !mStateSwap; + swap(mInStateOffset, mOutStateOffset); +} + +void IofxManager::fetchResults() +{ + if (!mPostUpdateTaskID) + { + return; + } + mPostUpdateTaskID = 0; + + if (mCudaModifiers) + { + mCudaPipeline->fetchResults(); + } + else + { + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + VolumeData& d = mVolumeTable[ i ]; + for (uint32_t j = 0 ; j < mActorTable.size() ; j++) + { + IofxActorCPU* cpuIofx = DYNAMIC_CAST(IofxActorCPU*)(d.mActors[ j ]); + if (cpuIofx && cpuIofx != DEFERRED_IOFX_ACTOR) + { + cpuIofx->mResultBounds = cpuIofx->mWorkingBounds; + cpuIofx->mResultRange = cpuIofx->mWorkingRange; + cpuIofx->mResultVisibleCount = cpuIofx->mWorkingVisibleCount; + } + } + } + } + + //build bounds + { + mBounds.setEmpty(); + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + VolumeData& d = mVolumeTable[ i ]; + for (uint32_t j = 0 ; j < mActorTable.size() ; j++) + { + IofxActorImpl* iofx = d.mActors[ j ]; + if (iofx && iofx != DEFERRED_IOFX_ACTOR) + { + mBounds.include(iofx->mResultBounds); + } + } + } + } + + { + switch (mRenderState) + { + case RENDER_WAIT_FOR_DATA_ALLOC: + //just do nothing + break; + case RENDER_WAIT_FOR_FETCH_RESULT: + nvidia::swap(mStagingIosData, mWorkingIosData); + mRenderState = RENDER_WAIT_FOR_NEW; + break; + case RENDER_WAIT_FOR_NEW: + case RENDER_READY: + nvidia::swap(mResultIosData, mWorkingIosData); + mRenderState = RENDER_READY; + break; + default: + PX_ALWAYS_ASSERT(); + }; + } +} + +PxBounds3 IofxManager::getBounds() const +{ + return mBounds; +} + +uint32_t IofxManager::getActorID(IofxAssetSceneInst* assetSceneInst, uint16_t meshID) +{ + IofxAssetImpl* iofxAsset = assetSceneInst->getAsset(); + + ResID renderResID = INVALID_RESOURCE_ID; + if (mIsMesh) + { + const char* rmName = iofxAsset->getMeshAssetName(meshID); + bool isOpaqueMesh = iofxAsset->isOpaqueMesh(meshID); + renderResID = iofxAsset->mRenderMeshAssetTracker.getResourceIdFromName(rmName, isOpaqueMesh); + if (renderResID == INVALID_RESOURCE_ID) + { + APEX_INVALID_PARAMETER("IofxManager: Mesh Asset with name \"%s\" not found.", rmName); + } + } + else + { + const char* mtlName = iofxAsset->getSpriteMaterialName(); + renderResID = iofxAsset->mSpriteMaterialAssetTracker.getResourceIdFromName(mtlName, false); + if (renderResID == INVALID_RESOURCE_ID) + { + APEX_INVALID_PARAMETER("IofxManager: Sprite Material with name \"%s\" not found.", mtlName); + } + } + uint32_t actorID = uint32_t(-1); + if (renderResID != INVALID_RESOURCE_ID) + { + for (uint32_t id = 0 ; id < mActorTable.size() ; id++) + { + if (mActorTable[id] != NULL) + { + if (mActorTable[id]->getRenderResID() == renderResID) + { + actorID = id; + break; + } + } + else if (actorID == uint32_t(-1)) + { + actorID = id; + } + } + if (actorID == uint32_t(-1)) + { + actorID = mActorTable.size(); + mActorTable.resize(actorID + 1, NULL); + } + + IofxActorSceneInst* &actorSceneInst = mActorTable[actorID]; + if (actorSceneInst == NULL) + { + actorSceneInst = PX_NEW(IofxActorSceneInst)(renderResID); + } + actorSceneInst->addRef(); + + // only add iofxAsset one time, check refCount + if (assetSceneInst->getRefCount() == 1) + { + actorSceneInst->addAssetSceneInst(assetSceneInst); + } + } + return actorID; +} +void IofxManager::releaseActorID(IofxAssetSceneInst* assetSceneInst, uint32_t actorID) +{ + PX_ASSERT(actorID < mActorTable.size()); + IofxActorSceneInst* &actorSceneInst = mActorTable[actorID]; + if (actorSceneInst != NULL) + { + PX_ASSERT(actorSceneInst->getRefCount() > 0); + if (actorSceneInst->removeRef()) + { + for (uint16_t j = 0 ; j < mVolumeTable.size() ; j++) + { + if (mVolumeTable[ j ].vol == NULL) + { + continue; + } + + if (actorID < mVolumeTable[ j ].mActors.size()) + { + IofxActorImpl* iofxActor = mVolumeTable[ j ].mActors[ actorID ]; + if (iofxActor && iofxActor != DEFERRED_IOFX_ACTOR) + { + iofxActor->release(); + //IofxManager::removeActorAtIndex should zero the actor in mActors + PX_ASSERT(mVolumeTable[ j ].mActors[ actorID ] == 0); + } + mVolumeTable[ j ].mActors[ actorID ] = 0; + } + } + + PX_DELETE(actorSceneInst); + actorSceneInst = NULL; + } + else + { + // only remove iofxAsset one time, check refCount + if (assetSceneInst->getRefCount() == 1) + { + actorSceneInst->removeAssetSceneInst(assetSceneInst); + } + } + } +} + +uint16_t IofxManager::getActorClassID(IofxManagerClientIntl* iofxClient, uint16_t meshID) +{ + IofxManagerClient* client = static_cast<IofxManagerClient*>(iofxClient); + if (client != 0) + { + const uint16_t actorClassID = uint16_t(client->getActorClassID() + meshID); + PX_ASSERT(actorClassID < mActorClassTable.size()); + PX_ASSERT(mActorClassTable[actorClassID].client == client); + PX_ASSERT(meshID < mActorClassTable[actorClassID].count); + + const uint32_t actorID = mActorClassTable[actorClassID].actorID; + if (actorID != uint32_t(-1)) + { + return actorClassID; + } + else + { + APEX_DEBUG_WARNING("IofxManager: getActorClassID returned invalid actor."); + return IofxActorIDIntl::IPX_ACTOR; + } + } + else + { + APEX_INVALID_PARAMETER("IofxManager: getActorClassID was called with invalid client."); + return IofxActorIDIntl::IPX_ACTOR; + } +} + +IofxManagerClientIntl* IofxManager::createClient(nvidia::apex::IofxAsset* asset, const IofxManagerClientIntl::Params& params) +{ + IofxAssetImpl* iofxAsset = static_cast<IofxAssetImpl*>(asset); + + IofxAssetSceneInst* &assetSceneInst = mAssetHashMap[iofxAsset]; + if (assetSceneInst == NULL) + { + assetSceneInst = createAssetSceneInst(iofxAsset); + // Update state sizes later in submitTasks + addedAssets.pushBack(iofxAsset); + // increase asset refCount + //ResourceProvider* nrp = GetInternalApexSDK()->getNamedResourceProvider(); + //nrp->setResource(IOFX_AUTHORING_TYPE_NAME, asset->getName(), asset, true); + } + assetSceneInst->addRef(); + + //allocate actorClasses + uint16_t actorClassCount = uint16_t( PxMax(1u, iofxAsset->getMeshAssetCount()) ); + uint32_t actorClassID = 0; + while (actorClassID < mActorClassTable.size()) + { + ActorClassData& acd = mActorClassTable[ actorClassID ]; + + if (acd.client == NULL && actorClassCount <= acd.count) + { + /* Make a shim to conver remaining hole */ + uint16_t remains = uint16_t(acd.count - actorClassCount); + for (uint16_t i = 0 ; i < remains ; i++) + { + ActorClassData& acd1 = mActorClassTable[ actorClassID + actorClassCount + i ]; + acd1.client = 0; + acd1.meshid = i; + acd1.count = remains; + acd1.actorID = uint32_t(-1); + } + break; + } + actorClassID = actorClassID + acd.count; + } + if (actorClassID >= mActorClassTable.size()) + { + /* Asset is not in table, append it */ + actorClassID = mActorClassTable.size(); + mActorClassTable.resize(actorClassID + actorClassCount); + } + + IofxManagerClient* client = NULL; +#if APEX_CUDA_SUPPORT + if (mCudaModifiers) + { + client = mCudaPipeline->createClient(assetSceneInst, actorClassID, params); + } + else +#endif + { + client = PX_NEW(IofxManagerClient)(assetSceneInst, actorClassID, params); + } + PX_ASSERT(client != NULL); + + for (uint16_t i = 0 ; i < actorClassCount ; i++) + { + ActorClassData& acd = mActorClassTable[ actorClassID + i ]; + acd.client = client; + acd.meshid = i; + acd.count = actorClassCount; + acd.actorID = getActorID(assetSceneInst, i); + } + + return static_cast<IofxManagerClientIntl*>(client); +} + +void IofxManager::releaseClient(IofxManagerClientIntl* iofxClient) +{ + // TODO: free unused memory in states + + IofxManagerClient* client = static_cast<IofxManagerClient*>(iofxClient); + if (client != 0) + { + IofxAssetSceneInst* assetSceneInst = client->getAssetSceneInst(); + uint32_t actorClassID = uint16_t(client->getActorClassID()); + + if (actorClassID < mActorClassTable.size()) + { + for (uint16_t i = 0 ; i < mActorClassTable[ actorClassID ].count ; i++) + { + uint32_t actorID = mActorClassTable[ actorClassID + i ].actorID; + if (actorID != uint32_t(-1)) + { + releaseActorID(assetSceneInst, actorID); + } + } + + // TODO: merge backward hole also + /* merge consecutive holes */ + uint32_t next = actorClassID + mActorClassTable[ actorClassID ].count; + while (next < mActorClassTable.size() && mActorClassTable[ next ].client == NULL) + { + next = next + mActorClassTable[ next ].count; + } + + uint16_t count = uint16_t(next - actorClassID); + for (uint16_t i = 0 ; i < count ; i++) + { + ActorClassData& acd = mActorClassTable[ actorClassID + i ]; + acd.client = 0; + acd.meshid = i; + acd.count = count; + acd.actorID = uint32_t(-1); + } + } + + PX_DELETE(client); + + if (assetSceneInst->removeRef()) + { + // decrease asset refCount + //ResourceProvider* nrp = GetInternalApexSDK()->getNamedResourceProvider(); + //nrp->releaseResource(IOFX_AUTHORING_TYPE_NAME, ad.asset->getName()); + + IofxAssetImpl* iofxAsset = assetSceneInst->getAsset(); + PX_DELETE(assetSceneInst); + assetSceneInst = NULL; + + mAssetHashMap.erase(iofxAsset); + } + } +} + +uint16_t IofxManager::getVolumeID(RenderVolume* vol) +{ + int32_t hole = -1; + for (uint16_t i = 0 ; i < mVolumeTable.size() ; i++) + { + if (vol == mVolumeTable[ i ].vol) + { + mVolumeTable[ i ].mFlags = 1; + return i; + } + else if (hole == -1 && !mVolumeTable[ i ].vol) + { + hole = (int32_t) i; + } + } + if (hole == -1) + { + mVolumeTable.insert(); + hole = (int32_t)mVolumeTable.size() - 1; + } + VolumeData& d = mVolumeTable[ (uint32_t)hole ]; + d.vol = DYNAMIC_CAST(RenderVolumeImpl*)(vol); + d.mFlags = 1; + d.mActors.clear(); //Iofx Actors are released in RenderVolumeImpl destructor! + return (uint16_t) hole; +} + + +void IofxManager::removeActorAtIndex(uint32_t index) +{ + IofxActorImpl* iofx = DYNAMIC_CAST(IofxActorImpl*)(mActorArray[ index ]); + + for (uint32_t i = 0 ; i < mVolumeTable.size() ; i++) + { + if (mVolumeTable[ i ].vol == iofx->mRenderVolume) + { + PX_ASSERT(iofx == mVolumeTable[ i ].mActors[ iofx->mActorID ]); + mVolumeTable[ i ].mActors[ iofx->mActorID ] = 0; + } + } + + ApexContext::removeActorAtIndex(index); +} + +IofxAssetSceneInst* IofxManager::createAssetSceneInst(IofxAsset* nxAsset) +{ + IofxAssetImpl* asset = DYNAMIC_CAST(IofxAssetImpl*)( nxAsset ); + + uint32_t semantics = uint32_t(mIsMesh ? BASE_MESH_SEMANTICS : BASE_SPRITE_SEMANTICS); + if( mObjData[0]->iosSupportsDensity ) + { + semantics |= (uint32_t)IofxRenderSemantic::DENSITY; + } + semantics |= mIsMesh ? asset->getMeshSemanticsBitmap() : asset->getSpriteSemanticsBitmap(); + + IofxAssetSceneInst* assetSceneInst = 0; +#if APEX_CUDA_SUPPORT + if (mCudaModifiers) + { + assetSceneInst = mCudaPipeline->createAssetSceneInst(asset, semantics); + } + else +#endif + { + assetSceneInst = PX_NEW(IofxAssetSceneInstCPU)(asset, semantics, mIofxScene); + } + PX_ASSERT(assetSceneInst != 0); + return assetSceneInst; +} + +void IofxManager::initIofxActor(IofxActorImpl* iofxActor, uint32_t actorID, RenderVolumeImpl* renderVolume) +{ + iofxActor->addSelfToContext(*this); + iofxActor->mActorID = actorID; + iofxActor->mRenderVolume = renderVolume; + iofxActor->mSemantics = 0; + iofxActor->mDistanceSortingEnabled = false; + + PX_ASSERT(mActorTable[actorID] != NULL); + const nvidia::Array<IofxAssetSceneInst*>& iofxAssets = mActorTable[actorID]->getAssetSceneInstArray(); + for (uint32_t k = 0; k < iofxAssets.size(); ++k) + { + IofxAssetSceneInst* assetSceneInst = iofxAssets[k]; + + iofxActor->mSemantics |= assetSceneInst->getSemantics(); + iofxActor->mDistanceSortingEnabled |= assetSceneInst->getAsset()->isSortingEnabled(); + } + +} + +} +} // end namespace nvidia::apex diff --git a/APEX_1.4/module/iofx/src/IofxManagerGPU.cpp b/APEX_1.4/module/iofx/src/IofxManagerGPU.cpp new file mode 100644 index 00000000..06d1209a --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxManagerGPU.cpp @@ -0,0 +1,1319 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "ApexDefs.h" + +#if APEX_CUDA_SUPPORT + +#include "ApexSDKIntl.h" +#include "SceneIntl.h" +#include "ModifierImpl.h" +#include "IofxActor.h" +#include "IofxManagerGPU.h" +#include "IofxAssetImpl.h" +#include "IofxSceneGPU.h" + +#include "ModuleIofxImpl.h" +#include "IofxActorGPU.h" + +#include "PxGpuTask.h" +#include "ApexCutil.h" + +#include "RandStateHelpers.h" + +#include "IofxRenderData.h" + +#define CUDA_OBJ(name) SCENE_CUDA_OBJ(mIofxScene, name) + +namespace nvidia +{ +namespace iofx +{ + +class IofxAssetSceneInstGPU : public IofxAssetSceneInst +{ +public: + IofxAssetSceneInstGPU(IofxAssetImpl* asset, uint32_t semantics, IofxScene* scene) + : IofxAssetSceneInst(asset, semantics) + , _constMemGroup(SCENE_CUDA_OBJ(*scene, modifierStorage)) + { + _totalRandomCount = 0; + + APEX_CUDA_CONST_MEM_GROUP_SCOPE(_constMemGroup) + + _storage_.alloc(_assetParamsHandle); + AssetParams assetParams; + buildModifierList(assetParams.spawnModifierList, _asset->mSpawnModifierStack); + buildModifierList(assetParams.continuousModifierList, _asset->mContinuousModifierStack); + _storage_.update(_assetParamsHandle, assetParams); + } + virtual ~IofxAssetSceneInstGPU() {} + + InplaceHandle<AssetParams> getAssetParamsHandle() const + { + return _assetParamsHandle; + } + +private: + + void buildModifierList(ModifierList& list, const ModifierStack& stack) + { + InplaceStorage& _storage_ = _constMemGroup.getStorage(); + + class Mapper : public ModifierParamsMapperGPU + { + public: + InplaceStorage* storage; + + InplaceHandleBase paramsHandle; + uint32_t paramsRandomCount; + + virtual InplaceStorage& getStorage() + { + return *storage; + } + + virtual void onParams(InplaceHandleBase handle, uint32_t randomCount) + { + paramsHandle = handle; + paramsRandomCount = randomCount; + } + + } mapper; + mapper.storage = &_storage_; + + list.resize(_storage_, stack.size()); + + uint32_t index = 0; + for (ModifierStack::ConstIterator it = stack.begin(); it != stack.end(); ++it) + { + uint32_t type = (*it)->getModifierType(); + //NxU32 usage = (*it)->getModifierUsage(); + //if ((usage & usageStage) == usageStage && (usage & usageClass) == usageClass) + { + const ModifierImpl* modifier = ModifierImpl::castFrom(*it); + modifier->mapParamsGPU(mapper); + + ModifierListElem listElem; + listElem.type = type; + listElem.paramsHandle = mapper.paramsHandle; + list.updateElem(_storage_, listElem, index); + + _totalRandomCount += mapper.paramsRandomCount; + } + ++index; + } + } + + ApexCudaConstMemGroup _constMemGroup; + InplaceHandle<AssetParams> _assetParamsHandle; + uint32_t _totalRandomCount; +}; + +class IofxManagerClientGPU : public IofxManagerClient +{ +public: + IofxManagerClientGPU(IofxAssetSceneInst* assetSceneInst, uint32_t actorClassID, const IofxManagerClientIntl::Params& params, IofxScene* scene) + : IofxManagerClient(assetSceneInst, actorClassID, params) + , _constMemGroup(SCENE_CUDA_OBJ(*scene, modifierStorage)) + { + setParamsGPU(); + } + + InplaceHandle<ClientParams> getClientParamsHandle() const + { + return _clientParamsHandle; + } + + // IofxManagerClientIntl interface + virtual void setParams(const IofxManagerClientIntl::Params& params) + { + IofxManagerClient::setParams(params); + setParamsGPU(); + } + +private: + void setParamsGPU() + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(_constMemGroup) + + ClientParams clientParams; + if (_clientParamsHandle.allocOrFetch(_storage_, clientParams)) + { + clientParams.assetParamsHandle = static_cast<IofxAssetSceneInstGPU*>(_assetSceneInst)->getAssetParamsHandle(); + } + clientParams.objectScale = _params.objectScale; + _clientParamsHandle.update(_storage_, clientParams); + } + + ApexCudaConstMemGroup _constMemGroup; + InplaceHandle<ClientParams> _clientParamsHandle; +}; + + +IofxManagerClient* IofxManagerGPU::createClient(IofxAssetSceneInst* assetSceneInst, uint32_t actorClassID, const IofxManagerClientIntl::Params& params) +{ + return PX_NEW(IofxManagerClientGPU)(assetSceneInst, actorClassID, params, &mIofxScene); +} + +IofxAssetSceneInst* IofxManagerGPU::createAssetSceneInst(IofxAssetImpl* asset,uint32_t semantics) +{ + return PX_NEW(IofxAssetSceneInstGPU)(asset, semantics, &mIofxScene); +} + +class IofxManagerLaunchTask : public PxGpuTask, public UserAllocated +{ +public: + IofxManagerLaunchTask(IofxManagerGPU* actor) : mActor(actor) {} + const char* getName() const + { + return "IofxManagerLaunchTask"; + } + void run() + { + PX_ALWAYS_ASSERT(); + } + bool launchInstance(CUstream stream, int kernelIndex) + { + return mActor->cudaLaunch(stream, kernelIndex); + } + PxGpuTaskHint::Enum getTaskHint() const + { + return PxGpuTaskHint::Kernel; + } + +protected: + IofxManagerGPU* mActor; +}; + +IofxManagerGPU::IofxManagerGPU(SceneIntl& scene, const IofxManagerDescIntl& desc, IofxManager& mgr, const ApexMirroredPlace::Enum defaultPlace) + : mManager(mgr) + , mIofxScene(*mgr.mIofxScene) + , mCopyQueue(*scene.getTaskManager()->getGpuDispatcher()) + , mDefaultPlace(defaultPlace) + , mCuSpawnScale(scene) + , mCuSpawnSeed(scene) + , mCuBlockPRNGs(scene) + , mCuSortedActorIDs(scene) + , mCuSortedStateIDs(scene) + , mCuSortTempKeys(scene) + , mCuSortTempValues(scene) + , mCuSortTemp(scene) + , mCuMinBounds(scene) + , mCuMaxBounds(scene) + , mCuTempMinBounds(scene) + , mCuTempMaxBounds(scene) + , mCuTempActorIDs(scene) + , mCuActorStart(scene) + , mCuActorEnd(scene) + , mCuActorVisibleEnd(scene) + , mCurSeed(0) + , mTargetBufDevPtr(NULL) + , mCountActorIDs(0) + , mNumberVolumes(0) + , mNumberActorClasses(0) + , mEmptySimulation(false) + , mVolumeConstMemGroup(CUDA_OBJ(migrationStorage)) + , mRemapConstMemGroup(CUDA_OBJ(remapStorage)) + , mModifierConstMemGroup(CUDA_OBJ(modifierStorage)) +{ + mTaskLaunch = PX_NEW(IofxManagerLaunchTask)(this); + + const uint32_t maxObjectCount = desc.maxObjectCount; + const uint32_t maxInStateCount = desc.maxInStateCount; + uint32_t usageClass = 0; + uint32_t blockSize = MAX_THREADS_PER_BLOCK; + + if (mManager.mIsMesh) + { + usageClass = ModifierUsage_Mesh; + //blockSize = CUDA_OBJ(meshModifiersKernel).getBlockDim().x; + } + else + { + usageClass = ModifierUsage_Sprite; + //blockSize = CUDA_OBJ(spriteModifiersKernel).getBlockDim().x; + } + + mCuSpawnScale.reserve(mManager.mOutStateOffset + maxObjectCount, ApexMirroredPlace::GPU); + mCuSpawnSeed.reserve(mManager.mOutStateOffset + maxObjectCount, ApexMirroredPlace::GPU); + + mCuSortedActorIDs.reserve(maxInStateCount, defaultPlace); + mCuSortedStateIDs.reserve(maxInStateCount, defaultPlace); + + mCuSortTempKeys.reserve(maxInStateCount, ApexMirroredPlace::GPU); + mCuSortTempValues.reserve(maxInStateCount, ApexMirroredPlace::GPU); + mCuSortTemp.reserve(MAX_BOUND_BLOCKS * NEW_SORT_KEY_DIGITS, ApexMirroredPlace::GPU); + + mCuTempMinBounds.reserve(WARP_SIZE * 2, ApexMirroredPlace::GPU); + mCuTempMaxBounds.reserve(WARP_SIZE * 2, ApexMirroredPlace::GPU); + mCuTempActorIDs.reserve(WARP_SIZE * 2, ApexMirroredPlace::GPU); + + // alloc volumeConstMem + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(mVolumeConstMemGroup) + + mVolumeParamsArrayHandle.alloc(_storage_); + mActorClassIDBitmapArrayHandle.alloc(_storage_); + } + + // alloc remapConstMem + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(mRemapConstMemGroup) + + mActorIDRemapArrayHandle.alloc(_storage_); + } + + // alloc modifierConstMem + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(mModifierConstMemGroup) + + mClientParamsHandleArrayHandle.alloc(_storage_); + + if (mManager.mIsMesh) + { + mMeshOutputLayoutHandle.alloc(_storage_); + } + else + { + mSpriteOutputLayoutHandle.alloc(_storage_); + } + } + + InitDevicePRNGs(scene, blockSize, mRandThreadLeap, mRandGridLeap, mCuBlockPRNGs); +} + +void IofxManagerGPU::release() +{ + delete this; +} + +IofxManagerGPU::~IofxManagerGPU() +{ + delete mTaskLaunch; +} + + +void IofxManagerGPU::submitTasks() +{ + mNumberActorClasses = mManager.mActorClassTable.size(); + mNumberVolumes = mManager.mVolumeTable.size(); + mCountActorIDs = mManager.mActorTable.size() * mNumberVolumes; + + // update volumeConstMem + if (mNumberVolumes) + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(mVolumeConstMemGroup) + + VolumeParamsArray volumeParamsArray; + _storage_.fetch(mVolumeParamsArrayHandle, volumeParamsArray); + volumeParamsArray.resize(_storage_, mNumberVolumes); + _storage_.update(mVolumeParamsArrayHandle, volumeParamsArray); + + + ActorClassIDBitmapArray actorClassIDBitmapArray; + _storage_.fetch(mActorClassIDBitmapArrayHandle, actorClassIDBitmapArray); + actorClassIDBitmapArray.resize(_storage_, mManager.mVolumeActorClassBitmap.size()); + _storage_.update(mActorClassIDBitmapArrayHandle, actorClassIDBitmapArray); + + actorClassIDBitmapArray.updateRange(_storage_, &mManager.mVolumeActorClassBitmap.front(), actorClassIDBitmapArray.getSize()); + + for (uint32_t i = 0 ; i < mNumberVolumes ; i++) + { + VolumeParams volumeParams; + IofxManager::VolumeData& vd = mManager.mVolumeTable[ i ]; + if (vd.vol) + { + volumeParams.bounds = vd.mBounds; + volumeParams.priority = vd.mPri; + } + else + { + volumeParams.bounds.setEmpty(); + volumeParams.priority = 0; + } + volumeParamsArray.updateElem(_storage_, volumeParams, i); + } + } + else + { + APEX_DEBUG_WARNING("IofxManager: There is no render volume!"); + } + + // update remapConstMem + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(mRemapConstMemGroup) + + ActorIDRemapArray actorIDRemapArray; + _storage_.fetch(mActorIDRemapArrayHandle, actorIDRemapArray); + actorIDRemapArray.resize(_storage_, mNumberActorClasses); + for (uint32_t i = 0 ; i < mNumberActorClasses ; ++i) + { + actorIDRemapArray.updateElem(_storage_, mManager.mActorClassTable[i].actorID, i); + } + _storage_.update(mActorIDRemapArrayHandle, actorIDRemapArray); + } + + // update modifierConstMem + { + APEX_CUDA_CONST_MEM_GROUP_SCOPE(mModifierConstMemGroup) + + ClientParamsHandleArray clientParamsHandleArray; + _storage_.fetch(mClientParamsHandleArrayHandle, clientParamsHandleArray); + clientParamsHandleArray.resize(_storage_, mNumberActorClasses); + for (uint32_t i = 0 ; i < mNumberActorClasses ; ++i) + { + InplaceHandle<ClientParams> clientParamsHandle; + IofxManagerClientGPU* clientGPU = static_cast<IofxManagerClientGPU*>(mManager.mActorClassTable[i].client); + if (clientGPU != NULL) + { + clientParamsHandle = clientGPU->getClientParamsHandle(); + } + clientParamsHandleArray.updateElem(_storage_, clientParamsHandle, i); + } + _storage_.update(mClientParamsHandleArrayHandle, clientParamsHandleArray); + + if (mManager.mIsMesh) + { + MeshOutputLayout meshOutputLayout; + + IosObjectGpuData* mWorkingData = DYNAMIC_CAST(IosObjectGpuData*)(mManager.mWorkingIosData); + IofxSharedRenderDataMeshImpl* meshRenderData = DYNAMIC_CAST(IofxSharedRenderDataMeshImpl*)(mWorkingData->renderData); + const IofxMeshRenderLayout& meshRenderLayout = meshRenderData->getRenderLayout(); + + mOutputDWords = meshRenderLayout.stride >> 2; + meshOutputLayout.stride = meshRenderLayout.stride; + ::memcpy(meshOutputLayout.offsets, meshRenderLayout.offsets, sizeof(meshOutputLayout.offsets)); + + _storage_.update(mMeshOutputLayoutHandle, meshOutputLayout); + } + else + { + SpriteOutputLayout spriteOutputLayout; + + IosObjectGpuData* mWorkingData = DYNAMIC_CAST(IosObjectGpuData*)(mManager.mWorkingIosData); + IofxSharedRenderDataSpriteImpl* spriteRenderData = DYNAMIC_CAST(IofxSharedRenderDataSpriteImpl*)(mWorkingData->renderData); + const IofxSpriteRenderLayout& spriteRenderLayout = spriteRenderData->getRenderLayout(); + + mOutputDWords = spriteRenderLayout.stride >> 2; + spriteOutputLayout.stride = spriteRenderLayout.stride; + ::memcpy(spriteOutputLayout.offsets, spriteRenderLayout.offsets, sizeof(spriteOutputLayout.offsets)); + + _storage_.update(mSpriteOutputLayoutHandle, spriteOutputLayout); + } + } + +} + + +#pragma warning(push) +#pragma warning(disable:4312) // conversion from 'CUdeviceptr' to 'uint32_t *' of greater size + +PxTaskID IofxManagerGPU::launchGpuTasks() +{ + PxTaskManager* tm = mIofxScene.mApexScene->getTaskManager(); + tm->submitUnnamedTask(*mTaskLaunch, PxTaskType::TT_GPU); + mTaskLaunch->finishBefore(mManager.mPostUpdateTaskID); + return mTaskLaunch->getTaskID(); +} + +void IofxManagerGPU::launchPrep() +{ + IosObjectGpuData* mWorkingData = DYNAMIC_CAST(IosObjectGpuData*)(mManager.mWorkingIosData); + + if (!mWorkingData->numParticles) + { + mEmptySimulation = true; + return; + } + + mCurSeed = static_cast<uint32_t>(mIofxScene.mApexScene->getSeed()); + + PxTaskManager* tm = mIofxScene.mApexScene->getTaskManager(); + PxCudaContextManager* ctx = tm->getGpuDispatcher()->getCudaContextManager(); + { + PxScopedCudaLock s(*ctx); + + mTargetTextureCount = 0; + mTargetBufDevPtr = 0; + if (!mManager.mIsMesh) + { + IofxSharedRenderDataSpriteImpl* spriteRenderData = DYNAMIC_CAST(IofxSharedRenderDataSpriteImpl*)(mWorkingData->renderData); + const IofxSpriteRenderLayout& spriteRenderLayout = spriteRenderData->getRenderLayout(); + + mTargetTextureCount = spriteRenderLayout.surfaceCount; + for( uint32_t i = 0; i < mTargetTextureCount; ++i ) + { + const CUarray cuArray = spriteRenderData->getSurfaceMappedCudaArray(i); + if (cuArray != NULL) + { + mTargetCudaArrayList[i].assign(cuArray, false); + } + else + { + CUarray_format format = CUarray_format(0); + uint32_t numChannels = 0; + switch (spriteRenderLayout.surfaceElements[i]) + { + case IofxSpriteRenderLayoutSurfaceElement::POSITION_FLOAT4: + case IofxSpriteRenderLayoutSurfaceElement::SCALE_ORIENT_SUBTEX_FLOAT4: + case IofxSpriteRenderLayoutSurfaceElement::COLOR_FLOAT4: + format = CU_AD_FORMAT_FLOAT; + numChannels = 4; + break; + case IofxSpriteRenderLayoutSurfaceElement::COLOR_RGBA8: + case IofxSpriteRenderLayoutSurfaceElement::COLOR_BGRA8: + format = CU_AD_FORMAT_UNSIGNED_INT32; + numChannels = 1; + default: + PX_ALWAYS_ASSERT(); + break; + } + const UserRenderSurfaceDesc& desc = spriteRenderLayout.surfaceDescs[i]; + mTargetCudaArrayList[i].create(format, numChannels, uint32_t(desc.width), uint32_t(desc.height), 0, true); + } + } + for( uint32_t i = mTargetTextureCount; i < IofxSpriteRenderLayout::MAX_SURFACE_COUNT; ++i ) { + mTargetCudaArrayList[i].release(); + } + } + + if (mTargetTextureCount == 0) + { + const CUdeviceptr cudaPtr = mWorkingData->renderData->getBufferMappedCudaPtr(); + if (cudaPtr != 0) + { + mTargetOutputBuffer.release(); + mTargetBufDevPtr = reinterpret_cast<uint32_t*>(cudaPtr); + } + else + { + const size_t size = mWorkingData->renderData->getRenderBufferSize(); + if (size > 0) + { + mTargetOutputBuffer.realloc(size, ctx); + mTargetBufDevPtr = static_cast<uint32_t*>( mTargetOutputBuffer.getGpuPtr() ); + } + } + } + } + + const uint32_t numActorIDValues = mCountActorIDs + 2; + mCuActorStart.setSize(numActorIDValues, ApexMirroredPlace::CPU_GPU); + mCuActorEnd.setSize(numActorIDValues, ApexMirroredPlace::CPU_GPU); + mCuActorVisibleEnd.setSize(numActorIDValues, ApexMirroredPlace::CPU_GPU); + mCuMinBounds.setSize(numActorIDValues, ApexMirroredPlace::CPU_GPU); + mCuMaxBounds.setSize(numActorIDValues, ApexMirroredPlace::CPU_GPU); + + mCuSortedActorIDs.setSize(mWorkingData->maxStateID, mDefaultPlace); + mCuSortedStateIDs.setSize(mWorkingData->maxStateID, mDefaultPlace); + + mManager.positionMass.setSize(mWorkingData->maxInputID, ApexMirroredPlace::CPU_GPU); + mManager.velocityLife.setSize(mWorkingData->maxInputID, ApexMirroredPlace::CPU_GPU); + mManager.actorIdentifiers.setSize(mWorkingData->maxInputID, ApexMirroredPlace::CPU_GPU); + mManager.inStateToInput.setSize(mWorkingData->maxStateID, ApexMirroredPlace::CPU_GPU); + mManager.outStateToInput.setSize(mWorkingData->numParticles, ApexMirroredPlace::CPU_GPU); + if (mWorkingData->iosSupportsCollision) + { + mManager.collisionNormalFlags.setSize(mWorkingData->maxInputID, ApexMirroredPlace::CPU_GPU); + } + if (mWorkingData->iosSupportsDensity) + { + mManager.density.setSize(mWorkingData->maxInputID, ApexMirroredPlace::CPU_GPU); + } + if (mWorkingData->iosSupportsUserData) + { + mManager.userData.setSize(mWorkingData->maxInputID, ApexMirroredPlace::CPU_GPU); + } + + mEmptySimulation = false; +} + +#pragma warning(pop) + + +/// +PX_INLINE uint32_t getHighestBitShift(uint32_t x) +{ + PX_ASSERT(isPowerOfTwo(x)); + return highestSetBit(x); +} + +void IofxManagerGPU::cudaLaunchRadixSort(CUstream stream, unsigned int numElements, unsigned int keyBits, unsigned int startBit, bool useSyncKernels) +{ + if (useSyncKernels) + { + //we use OLD Radix Sort on Tesla (SM < 2), because it is faster + CUDA_OBJ(radixSortSyncKernel)( + stream, numElements, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mCuSortTempKeys.getGpuPtr(), mCuSortTempValues.getGpuPtr(), + mCuSortTemp.getGpuPtr(), keyBits, startBit + ); + } + else + { +#if 1 + //NEW Radix Sort + unsigned int totalThreads = (numElements + NEW_SORT_VECTOR_SIZE - 1) / NEW_SORT_VECTOR_SIZE; + if (CUDA_OBJ(newRadixSortBlockKernel).isSingleBlock(totalThreads)) + { + //launch just a single block for small sizes + CUDA_OBJ(newRadixSortBlockKernel)( + stream, APEX_CUDA_SINGLE_BLOCK_LAUNCH, + numElements, keyBits, startBit, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr() + ); + } + else + { + for (unsigned int bit = startBit; bit < startBit + keyBits; bit += RADIX_SORT_NBITS) + { + uint32_t gridSize = + CUDA_OBJ(newRadixSortStepKernel)( + stream, totalThreads, + numElements, bit, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mCuSortTempKeys.getGpuPtr(), mCuSortTempValues.getGpuPtr(), + mCuSortTemp.getGpuPtr(), + 1, 0 + ); + + //launch just a single block + CUDA_OBJ(newRadixSortStepKernel)( + stream, APEX_CUDA_SINGLE_BLOCK_LAUNCH, + numElements, bit, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mCuSortTempKeys.getGpuPtr(), mCuSortTempValues.getGpuPtr(), + mCuSortTemp.getGpuPtr(), + 2, gridSize + ); + + CUDA_OBJ(newRadixSortStepKernel)( + stream, totalThreads, + numElements, bit, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mCuSortTempKeys.getGpuPtr(), mCuSortTempValues.getGpuPtr(), + mCuSortTemp.getGpuPtr(), + 3, 0 + ); + + mCuSortedActorIDs.swapGpuPtr(mCuSortTempKeys); + mCuSortedStateIDs.swapGpuPtr(mCuSortTempValues); + } + } +#else + //OLD Radix Sort + for (unsigned int startBit = 0; startBit < keyBits; startBit += RADIX_SORT_NBITS) + { + int gridSize = + CUDA_OBJ(radixSortStep1Kernel)( + stream, numElements, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mCuSortTempKeys.getGpuPtr(), mCuSortTempValues.getGpuPtr(), + mCuSortTemp.getGpuPtr(), startBit + ); + + //launch just 1 block + CUDA_OBJ(radixSortStep2Kernel)( + stream, CUDA_OBJ(radixSortStep2Kernel).getBlockDim().x, + mCuSortTemp.getGpuPtr(), gridSize + ); + + CUDA_OBJ(radixSortStep3Kernel)( + stream, numElements, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mCuSortTempKeys.getGpuPtr(), mCuSortTempValues.getGpuPtr(), + mCuSortTemp.getGpuPtr(), startBit + ); + } +#endif + } +} + +bool IofxManagerGPU::cudaLaunch(CUstream stream, int kernelIndex) +{ + PxTaskManager* tm = mIofxScene.mApexScene->getTaskManager(); + + if (mEmptySimulation) + { + return false; + } + + const uint32_t numActorIDValues = mCountActorIDs + 2; + //value < mCountActorIDs - valid particle with volume + //value == mCountActorIDs - homeless particle (no volume or invalid actor class) + //value == mCountActorIDs + 1 - NOT_A_PARTICLE + + + IofxSceneGPU* sceneGPU = static_cast<IofxSceneGPU*>(&mIofxScene); + bool useSyncKernels = !sceneGPU->getGpuDispatcher()->getCudaContextManager()->supportsArchSM20(); + + IosObjectGpuData* mWorkingData = DYNAMIC_CAST(IosObjectGpuData*)(mManager.mWorkingIosData); + + switch (kernelIndex) + { + case 0: + if (mManager.mOnStartCallback) + { + (*mManager.mOnStartCallback)(stream); + } + mCopyQueue.reset(stream, 24); + if (!mManager.mCudaIos && mWorkingData->maxInputID > 0) + { + mManager.positionMass.copyHostToDeviceQ(mCopyQueue); + mManager.velocityLife.copyHostToDeviceQ(mCopyQueue); + mManager.actorIdentifiers.copyHostToDeviceQ(mCopyQueue); + mManager.inStateToInput.copyHostToDeviceQ(mCopyQueue); + if (mWorkingData->iosSupportsCollision) + { + mManager.collisionNormalFlags.copyHostToDeviceQ(mCopyQueue); + } + if (mWorkingData->iosSupportsDensity) + { + mManager.density.copyHostToDeviceQ(mCopyQueue); + } + if (mWorkingData->iosSupportsUserData) + { + mManager.userData.copyHostToDeviceQ(mCopyQueue); + } + mCopyQueue.flushEnqueued(); + } + break; + + case 1: + /* Volume Migration (input space) */ + CUDA_OBJ(volumeMigrationKernel)(stream, + PxMax(mWorkingData->maxInputID, numActorIDValues), + mVolumeConstMemGroup.getStorage().mappedHandle(mVolumeParamsArrayHandle), + mVolumeConstMemGroup.getStorage().mappedHandle(mActorClassIDBitmapArrayHandle), + mNumberActorClasses, mNumberVolumes, numActorIDValues, + mManager.actorIdentifiers.getGpuPtr(), mWorkingData->maxInputID, + (const float4*)mManager.positionMass.getGpuPtr(), + mCuActorStart.getGpuPtr(), mCuActorEnd.getGpuPtr(), mCuActorVisibleEnd.getGpuPtr() + ); + break; + + case 2: + { + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefRemapPositions, mManager.positionMass) + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefRemapActorIDs, mManager.actorIdentifiers) + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefRemapInStateToInput, mManager.inStateToInput) + + /* if mDistanceSortingEnabled, sort on camera distance first, else directly make ActorID keys */ + CUDA_OBJ(makeSortKeys)(stream, mWorkingData->maxStateID, + mManager.inStateToInput.getGpuPtr(), mWorkingData->maxInputID, + mManager.mActorTable.size(), mCountActorIDs, + mRemapConstMemGroup.getStorage().mappedHandle(mActorIDRemapArrayHandle), + (const float4*)mManager.positionMass.getGpuPtr(), mManager.mDistanceSortingEnabled, + mWorkingData->eyePosition, mWorkingData->eyeDirection, mWorkingData->zNear, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr()); + + if (mManager.mDistanceSortingEnabled) + { + cudaLaunchRadixSort(stream, mWorkingData->maxStateID, 32, 0, useSyncKernels); + + /* Generate ActorID sort keys, using distance sorted stateID values */ + CUDA_OBJ(remapKernel)(stream, mWorkingData->maxStateID, + mManager.inStateToInput.getGpuPtr(), mWorkingData->maxInputID, + mManager.mActorTable.size(), mCountActorIDs, + mRemapConstMemGroup.getStorage().mappedHandle(mActorIDRemapArrayHandle), + mCuSortedStateIDs.getGpuPtr(), mCuSortedActorIDs.getGpuPtr()); + } + } + break; + + case 3: + /* ActorID Sort (output state space) */ + // input: mCuSortedActorIDs == actorIDs, in distance sorted order + // input: mCuSortedStateIDs == stateIDs, in distance sorted order + + // output: mCuSortedActorIDs == sorted ActorIDs + // output: mCuSortedStateIDs == output-to-input state + { + //SortedActorIDs could contain values from 0 to mCountActorIDs + 1 (included), + //so keybits should cover at least mCountActorIDs + 2 numbers + uint32_t keybits = 0; + while ((1U << keybits) < numActorIDValues) + { + ++keybits; + } + + cudaLaunchRadixSort(stream, mWorkingData->maxStateID, keybits, 0, useSyncKernels); + } + break; + + case 4: + /* Per-IOFX actor particle range detection */ + CUDA_OBJ(actorRangeKernel)(stream, mWorkingData->maxStateID, + mCuSortedActorIDs.getGpuPtr(), mCountActorIDs, + mCuActorStart.getGpuPtr(), mCuActorEnd.getGpuPtr(), mCuActorVisibleEnd.getGpuPtr(), + mCuSortedStateIDs.getGpuPtr() + ); + break; + + case 5: + /* Modifiers (output state space) */ + { + PX_PROFILE_ZONE("IofxManagerGPUModifiers", GetInternalApexSDK()->getContextId()); + ModifierCommonParams commonParams = mWorkingData->getCommonParams(); + + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefPositionMass, mManager.positionMass) + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefVelocityLife, mManager.velocityLife) + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefInStateToInput, mManager.inStateToInput) + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefStateSpawnSeed, mCuSpawnSeed) + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefStateSpawnScale, mCuSpawnScale) + + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefActorIDs, mManager.actorIdentifiers) + + if (mWorkingData->iosSupportsCollision) + { + CUDA_OBJ(texRefCollisionNormalFlags).bindTo(mManager.collisionNormalFlags); + } + if (mWorkingData->iosSupportsDensity) + { + CUDA_OBJ(texRefDensity).bindTo(mManager.density); + } + if (mWorkingData->iosSupportsUserData) + { + CUDA_OBJ(texRefUserData).bindTo(mManager.userData); + } + + PRNGInfo rand; + rand.g_stateSpawnSeed = mCuSpawnSeed.getGpuPtr(); + rand.g_randBlock = mCuBlockPRNGs.getGpuPtr(); + rand.randGrid = mRandGridLeap; + rand.randThread = mRandThreadLeap; + rand.seed = mCurSeed; + + if (mManager.mIsMesh) + { + // 3x3 matrix => 9 float scalars => 3 slices + + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefMeshPrivState0, *mManager.privState.slices[0]); + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefMeshPrivState1, *mManager.privState.slices[1]); + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefMeshPrivState2, *mManager.privState.slices[2]); + + MeshPrivateStateArgs meshPrivStateArgs; + meshPrivStateArgs.g_state[0] = mManager.privState.a[0]; + meshPrivStateArgs.g_state[1] = mManager.privState.a[1]; + meshPrivStateArgs.g_state[2] = mManager.privState.a[2]; + + CUDA_OBJ(meshModifiersKernel)(ApexKernelConfig(MAX_SMEM_BANKS * mOutputDWords, WARP_SIZE * PxMax<uint32_t>(mOutputDWords, 4)), + stream, mWorkingData->numParticles, + mManager.mInStateOffset, mManager.mOutStateOffset, + mModifierConstMemGroup.getStorage().mappedHandle(mClientParamsHandleArrayHandle), + commonParams, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mManager.outStateToInput.getGpuPtr(), + meshPrivStateArgs, mCuSpawnScale.getGpuPtr(), + rand, mTargetBufDevPtr, + mModifierConstMemGroup.getStorage().mappedHandle(mMeshOutputLayoutHandle) + ); + } + else + { + // 1 float scalar => 1 slice + + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefSpritePrivState0, *mManager.privState.slices[0]); + + SpritePrivateStateArgs spritePrivStateArgs; + spritePrivStateArgs.g_state[0] = mManager.privState.a[0]; + + IofxSharedRenderDataSpriteImpl* renderDataSprite = static_cast<IofxSharedRenderDataSpriteImpl*>(mWorkingData->renderData); + const IofxSpriteRenderLayout& spriteRenderLayout = renderDataSprite->getRenderLayout(); + + if (mTargetTextureCount > 0) + { + SpriteTextureOutputLayout outputLayout; + outputLayout.textureCount = mTargetTextureCount; + for (uint32_t i = 0; i < outputLayout.textureCount; ++i) + { + outputLayout.textureData[i].layout = static_cast<uint16_t>(spriteRenderLayout.surfaceElements[i]); + + uint32_t width = mTargetCudaArrayList[i].getWidth(); + //width should be a power of 2 and a multiply of WARP_SIZE + PX_ASSERT(isPowerOfTwo(width)); + PX_ASSERT((width & (WARP_SIZE - 1)) == 0); + outputLayout.textureData[i].widthShift = static_cast<uint8_t>(highestSetBit(width)); + + outputLayout.textureData[i].pitchShift = 0; //unused in GPU mode! + outputLayout.texturePtr[i] = NULL; //unused in GPU mode! + } + + if (0 < outputLayout.textureCount) APEX_CUDA_SURFACE_BIND(surfRefOutput0, mTargetCudaArrayList[0], ApexCudaMemFlags::OUT); + if (1 < outputLayout.textureCount) APEX_CUDA_SURFACE_BIND(surfRefOutput1, mTargetCudaArrayList[1], ApexCudaMemFlags::OUT); + if (2 < outputLayout.textureCount) APEX_CUDA_SURFACE_BIND(surfRefOutput2, mTargetCudaArrayList[2], ApexCudaMemFlags::OUT); + if (3 < outputLayout.textureCount) APEX_CUDA_SURFACE_BIND(surfRefOutput3, mTargetCudaArrayList[3], ApexCudaMemFlags::OUT); + + CUDA_OBJ(spriteTextureModifiersKernel)(stream, mWorkingData->numParticles, + mManager.mInStateOffset, mManager.mOutStateOffset, + mModifierConstMemGroup.getStorage().mappedHandle(mClientParamsHandleArrayHandle), + commonParams, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mManager.outStateToInput.getGpuPtr(), + spritePrivStateArgs, mCuSpawnScale.getGpuPtr(), + rand, outputLayout + ); + + if (0 < outputLayout.textureCount) APEX_CUDA_SURFACE_UNBIND(surfRefOutput0); + if (1 < outputLayout.textureCount) APEX_CUDA_SURFACE_UNBIND(surfRefOutput1); + if (2 < outputLayout.textureCount) APEX_CUDA_SURFACE_UNBIND(surfRefOutput2); + if (3 < outputLayout.textureCount) APEX_CUDA_SURFACE_UNBIND(surfRefOutput3); + } + else + { + CUDA_OBJ(spriteModifiersKernel)(ApexKernelConfig(MAX_SMEM_BANKS * mOutputDWords, WARP_SIZE * PxMax<uint32_t>(mOutputDWords, 4)), + stream, mWorkingData->numParticles, + mManager.mInStateOffset, mManager.mOutStateOffset, + mModifierConstMemGroup.getStorage().mappedHandle(mClientParamsHandleArrayHandle), + commonParams, + mCuSortedActorIDs.getGpuPtr(), mCuSortedStateIDs.getGpuPtr(), + mManager.outStateToInput.getGpuPtr(), + spritePrivStateArgs, mCuSpawnScale.getGpuPtr(), + rand, mTargetBufDevPtr, + mModifierConstMemGroup.getStorage().mappedHandle(mSpriteOutputLayoutHandle) + ); + } + } + + if (mWorkingData->iosSupportsCollision) + { + CUDA_OBJ(texRefCollisionNormalFlags).unbind(); + } + if (mWorkingData->iosSupportsDensity) + { + CUDA_OBJ(texRefDensity).unbind(); + } + if (mWorkingData->iosSupportsUserData) + { + CUDA_OBJ(texRefUserData).unbind(); + } + } + break; + + case 6: + if (mCountActorIDs > 0) + { + /* Per-IOFX actor BBox generation */ + APEX_CUDA_TEXTURE_SCOPE_BIND(texRefBBoxPositions, mManager.positionMass) + + if (useSyncKernels) + { + CUDA_OBJ(bboxSyncKernel)( + stream, mWorkingData->numParticles, + mCuSortedActorIDs.getGpuPtr(), + mManager.outStateToInput.getGpuPtr(), + (const float4*)mManager.positionMass.getGpuPtr(), + (float4*)mCuMinBounds.getGpuPtr(), (float4*)mCuMaxBounds.getGpuPtr(), + mCuTempActorIDs.getGpuPtr(), + (float4*)mCuTempMinBounds.getGpuPtr(), (float4*)mCuTempMaxBounds.getGpuPtr() + ); + } + else + { + uint32_t bboxGridSize = + CUDA_OBJ(bboxKernel)( + stream, mWorkingData->numParticles, + mCuSortedActorIDs.getGpuPtr(), + mManager.outStateToInput.getGpuPtr(), + (const float4*)mManager.positionMass.getGpuPtr(), + (float4*)mCuMinBounds.getGpuPtr(), (float4*)mCuMaxBounds.getGpuPtr(), + mCuTempActorIDs.getGpuPtr(), + (float4*)mCuTempMinBounds.getGpuPtr(), (float4*)mCuTempMaxBounds.getGpuPtr(), + 1, 0 + ); + + CUDA_OBJ(bboxKernel)( + stream, APEX_CUDA_SINGLE_BLOCK_LAUNCH, + mCuSortedActorIDs.getGpuPtr(), + mManager.outStateToInput.getGpuPtr(), + (const float4*)mManager.positionMass.getGpuPtr(), + (float4*)mCuMinBounds.getGpuPtr(), (float4*)mCuMaxBounds.getGpuPtr(), + mCuTempActorIDs.getGpuPtr(), + (float4*)mCuTempMinBounds.getGpuPtr(), (float4*)mCuTempMaxBounds.getGpuPtr(), + 2, bboxGridSize + ); + } + } + break; + + case 7: + if (mTargetTextureCount > 0) + { + IofxSharedRenderDataSpriteImpl* spriteRenderData = DYNAMIC_CAST(IofxSharedRenderDataSpriteImpl*)(mWorkingData->renderData); + PX_ASSERT(spriteRenderData->getRenderLayout().surfaceCount == mTargetTextureCount); + + for (uint32_t i = 0; i < mTargetTextureCount; ++i) + { + UserRenderSurface::MappedInfo mappedInfo; + if (spriteRenderData->getSurfaceMappedInfo(i, mappedInfo)) + { + const size_t surfaceWidth = spriteRenderData->getRenderLayout().surfaceDescs[i].width; + size_t copyHeight = (mWorkingData->numParticles + surfaceWidth - 1) / surfaceWidth; + mTargetCudaArrayList[i].copyToHost(stream, mappedInfo.pData, mappedInfo.rowPitch, 0, 0, copyHeight); + } + } + } + else + { + void* mappedPtr = mWorkingData->renderData->getBufferMappedPtr(); + if (mappedPtr) + { + size_t size = (mOutputDWords << 2) * mWorkingData->numParticles; + mTargetOutputBuffer.copyToHost(stream, mappedPtr, size); + } + } + if (mCountActorIDs > 0) + { + mCuMinBounds.copyDeviceToHostQ(mCopyQueue); + mCuMaxBounds.copyDeviceToHostQ(mCopyQueue); + } + mCuActorStart.copyDeviceToHostQ(mCopyQueue); + mCuActorEnd.copyDeviceToHostQ(mCopyQueue); + mCuActorVisibleEnd.copyDeviceToHostQ(mCopyQueue); + + + if (mCuSortedActorIDs.cpuPtrIsValid()) + { + mManager.inStateToInput.copyDeviceToHostQ(mCopyQueue); + mManager.actorIdentifiers.copyDeviceToHostQ(mCopyQueue); + mManager.outStateToInput.copyDeviceToHostQ(mCopyQueue); + mManager.positionMass.copyDeviceToHostQ(mCopyQueue); + + mCuSortedActorIDs.copyDeviceToHostQ(mCopyQueue); + mCuSortedStateIDs.copyDeviceToHostQ(mCopyQueue); + } + else if (!mManager.mCudaIos) + { + mManager.actorIdentifiers.copyDeviceToHostQ(mCopyQueue); + mManager.outStateToInput.copyDeviceToHostQ(mCopyQueue); + } + + mCopyQueue.flushEnqueued(); + + if (mManager.mOnFinishCallback) + { + (*mManager.mOnFinishCallback)(stream); + } + + tm->getGpuDispatcher()->addCompletionPrereq(*tm->getTaskFromID(mManager.mPostUpdateTaskID)); + return false; + + default: + PX_ALWAYS_ASSERT(); + return false; + } + + return true; +} + +void IofxManagerGPU::fetchResults() +{ + IosObjectGpuData* mWorkingData = DYNAMIC_CAST(IosObjectGpuData*)(mManager.mWorkingIosData); + PX_UNUSED(mWorkingData); + +#if 0 + { + ApexMirroredArray<uint32_t> actorID(*mIofxScene.mApexScene); + ApexMirroredArray<PxVec4> outMinBounds(*mIofxScene.mApexScene); + ApexMirroredArray<PxVec4> outMaxBounds(*mIofxScene.mApexScene); + ApexMirroredArray<PxVec4> outDebugInfo(*mIofxScene.mApexScene); + ApexMirroredArray<uint32_t> tmpLastActorID(*mIofxScene.mApexScene); + tmpLastActorID.setSize(64, ApexMirroredPlace::CPU_GPU); + + const uint32_t NE = 2000; + actorID.setSize(NE, ApexMirroredPlace::CPU_GPU); + + Array<uint32_t> actorCounts; + actorCounts.reserve(1000); + + uint32_t NA = 0; + for (uint32_t ie = 0; ie < NE; ++NA) + { + uint32_t num_ie = rand(1, 100); // We need to use QDSRand here s.t. seed could be preset during tests! + uint32_t next_ie = PxMin(ie + num_ie, NE); + + actorCounts.pushBack(next_ie - ie); + + for (; ie < next_ie; ++ie) + { + actorID[ie] = NA; + } + } + outMinBounds.setSize(NA, ApexMirroredPlace::CPU_GPU); + outMaxBounds.setSize(NA, ApexMirroredPlace::CPU_GPU); + outDebugInfo.setSize(NA, ApexMirroredPlace::CPU_GPU); + + for (uint32_t ia = 0; ia < NA; ++ia) + { + outMinBounds[ia].setZero(); + outMaxBounds[ia].setZero(); + } + + PxTaskManager* tm = mIofxScene.mApexScene->getTaskManager(); + PxCudaContextManager* ctx = tm->getGpuDispatcher()->getCudaContextManager(); + PxScopedCudaLock s(*ctx); + + mCopyQueue.reset(0, 4); + + actorID.copyHostToDeviceQ(mCopyQueue); + outMinBounds.copyHostToDeviceQ(mCopyQueue); + outMaxBounds.copyHostToDeviceQ(mCopyQueue); + mCopyQueue.flushEnqueued(); + + CUDA_OBJ(bboxKernel2)(0, NE, actorID.getGpuPtr(), NULL, 0, (float4*)outDebugInfo.getGpuPtr(), (float4*)outMinBounds.getGpuPtr(), (float4*)outMaxBounds.getGpuPtr()/*, tmpLastActorID.getGpuPtr()*/); + + outMinBounds.copyDeviceToHostQ(mCopyQueue); + outMaxBounds.copyDeviceToHostQ(mCopyQueue); + outDebugInfo.copyDeviceToHostQ(mCopyQueue); + tmpLastActorID.copyDeviceToHostQ(mCopyQueue); + mCopyQueue.flushEnqueued(); + + CUT_SAFE_CALL(cuCtxSynchronize()); + + uint32_t errors = 0; + float totCount = 0; + for (uint32_t ie = 0; ie < NE; ++ie) + { + uint32_t id = actorID[ie]; + if (ie == 0 || actorID[ie - 1] != id) + { + uint32_t count = actorCounts[id]; + const PxVec4& bounds = outMinBounds[id]; + if (bounds.x != count) + { + ++errors; + } + if (bounds.y != count * 2) + { + ++errors; + } + if (bounds.z != count * 3) + { + ++errors; + } + totCount += count; + } + } + + } +#endif + +#if 0 + { + PxTaskManager* tm = mIofxScene.mApexScene->getTaskManager(); + PxCudaContextManager* ctx = tm->getGpuDispatcher()->getCudaContextManager(); + + PxScopedCudaLock s(*ctx); + + CUT_SAFE_CALL(cuCtxSynchronize()); + } +#endif +#if DEBUG_GPU + { + nvidia::Array<int> valuesCounters(mWorkingData->maxStateID, 0); + uint32_t lastKey = uint32_t(-1); + for (uint32_t i = 0; i < mWorkingData->maxStateID; ++i) + { + uint32_t currKey = mCuSortedActorIDs.get(i); + PX_ASSERT(currKey < mCountActorIDs + 2); + if (lastKey != uint32_t(-1)) + { + PX_ASSERT(lastKey <= currKey); + } + if (lastKey != currKey) + { + if (mCuActorStart[currKey] != i) + { + int temp = 0; + temp++; + } + PX_ASSERT(mCuActorStart[currKey] == i); + if (lastKey != uint32_t(-1)) + { + if (mCuActorEnd[lastKey] != i) + { + int temp = 0; + temp++; + } + PX_ASSERT(mCuActorEnd[lastKey] == i); + } + } + lastKey = currKey; + + uint32_t currValue = (mCuSortedStateIDs.get(i) & STATE_ID_MASK); + PX_ASSERT(currValue < mWorkingData->maxStateID); + if (currValue < mWorkingData->maxStateID) + { + valuesCounters[currValue] += 1; + } + } + if (lastKey != uint32_t(-1)) + { + PX_ASSERT(mCuActorEnd[lastKey] == mWorkingData->maxStateID); + } + for (uint32_t i = 0; i < mWorkingData->maxStateID; ++i) + { + PX_ASSERT(valuesCounters[i] == 1); + } + } +#endif + + /* Swap input/output state offsets */ + mManager.swapStates(); + + if (mEmptySimulation) + { + for (uint32_t i = 0 ; i < mNumberVolumes ; i++) + { + IofxManager::VolumeData& d = mManager.mVolumeTable[ i ]; + if (d.vol == 0) + { + continue; + } + + for (uint32_t j = 0 ; j < mManager.mActorTable.size() ; j++) + { + IofxActorImpl* iofx = d.mActors[ j ]; + if (iofx && iofx != DEFERRED_IOFX_ACTOR) + { + iofx->mResultBounds.setEmpty(); + iofx->mResultRange.startIndex = 0; + iofx->mResultRange.objectCount = 0; + iofx->mResultVisibleCount = 0; + } + } + } + } + else + { + PX_ASSERT(mCuActorStart.cpuPtrIsValid() && mCuActorEnd.cpuPtrIsValid()); + if (!mCuActorStart.cpuPtrIsValid() || !mCuActorEnd.cpuPtrIsValid()) + { + // Workaround for issue seen by a customer + APEX_INTERNAL_ERROR("Bad cpuPtr in IofxManagerGPU::fetchResults"); + return; + } +#ifndef NDEBUG + //check Actor Ranges + { + uint32_t totalCount = 0; + //range with the last index (= mCountActorIDs) contains homeless particles! + for (uint32_t i = 0 ; i <= mCountActorIDs ; i++) + { + const uint32_t rangeStart = mCuActorStart[ i ]; + const uint32_t rangeEnd = mCuActorEnd[ i ]; + const uint32_t rangeVisibleEnd = mCuActorVisibleEnd[ i ]; + + PX_ASSERT(rangeStart < mWorkingData->numParticles); + PX_ASSERT(rangeEnd <= mWorkingData->numParticles); + PX_ASSERT(rangeStart <= rangeEnd); + PX_ASSERT(rangeStart <= rangeVisibleEnd && rangeVisibleEnd <= rangeEnd); + PX_UNUSED(rangeVisibleEnd); + + const uint32_t rangeCount = rangeEnd - rangeStart; + totalCount += rangeCount; + } + PX_ASSERT(totalCount == mWorkingData->numParticles); + } +#endif + + uint32_t aid = 0; + for (uint32_t i = 0 ; i < mNumberVolumes ; i++) + { + IofxManager::VolumeData& d = mManager.mVolumeTable[ i ]; + if (d.vol == 0) + { + aid += mManager.mActorTable.size(); + continue; + } + + for (uint32_t j = 0 ; j < mManager.mActorTable.size() ; j++) + { + const uint32_t rangeStart = mCuActorStart[ aid ]; + const uint32_t rangeEnd = mCuActorEnd[ aid ]; + const uint32_t rangeVisibleEnd = mCuActorVisibleEnd[ aid ]; + + const uint32_t rangeCount = rangeEnd - rangeStart; + const uint32_t visibleCount = rangeVisibleEnd - rangeStart; + + if (d.mActors[ j ] == DEFERRED_IOFX_ACTOR && mManager.mActorTable[ j ] != NULL && + (mIofxScene.mModule->mDeferredDisabled || rangeCount)) + { + IofxActorImpl* iofxActor = PX_NEW(IofxActorGPU)(mManager.mActorTable[j]->getRenderResID(), &mIofxScene, mManager); + if (d.vol->addIofxActor(*iofxActor)) + { + d.mActors[ j ] = iofxActor; + + mManager.initIofxActor(iofxActor, j, d.vol); + + // lock this renderable because the APEX scene will unlock it after this method is called + iofxActor->renderDataLock(); + } + else + { + iofxActor->release(); + } + } + + IofxActorImpl* iofxActor = d.mActors[ j ]; + if (iofxActor && iofxActor != DEFERRED_IOFX_ACTOR) + { + iofxActor->mResultBounds.setEmpty(); + if (rangeCount > 0) + { + iofxActor->mResultBounds.minimum = mCuMinBounds[ aid ].getXYZ(); + iofxActor->mResultBounds.maximum = mCuMaxBounds[ aid ].getXYZ(); + } + PX_ASSERT(iofxActor->mRenderBounds.isFinite()); + iofxActor->mResultRange.startIndex = rangeStart; + iofxActor->mResultRange.objectCount = rangeCount; + iofxActor->mResultVisibleCount = visibleCount; + } + + aid++; + } + } + } + +} + + +/** + * Called from render thread context, just before renderer calls update/dispatch on any IOFX + * actors. Map/Unmap render resources as required. "Mapped" means the graphics buffer has been + * mapped into our CUDA context where our kernels can write directly into it. + */ +void IofxManager::fillMapUnmapArraysForInterop(nvidia::Array<CUgraphicsResource> &toMapArray, nvidia::Array<CUgraphicsResource> &toUnmapArray) +{ + if (mInteropFlags == RenderInteropFlags::CUDA_INTEROP) + { + mResultIosData->renderData->fillMapUnmapArraysForInterop(toMapArray, toUnmapArray); + mStagingIosData->renderData->fillMapUnmapArraysForInterop(toMapArray, toUnmapArray); + } +} + + +void IofxManager::mapBufferResultsForInterop(bool mapSuccess, bool unmapSuccess) +{ + if (mInteropFlags == RenderInteropFlags::CUDA_INTEROP) + { + mResultIosData->renderData->mapBufferResultsForInterop(mapSuccess, unmapSuccess); + mStagingIosData->renderData->mapBufferResultsForInterop(mapSuccess, unmapSuccess); + } +} + +} +} // namespace nvidia + +#endif diff --git a/APEX_1.4/module/iofx/src/IofxRenderDataMesh.cpp b/APEX_1.4/module/iofx/src/IofxRenderDataMesh.cpp new file mode 100644 index 00000000..a3603f06 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxRenderDataMesh.cpp @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "IofxSceneCPU.h" +#include "IofxSceneGPU.h" +#include "IosObjectData.h" +#include "IofxRenderData.h" +#include "IofxActorImpl.h" + +namespace nvidia +{ +namespace iofx +{ + + + +bool IofxSharedRenderDataMeshImpl::createRenderLayout(IofxScene& iofxScene, uint32_t semantics, uint32_t maxObjectCount, RenderLayout_t& renderLayout) +{ + bool bIsUserDefinedLayout = false; + IofxRenderCallback* renderCallback = iofxScene.getIofxRenderCallback(); + if (renderCallback) + { + if (renderCallback->getIofxMeshRenderLayout(renderLayout, maxObjectCount, semantics, mInteropFlags)) + { + bIsUserDefinedLayout = renderLayout.isValid(); + } + } + if (!bIsUserDefinedLayout) + { + //make default layout for given set of semantics + uint32_t offset = 0; + { + IofxMeshRenderLayoutElement::Enum element = IofxMeshRenderLayoutElement::POSITION_FLOAT3; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxMeshRenderLayoutElement::getFormat(element)); + } + { + IofxMeshRenderLayoutElement::Enum element = IofxMeshRenderLayoutElement::ROTATION_SCALE_FLOAT3x3; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxMeshRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::COLOR)) + { + IofxMeshRenderLayoutElement::Enum element = IofxMeshRenderLayoutElement::COLOR_FLOAT4; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxMeshRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::DENSITY)) + { + IofxMeshRenderLayoutElement::Enum element = IofxMeshRenderLayoutElement::DENSITY_FLOAT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxMeshRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::USER_DATA)) + { + IofxMeshRenderLayoutElement::Enum element = IofxMeshRenderLayoutElement::USER_DATA_UINT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxMeshRenderLayoutElement::getFormat(element)); + } + renderLayout.stride = offset; + + renderLayout.bufferDesc.setDefaults(); + renderLayout.bufferDesc.size = maxObjectCount * renderLayout.stride; + renderLayout.bufferDesc.interopFlags = mInteropFlags; + } + PX_ASSERT((renderLayout.stride & 0x03) == 0); + return bIsUserDefinedLayout; +} + +void IofxSharedRenderDataMeshImpl::freeAllRenderStorage() +{ + if (mSharedRenderData.meshRenderBuffer != NULL) + { + mSharedRenderData.meshRenderBuffer->release(); + mSharedRenderData.meshRenderBuffer = NULL; + } +} + +bool IofxSharedRenderDataMeshImpl::allocAllRenderStorage(const RenderLayout_t& newRenderLayout, IofxRenderCallback* iofxRenderCallback) +{ + mSharedRenderData.meshRenderBuffer = iofxRenderCallback->createRenderBuffer(newRenderLayout.bufferDesc); + return (mSharedRenderData.meshRenderBuffer != NULL); +} + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/IofxRenderDataSprite.cpp b/APEX_1.4/module/iofx/src/IofxRenderDataSprite.cpp new file mode 100644 index 00000000..c2fb9318 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxRenderDataSprite.cpp @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "IofxSceneCPU.h" +#include "IofxSceneGPU.h" +#include "IosObjectData.h" +#include "IofxRenderData.h" +#include "IofxActorImpl.h" + +namespace nvidia +{ +namespace iofx +{ + +bool IofxSharedRenderDataSpriteImpl::createRenderLayout(IofxScene& iofxScene, uint32_t semantics, uint32_t maxObjectCount, RenderLayout_t& renderLayout) +{ + bool bIsUserDefinedLayout = false; + IofxRenderCallback* renderCallback = iofxScene.getIofxRenderCallback(); + if (renderCallback) + { + if (renderCallback->getIofxSpriteRenderLayout(renderLayout, maxObjectCount, semantics, mInteropFlags)) + { + bIsUserDefinedLayout = renderLayout.isValid(); + } + } + if (!bIsUserDefinedLayout) + { + uint32_t offset = 0; + if (semantics & (1 << IofxRenderSemantic::POSITION)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::POSITION_FLOAT3; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::COLOR)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::COLOR_FLOAT4; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::VELOCITY)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::VELOCITY_FLOAT3; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::SCALE)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::SCALE_FLOAT2; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::LIFE_REMAIN)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::LIFE_REMAIN_FLOAT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::DENSITY)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::DENSITY_FLOAT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::SUBTEXTURE)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::SUBTEXTURE_FLOAT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::ORIENTATION)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::ORIENTATION_FLOAT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + if (semantics & (1 << IofxRenderSemantic::USER_DATA)) + { + IofxSpriteRenderLayoutElement::Enum element = IofxSpriteRenderLayoutElement::USER_DATA_UINT1; + renderLayout.offsets[element] = offset; + offset += RenderDataFormat::getFormatDataSize(IofxSpriteRenderLayoutElement::getFormat(element)); + } + renderLayout.stride = offset; + renderLayout.surfaceCount = 0; + + renderLayout.bufferDesc.setDefaults(); + renderLayout.bufferDesc.size = maxObjectCount * renderLayout.stride; + renderLayout.bufferDesc.interopFlags = mInteropFlags; + } + PX_ASSERT((renderLayout.stride & 0x03) == 0); + return bIsUserDefinedLayout; +} + +void IofxSharedRenderDataSpriteImpl::freeAllRenderStorage() +{ + if (mSharedRenderData.spriteRenderBuffer != NULL) + { + mSharedRenderData.spriteRenderBuffer->release(); + mSharedRenderData.spriteRenderBuffer = NULL; + } + + for (uint32_t i = 0; i < IofxSpriteRenderLayout::MAX_SURFACE_COUNT; ++i) + { + if (mSharedRenderData.spriteRenderSurfaces[i] != NULL) + { + mSharedRenderData.spriteRenderSurfaces[i]->release(); + mSharedRenderData.spriteRenderSurfaces[i] = NULL; + } + } +} + +bool IofxSharedRenderDataSpriteImpl::allocAllRenderStorage(const RenderLayout_t& newRenderLayout, IofxRenderCallback* iofxRenderCallback) +{ + bool result = false; + if (newRenderLayout.surfaceCount > 0) + { + result = true; + for (uint32_t i = 0; result && i < newRenderLayout.surfaceCount; ++i) + { + mSharedRenderData.spriteRenderSurfaces[i] = iofxRenderCallback->createRenderSurface(newRenderLayout.surfaceDescs[i]); + result &= (mSharedRenderData.spriteRenderSurfaces[i] != NULL); + } + if (!result) + { + for (uint32_t i = 0; i < newRenderLayout.surfaceCount; ++i) + { + if (mSharedRenderData.spriteRenderSurfaces[i] != NULL) + { + mSharedRenderData.spriteRenderSurfaces[i]->release(); + mSharedRenderData.spriteRenderSurfaces[i] = NULL; + } + } + } + } + else + { + mSharedRenderData.spriteRenderBuffer = iofxRenderCallback->createRenderBuffer(newRenderLayout.bufferDesc); + result = (mSharedRenderData.spriteRenderBuffer != NULL); + } + return result; +} + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/IofxScene.cpp b/APEX_1.4/module/iofx/src/IofxScene.cpp new file mode 100644 index 00000000..400fca10 --- /dev/null +++ b/APEX_1.4/module/iofx/src/IofxScene.cpp @@ -0,0 +1,527 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "ApexUsingNamespace.h" +#include "ModuleIofxImpl.h" +#include "IofxSceneCPU.h" +#include "IofxSceneGPU.h" +#include "IofxAssetImpl.h" +#include "IofxActorImpl.h" +#include "IofxActorCPU.h" +#include "IofxDebugRenderParams.h" +#include "DebugRenderParams.h" +#include "RenderVolumeImpl.h" +#include "SceneIntl.h" +#include "ModulePerfScope.h" +#include "RenderDebugInterface.h" + +#if APEX_CUDA_SUPPORT +#include <cuda.h> +#include "ApexCutil.h" +#include "IofxActorGPU.h" + +#include "ApexCudaSource.h" +#endif + +#include "Lock.h" + +namespace nvidia +{ +namespace iofx +{ + +IofxRenderable* IofxRenderableIteratorImpl::findNextInActorList() +{ + for (; mActorIndex < mActorCount; ++mActorIndex) + { + IofxRenderable* result = mActorList[mActorIndex]->acquireRenderableReference(); + if (result != NULL) + { + return result; + } + } + mIofxScene.mLiveRenderVolumes[mVolumeIndex]->unlockIofxActorList(); + return NULL; +} + +IofxRenderable* IofxRenderableIteratorImpl::findFirstInNotEmptyVolume() +{ + for (; mVolumeIndex < mVolumeCount; ++mVolumeIndex) + { + mActorList = mIofxScene.mLiveRenderVolumes[mVolumeIndex]->lockIofxActorList(mActorCount); + mActorIndex = 0; + IofxRenderable* result = findNextInActorList(); + if (result != NULL) + { + return result; + } + } + mIofxScene.mLiveRenderVolumesLock.unlockReader(); + return NULL; +} + +IofxRenderable* IofxRenderableIteratorImpl::getFirst() +{ + mIofxScene.mLiveRenderVolumesLock.lockReader(); + mVolumeCount = mIofxScene.mLiveRenderVolumes.size(); + mVolumeIndex = 0; + return findFirstInNotEmptyVolume(); +} + +IofxRenderable* IofxRenderableIteratorImpl::getNext() +{ + if (mVolumeIndex < mVolumeCount) + { + PX_ASSERT(mActorIndex < mActorCount); + ++mActorIndex; + IofxRenderable* result = findNextInActorList(); + if (result != NULL) + { + return result; + } + ++mVolumeIndex; + return findFirstInNotEmptyVolume(); + } + return NULL; +} + + +static StatsInfo IOFXStatsData[] = +{ + {"IOFX: SimulatedSpriteParticlesCount", StatDataType::INT, {{0}} }, + {"IOFX: SimulatedMeshParticlesCount", StatDataType::INT, {{0}} } +}; + +IofxScene::IofxScene(ModuleIofxImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list) + : mModule(&module) + , mApexScene(&scene) + , mDebugRender(debugRender) + , mPrevTotalSimulatedSpriteParticles(0) + , mPrevTotalSimulatedMeshParticles(0) + , mRenderCallback(NULL) +{ + list.add(*this); // Add self to module's list of IofxScenes + + /* Initialize reference to IofxDebugRenderParams */ + { + WRITE_LOCK(*mApexScene); + mDebugRenderParams = DYNAMIC_CAST(DebugRenderParams*)(mApexScene->getDebugRenderParams()); + } + PX_ASSERT(mDebugRenderParams); + NvParameterized::Handle handle(*mDebugRenderParams), memberHandle(*mDebugRenderParams); + int size; + + if (mDebugRenderParams->getParameterHandle("moduleName", handle) == NvParameterized::ERROR_NONE) + { + handle.getArraySize(size, 0); + handle.resizeArray(size + 1); + if (handle.getChildHandle(size, memberHandle) == NvParameterized::ERROR_NONE) + { + memberHandle.initParamRef(IofxDebugRenderParams::staticClassName(), true); + } + } + + /* Load reference to IofxDebugRenderParams */ + NvParameterized::Interface* refPtr = NULL; + memberHandle.getParamRef(refPtr); + mIofxDebugRenderParams = DYNAMIC_CAST(IofxDebugRenderParams*)(refPtr); + PX_ASSERT(mIofxDebugRenderParams); + + createModuleStats(); +} + +IofxScene::~IofxScene() +{ + destroyModuleStats(); +} + +Module* IofxScene::getModule() +{ + return mModule; +} + +void IofxScene::release() +{ + mModule->releaseModuleSceneIntl(*this); +} + +IofxManager* IofxScene::createIofxManager(const IofxAsset& asset, const IofxManagerDescIntl& desc) +{ + mManagersLock.lockWriter(); + + IofxManager* iofxManager = PX_NEW(IofxManager)(*this, desc, asset.getMeshAssetCount() > 0); + + mManagersLock.unlockWriter(); + + return iofxManager; +} + +void IofxScene::releaseIofxManager(IofxManager* manager) +{ + mManagersLock.lockWriter(); + + manager->destroy(); + + mManagersLock.unlockWriter(); +} + +void IofxScene::createModuleStats(void) +{ + mModuleSceneStats.numApexStats = NumberOfStats; + mModuleSceneStats.ApexStatsInfoPtr = (StatsInfo*)PX_ALLOC(sizeof(StatsInfo) * NumberOfStats, PX_DEBUG_EXP("StatsInfo")); + + for (uint32_t i = 0; i < NumberOfStats; i++) + { + mModuleSceneStats.ApexStatsInfoPtr[i] = IOFXStatsData[i]; + } +} + +void IofxScene::destroyModuleStats(void) +{ + mModuleSceneStats.numApexStats = 0; + if (mModuleSceneStats.ApexStatsInfoPtr) + { + PX_FREE_AND_RESET(mModuleSceneStats.ApexStatsInfoPtr); + } +} + +void IofxScene::setStatValue(StatsDataEnum index, StatValue dataVal) +{ + if (mModuleSceneStats.ApexStatsInfoPtr) + { + mModuleSceneStats.ApexStatsInfoPtr[index].StatCurrentValue = dataVal; + } +} + +void IofxScene::visualize() +{ +#ifndef WITHOUT_DEBUG_VISUALIZE + if (!mIofxDebugRenderParams->VISUALIZE_IOFX_ACTOR) + { + return; + } + + PxMat44 cameraFacingPose((mApexScene->getViewMatrix(0)).inverseRT()); + + const physx::PxMat44& savedPose = *RENDER_DEBUG_IFACE(mDebugRender)->getPoseTyped(); + RENDER_DEBUG_IFACE(mDebugRender)->setIdentityPose(); + RENDER_DEBUG_IFACE(mDebugRender)->pushRenderState(); + RENDER_DEBUG_IFACE(mDebugRender)->setCurrentTextScale(3.0f); + + // iofx current bounding volume + // there is a bug with setting the color. it can change under certain circumstances. use default color for now + //RENDER_DEBUG_IFACE(mDebugRender)->setCurrentColor(RENDER_DEBUG_IFACE(mDebugRender)->getDebugColor(DebugColors::LightBlue)); + for (uint32_t i = 0 ; i < mActorArray.size() ; i++) + { + IofxActorImpl* actor = DYNAMIC_CAST(IofxActorImpl*)(mActorArray[ i ]); + if (mIofxDebugRenderParams->VISUALIZE_IOFX_ACTOR_NAME) + { + PxVec3 textLocation = actor->getBounds().maximum; + cameraFacingPose.setPosition(textLocation); + if(actor->getOwner() != NULL) + { + RENDER_DEBUG_IFACE(mDebugRender)->debugText(textLocation, " %s %s", actor->getOwner()->getObjTypeName(), actor->getOwner()->getName()); + } + } + if (mIofxDebugRenderParams->VISUALIZE_IOFX_BOUNDING_BOX) + { + RENDER_DEBUG_IFACE(mDebugRender)->debugBound(actor->getBounds()); + } + } + + // iofx max bounding volume + // there is a bug with setting the color. it can change under certain circumstances. use default color for now + //RENDER_DEBUG_IFACE(mDebugRender)->setCurrentColor(RENDER_DEBUG_IFACE(mDebugRender)->getDebugColor(DebugColors::Orange)); + mLiveRenderVolumesLock.lockReader(); + for (uint32_t i = 0 ; i < mLiveRenderVolumes.size() ; i++) + { + if (mIofxDebugRenderParams->VISUALIZE_IOFX_BOUNDING_BOX) + { + PxVec3 textLocation = mLiveRenderVolumes[i]->getOwnershipBounds().maximum; + cameraFacingPose.setPosition(textLocation); + RENDER_DEBUG_IFACE(mDebugRender)->debugText(textLocation, " Max Render Volume %d", i); + RENDER_DEBUG_IFACE(mDebugRender)->debugBound(mLiveRenderVolumes[i]->getOwnershipBounds()); + } + } + mLiveRenderVolumesLock.unlockReader(); + + RENDER_DEBUG_IFACE(mDebugRender)->setPose(savedPose); + RENDER_DEBUG_IFACE(mDebugRender)->popRenderState(); +#endif +} + +void IofxScene::destroy() +{ + removeAllActors(); + mApexScene->moduleReleased(*this); + + { + mLiveRenderVolumesLock.lockWriter(); + + /* Handle deferred insertions/deletions of ApexRenderVolumes */ + processDeferredRenderVolumes(); + + /* Delete all Live ApexRenderVolumes */ + for (uint32_t i = 0 ; i < mLiveRenderVolumes.size() ; i++) + { + RenderVolumeImpl* arv = mLiveRenderVolumes[ i ]; + PX_DELETE(arv); + } + mLiveRenderVolumes.clear(); + + mLiveRenderVolumesLock.unlockWriter(); + } + delete this; +} + +void IofxScene::setModulePhysXScene(PxScene* nxScene) +{ + if (nxScene) + { + for (uint32_t i = 0 ; i < mActorArray.size() ; i++) + { + IofxActorImpl* actor = DYNAMIC_CAST(IofxActorImpl*)(mActorArray[ i ]); + actor->setPhysXScene(nxScene); + } + } + else + { + for (uint32_t i = 0 ; i < mActorArray.size() ; i++) + { + IofxActorImpl* actor = DYNAMIC_CAST(IofxActorImpl*)(mActorArray[ i ]); + actor->setPhysXScene(NULL); + } + } + + mPhysXScene = nxScene; +} + +void IofxScene::processDeferredRenderVolumes() +{ + mAddedRenderVolumesLock.lock(); + while (mAddedRenderVolumes.size()) + { + RenderVolumeImpl* arv = mAddedRenderVolumes.popBack(); + mLiveRenderVolumes.pushBack(arv); + } + mAddedRenderVolumesLock.unlock(); + + mDeletedRenderVolumesLock.lock(); + while (mDeletedRenderVolumes.size()) + { + RenderVolumeImpl* arv = mDeletedRenderVolumes.popBack(); + mLiveRenderVolumes.findAndReplaceWithLast(arv); + PX_DELETE(arv); + } + mDeletedRenderVolumesLock.unlock(); +} + +void IofxScene::submitTasks(float /*elapsedTime*/, float /*substepSize*/, uint32_t /*numSubSteps*/) +{ + { + mLiveRenderVolumesLock.lockWriter(); + + /* Handle deferred insertions/deletions of ApexRenderVolumes */ + processDeferredRenderVolumes(); + + mLiveRenderVolumesLock.unlockWriter(); + } + + mManagersLock.lockReader(); + + //IofxManager::submitTasks reads mLiveRenderVolumes so we lock it here and unlock later + mLiveRenderVolumesLock.lockReader(); + for (uint32_t i = 0; i < mActorManagers.getSize(); ++i) + { + IofxManager* mgr = DYNAMIC_CAST(IofxManager*)(mActorManagers.getResource(i)); + mgr->submitTasks(); + } + mLiveRenderVolumesLock.unlockReader(); + + mManagersLock.unlockReader(); +} + +void IofxScene::fetchResults() +{ + mManagersLock.lockReader(); + + mFetchResultsLock.lock(); + + uint32_t totalSimulatedSpriteParticles = 0, + totalSimulatedMeshParticles = 0; + for (uint32_t i = 0; i < mActorManagers.getSize(); ++i) + { + IofxManager* mgr = DYNAMIC_CAST(IofxManager*)(mActorManagers.getResource(i)); + mgr->fetchResults(); + + if(mgr->isMesh()) + totalSimulatedMeshParticles += mgr->getSimulatedParticlesCount(); + else + totalSimulatedSpriteParticles += mgr->getSimulatedParticlesCount(); + } + + StatValue dataVal; + dataVal.Int = int32_t(totalSimulatedSpriteParticles - mPrevTotalSimulatedSpriteParticles); + setStatValue(SimulatedSpriteParticlesCount, dataVal); + mPrevTotalSimulatedSpriteParticles = totalSimulatedSpriteParticles; + dataVal.Int = int32_t(totalSimulatedMeshParticles - mPrevTotalSimulatedMeshParticles); + setStatValue(SimulatedMeshParticlesCount, dataVal); + mPrevTotalSimulatedMeshParticles = totalSimulatedMeshParticles; + + mFetchResultsLock.unlock(); + + mManagersLock.unlockReader(); +} + +void IofxScene::prepareRenderables() +{ + mManagersLock.lockReader(); + + lockLiveRenderVolumes(); + mFetchResultsLock.lock(); + + for (uint32_t i = 0; i < mActorManagers.getSize(); ++i) + { + IofxManager* mgr = DYNAMIC_CAST(IofxManager*)(mActorManagers.getResource(i)); + mgr->prepareRenderables(); + } + + mFetchResultsLock.unlock(); + unlockLiveRenderVolumes(); + + mManagersLock.unlockReader(); +} + + +void IofxScene::lockLiveRenderVolumes() +{ + mLiveRenderVolumesLock.lockReader(); + //for (uint32_t i = 0 ; i < mLiveRenderVolumes.size() ; i++) + //{ + // mLiveRenderVolumes[ i ]->lockReader(); + //} +} + +void IofxScene::unlockLiveRenderVolumes() +{ + //for (uint32_t i = 0 ; i < mLiveRenderVolumes.size() ; i++) + //{ + // mLiveRenderVolumes[ i ]->unlockReader(); + //} + mLiveRenderVolumesLock.unlockReader(); +} + +/******************************** CPU Version ********************************/ + +IofxSceneCPU::IofxSceneCPU(ModuleIofxImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list) + : IOFX_SCENE(module, scene, debugRender, list) +{ +} + +/******************************** GPU Version ********************************/ + +#if APEX_CUDA_SUPPORT +IofxSceneGPU::IofxSceneGPU(ModuleIofxImpl& module, SceneIntl& scene, RenderDebugInterface* debugRender, ResourceList& list) : + IOFX_SCENE(module, scene, debugRender, list), + CudaModuleScene(scene, *mModule, APEX_CUDA_TO_STR(APEX_CUDA_MODULE_PREFIX)), + mContextManager(scene.getTaskManager()->getGpuDispatcher()->getCudaContextManager()) +{ + PxGpuDispatcher* gd = scene.getTaskManager()->getGpuDispatcher(); + PX_ASSERT(gd != NULL); + PxScopedCudaLock _lock_(*gd->getCudaContextManager()); + +//CUDA module objects +#include "../cuda/include/moduleList.h" +} + +IofxSceneGPU::~IofxSceneGPU() +{ + PxScopedCudaLock s(*mContextManager); + CudaModuleScene::destroy(*mApexScene); +} + +void IofxSceneGPU::submitTasks(float elapsedTime, float substepSize, uint32_t numSubSteps) +{ + IofxScene::submitTasks(elapsedTime, substepSize, numSubSteps); + + { + PxScopedCudaLock _lock_(*mContextManager); + + APEX_CUDA_OBJ_NAME(migrationStorage).copyToDevice(mContextManager, 0); + APEX_CUDA_OBJ_NAME(remapStorage).copyToDevice(mContextManager, 0); + APEX_CUDA_OBJ_NAME(modifierStorage).copyToDevice(mContextManager, 0); + } +} + + +void IofxSceneGPU::prepareRenderables() +{ + mManagersLock.lockReader(); + + lockLiveRenderVolumes(); + mFetchResultsLock.lock(); + + for (uint32_t i = 0; i < mActorManagers.getSize(); ++i) + { + IofxManager* mgr = DYNAMIC_CAST(IofxManager*)(mActorManagers.getResource(i)); + mgr->prepareRenderables(); + } + + if (mContextManager->getInteropMode() != PxCudaInteropMode::NO_INTEROP) + { + mToMapArray.clear(); + mToUnmapArray.clear(); + + for (uint32_t i = 0; i < mActorManagers.getSize(); ++i) + { + IofxManager* mgr = DYNAMIC_CAST(IofxManager*)(mActorManagers.getResource(i)); + mgr->fillMapUnmapArraysForInterop(mToMapArray, mToUnmapArray); + } + + bool mapSuccess = true; + bool unmapSuccess = true; + { + PxScopedCudaLock s(*mContextManager); + + if (!mToMapArray.empty()) + { + for (uint32_t i = 0; i < mToMapArray.size(); ++i) + { + cuGraphicsResourceSetMapFlags( mToMapArray[i], CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD ); + } + CUresult res = cuGraphicsMapResources(mToMapArray.size(), &mToMapArray.front(), 0); + mapSuccess = (res == CUDA_SUCCESS || res == CUDA_ERROR_ALREADY_MAPPED); + } + if (!mToUnmapArray.empty()) + { + CUresult res = cuGraphicsUnmapResources(mToUnmapArray.size(), &mToUnmapArray.front(), 0); + unmapSuccess = (res == CUDA_SUCCESS || res == CUDA_ERROR_NOT_MAPPED); + } + } + + for (uint32_t i = 0; i < mActorManagers.getSize(); ++i) + { + IofxManager* mgr = DYNAMIC_CAST(IofxManager*)(mActorManagers.getResource(i)); + mgr->mapBufferResultsForInterop(mapSuccess, unmapSuccess); + } + } + + mFetchResultsLock.unlock(); + unlockLiveRenderVolumes(); + + mManagersLock.unlockReader(); +} + +#endif + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/ModifierCPU.cpp b/APEX_1.4/module/iofx/src/ModifierCPU.cpp new file mode 100644 index 00000000..572e8ac2 --- /dev/null +++ b/APEX_1.4/module/iofx/src/ModifierCPU.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "ModifierImpl.h" + +#pragma warning (disable : 4127) + +#include "ModifierData.h" + +namespace nvidia +{ +namespace apex +{ + +#define MODIFIER_DECL +#define CURVE_TYPE const nvidia::apex::Curve* +#define EVAL_CURVE(curve, value) curve->evaluate(value) +#define PARAMS_NAME(name) name ## ParamsCPU + +#include "ModifierSrc.h" + +#undef MODIFIER_DECL +#undef CURVE_TYPE +#undef EVAL_CURVE +#undef PARAMS_NAME + +} + +namespace iofx +{ + +#define _MODIFIER(name) \ + void name ## ModifierImpl :: mapParamsCPU(ModifierParamsMapperCPU& mapper) const \ + { \ + mapParams(mapper, (name ## ParamsCPU *)NULL); \ + } \ + +#define _MODIFIER_SPRITE(name) \ + void updateSprite_##name (const void* params, const SpriteInput& input, SpritePublicState& pubState, SpritePrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, false, ModifierUsage_Sprite> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + void updateSpriteOnSpawn_##name (const void* params, const SpriteInput& input, SpritePublicState& pubState, SpritePrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, true, ModifierUsage_Sprite> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + ModifierImpl::updateSpriteFunc name##ModifierImpl :: getUpdateSpriteFunc(ModifierStage stage) const \ + { \ + switch (stage) { \ + case ModifierStage_Spawn: return &updateSpriteOnSpawn_##name; \ + case ModifierStage_Continuous: return &updateSprite_##name; \ + default: \ + PX_ALWAYS_ASSERT(); \ + return 0; \ + } \ + } + +#define _MODIFIER_MESH(name) \ + void updateMesh_##name (const void* params, const MeshInput& input, MeshPublicState& pubState, MeshPrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, false, ModifierUsage_Mesh> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + void updateMeshOnSpawn_##name (const void* params, const MeshInput& input, MeshPublicState& pubState, MeshPrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, true, ModifierUsage_Mesh> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + ModifierImpl::updateMeshFunc name##ModifierImpl :: getUpdateMeshFunc(ModifierStage stage) const \ + { \ + switch (stage) { \ + case ModifierStage_Spawn: return &updateMeshOnSpawn_##name; \ + case ModifierStage_Continuous: return &updateMesh_##name; \ + default: \ + PX_ALWAYS_ASSERT(); \ + return 0; \ + } \ + } + +#include "ModifierList.h" + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/ModifierGPU.cpp b/APEX_1.4/module/iofx/src/ModifierGPU.cpp new file mode 100644 index 00000000..55cae513 --- /dev/null +++ b/APEX_1.4/module/iofx/src/ModifierGPU.cpp @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "ModifierImpl.h" + +#if APEX_CUDA_SUPPORT + +#include "ApexCudaWrapper.h" + +#include "ModifierData.h" + +namespace nvidia +{ +namespace apex +{ + +#define MODIFIER_DECL +#define CURVE_TYPE nvidia::iofx::Curve +#define EVAL_CURVE(curve, value) 0 +#define PARAMS_NAME(name) name ## ParamsGPU + +#include "ModifierSrc.h" + +#undef MODIFIER_DECL +#undef CURVE_TYPE +#undef EVAL_CURVE +//#undef PARAMS_NAME +} +namespace iofx +{ + +class ModifierParamsMapperGPU_Adapter +{ +private: + ModifierParamsMapperGPU_Adapter& operator=(const ModifierParamsMapperGPU_Adapter&); + + ModifierParamsMapperGPU& _mapper; + InplaceStorage& _storage; + uint8_t* _params; + +public: + ModifierParamsMapperGPU_Adapter(ModifierParamsMapperGPU& mapper) + : _mapper(mapper), _storage(mapper.getStorage()), _params(0) {} + + PX_INLINE InplaceStorage& getStorage() + { + return _storage; + } + + PX_INLINE void beginParams(void* params, size_t , size_t , uint32_t) + { + _params = (uint8_t*)params; + } + PX_INLINE void endParams() + { + _params = 0; + } + + template <typename T> + PX_INLINE void mapValue(size_t offset, T value) + { + PX_ASSERT(_params != 0); + *(T*)(_params + offset) = value; + } + + PX_INLINE void mapCurve(size_t offset, const nvidia::apex::Curve* nxCurve) + { + PX_ASSERT(_params != 0); + Curve& curve = *(Curve*)(_params + offset); + + uint32_t numPoints; + const Vec2R* nxPoints = nxCurve->getControlPoints(numPoints); + + curve.resize(_storage, numPoints); + for (uint32_t i = 0; i < numPoints; ++i) + { + const Vec2R& nxPoint = nxPoints[i]; + curve.setPoint(_storage, CurvePoint(nxPoint.x, nxPoint.y), i); + } + } +}; + +#define _MODIFIER(name) \ + void name ## ModifierImpl :: mapParamsGPU(ModifierParamsMapperGPU& mapper) const \ + { \ + ModifierParamsMapperGPU_Adapter adapter(mapper); \ + InplaceHandle< PARAMS_NAME(name) > paramsHandle; \ + paramsHandle.alloc( adapter.getStorage() ); \ + PARAMS_NAME(name) params; \ + mapParams( adapter, ¶ms ); \ + paramsHandle.update( adapter.getStorage(), params ); \ + mapper.onParams( paramsHandle, PARAMS_NAME(name)::RANDOM_COUNT ); \ + } \ + +#include "ModifierList.h" + +} +} // namespace nvidia + +#endif diff --git a/APEX_1.4/module/iofx/src/ModifierImpl.cpp b/APEX_1.4/module/iofx/src/ModifierImpl.cpp new file mode 100644 index 00000000..897364e7 --- /dev/null +++ b/APEX_1.4/module/iofx/src/ModifierImpl.cpp @@ -0,0 +1,415 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + + +#include "ModifierImpl.h" + +#include "ApexSDKHelpers.h" +#include "ApexSharedUtils.h" +//#include "ApexSharedSerialization.h" +#include "InstancedObjectSimulationIntl.h" +#include "IofxActor.h" +#include "ParamArray.h" +#include "IofxAssetImpl.h" + + +namespace nvidia +{ +namespace iofx +{ + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +RotationModifierImpl::RotationModifierImpl(RotationModifierParams* params) : + mParams(params), + mRollType(ApexMeshParticleRollType::SPHERICAL), + mRollAxis(0), + mRollSign(0), + mLastUpdateTime(0.0f) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("rollType", h); + setRollType((ApexMeshParticleRollType::Enum) h.parameterDefinition()->enumValIndex(mParams->rollType)); +} + +// ------------------------------------------------------------------------------------------------ +void RotationModifierImpl::setRollType(ApexMeshParticleRollType::Enum rollType) +{ + PX_ASSERT(rollType < ApexMeshParticleRollType::COUNT); + mRollType = rollType; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("rollType", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)rollType)); + + switch (mRollType) + { + default: + mRollSign = 1.0f; + mRollAxis = -1; + break; + case ApexMeshParticleRollType::FLAT_X: + mRollSign = 1.0f; + mRollAxis = 0; + break; + case ApexMeshParticleRollType::FLAT_Y: + mRollSign = 1.0f; + mRollAxis = 1; + break; + case ApexMeshParticleRollType::FLAT_Z: + mRollSign = 1.0f; + mRollAxis = 2; + break; + case ApexMeshParticleRollType::LONG_X: + mRollSign = -1.0f; + mRollAxis = 0; + break; + case ApexMeshParticleRollType::LONG_Y: + mRollSign = -1.0f; + mRollAxis = 1; + break; + case ApexMeshParticleRollType::LONG_Z: + mRollSign = -1.0f; + mRollAxis = 2; + break; + } +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +SimpleScaleModifierImpl::SimpleScaleModifierImpl(SimpleScaleModifierParams* params) : + mParams(params) +{ } + + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +RandomScaleModifierImpl::RandomScaleModifierImpl(RandomScaleModifierParams* param) : + mParams(param) +{ } + + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ScaleByMassModifierImpl::ScaleByMassModifierImpl(ScaleByMassModifierParams* params) : + mParams(params) +{ } + + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ColorVsLifeModifierImpl::ColorVsLifeModifierImpl(ColorVsLifeModifierParams* params) : + mParams(params) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("colorChannel", h); + + mColorChannel = (ColorChannel)(h.parameterDefinition()->enumValIndex(mParams->colorChannel)); + + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +// ------------------------------------------------------------------------------------------------ + +void ColorVsLifeModifierImpl::setColorChannel(ColorChannel colorChannel) +{ + mColorChannel = colorChannel; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("colorChannel", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)colorChannel)); +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ColorVsDensityModifierImpl::ColorVsDensityModifierImpl(ColorVsDensityModifierParams* params) : + mParams(params) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("colorChannel", h); + + mColorChannel = (ColorChannel)(h.parameterDefinition()->enumValIndex(mParams->colorChannel)); + + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +// ------------------------------------------------------------------------------------------------ + +void ColorVsDensityModifierImpl::setColorChannel(ColorChannel colorChannel) +{ + mColorChannel = colorChannel; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("colorChannel", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)colorChannel)); +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ColorVsVelocityModifierImpl::ColorVsVelocityModifierImpl(ColorVsVelocityModifierParams* params) : + mParams(params) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("colorChannel", h); + + mColorChannel = (ColorChannel)(h.parameterDefinition()->enumValIndex(mParams->colorChannel)); + + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +// ------------------------------------------------------------------------------------------------ + +void ColorVsVelocityModifierImpl::setColorChannel(ColorChannel colorChannel) +{ + mColorChannel = colorChannel; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("colorChannel", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)colorChannel)); +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +SubtextureVsLifeModifierImpl::SubtextureVsLifeModifierImpl(SubtextureVsLifeModifierParams* params) : + mParams(params) +{ + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +OrientAlongVelocityModifierImpl::OrientAlongVelocityModifierImpl(OrientAlongVelocityModifierParams* params) : + mParams(params) +{ } + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ScaleAlongVelocityModifierImpl::ScaleAlongVelocityModifierImpl(ScaleAlongVelocityModifierParams* params) : + mParams(params) +{ } + + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +RandomSubtextureModifierImpl::RandomSubtextureModifierImpl(RandomSubtextureModifierParams* params) : + mParams(params) +{} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +RandomRotationModifierImpl::RandomRotationModifierImpl(RandomRotationModifierParams* params) : + mParams(params) +{} + + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ScaleVsLifeModifierImpl::ScaleVsLifeModifierImpl(ScaleVsLifeModifierParams* params) : + mParams(params) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("scaleAxis", h); + + mScaleAxis = (ScaleAxis)(h.parameterDefinition()->enumValIndex(mParams->scaleAxis)); + + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +void ScaleVsLifeModifierImpl::setScaleAxis(ScaleAxis a) +{ + mScaleAxis = a; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("scaleAxis", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)a)); +} + + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ScaleVsDensityModifierImpl::ScaleVsDensityModifierImpl(ScaleVsDensityModifierParams* params) : + mParams(params) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("scaleAxis", h); + + mScaleAxis = (ScaleAxis)(h.parameterDefinition()->enumValIndex(mParams->scaleAxis)); + + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +void ScaleVsDensityModifierImpl::setScaleAxis(ScaleAxis a) +{ + mScaleAxis = a; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("scaleAxis", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)a)); +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +ScaleVsCameraDistanceModifierImpl::ScaleVsCameraDistanceModifierImpl(ScaleVsCameraDistanceModifierParams* params) : + mParams(params) +{ + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("scaleAxis", h); + + mScaleAxis = (ScaleAxis)(h.parameterDefinition()->enumValIndex(mParams->scaleAxis)); + + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +void ScaleVsCameraDistanceModifierImpl::setScaleAxis(ScaleAxis a) +{ + mScaleAxis = a; + + NvParameterized::Handle h(*mParams); + mParams->getParameterHandle("scaleAxis", h); + mParams->setParamEnum(h, h.parameterDefinition()->enumVal((int)a)); +} + + + +ViewDirectionSortingModifierImpl::ViewDirectionSortingModifierImpl(ViewDirectionSortingModifierParams* params) + : mParams(params) +{ +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +RotationRateModifierImpl::RotationRateModifierImpl(RotationRateModifierParams* params) : + mParams(params) +{ +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +RotationRateVsLifeModifierImpl::RotationRateVsLifeModifierImpl(RotationRateVsLifeModifierParams* params) : + mParams(params) +{ + //do this in the Curve constructor... (for inplace stuff) + ParamArray<Vec2R> cp(mParams, "controlPoints", (ParamDynamicArrayStruct*)&mParams->controlPoints); + for (uint32_t i = 0; i < cp.size(); i++) + { + mCurveFunction.addControlPoint(cp[i]); + } +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +OrientScaleAlongScreenVelocityModifierImpl::OrientScaleAlongScreenVelocityModifierImpl(OrientScaleAlongScreenVelocityModifierParams* params) : + mParams(params) +{ +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +Modifier* CreateModifier(ModifierTypeEnum modifierType, NvParameterized::Interface* objParam, NvParameterized::Handle& h) +{ + PX_UNUSED(objParam); + PX_ASSERT(objParam == h.getConstInterface()); + +#define _MODIFIER(Type) \ +case ModifierType_##Type: \ + h.initParamRef(#Type "ModifierParams", true); \ + h.getParamRef(refParam); \ + return PX_NEW(Type##ModifierImpl)((Type##ModifierParams*)refParam); \ + + NvParameterized::Interface* refParam = 0; + + // TODO: This should go to an actual factory which can be used to extend modifiers. + switch (modifierType) + { +#include "ModifierList.h" + + default: + PX_ALWAYS_ASSERT(); + } + return 0; +} + +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------------------------ + +const ModifierImpl* ModifierImpl::castFrom(const Modifier* modifier) +{ +#define _MODIFIER(Type) \ +case ModifierType_##Type: \ + return static_cast<const ModifierImpl*>( static_cast<const Type ## ModifierImpl *>(modifier) ); \ + + ModifierTypeEnum modifierType = modifier->getModifierType(); + switch (modifierType) + { +#include "ModifierList.h" + + default: + PX_ALWAYS_ASSERT(); + return 0; + } +} + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/ModuleIofxImpl.cpp b/APEX_1.4/module/iofx/src/ModuleIofxImpl.cpp new file mode 100644 index 00000000..95df8b7c --- /dev/null +++ b/APEX_1.4/module/iofx/src/ModuleIofxImpl.cpp @@ -0,0 +1,412 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" +#include "ApexUsingNamespace.h" +#include "ApexSDKIntl.h" +#include "ModuleIofxImpl.h" +#include "ModuleIofxRegistration.h" +#include "IofxAssetImpl.h" +#include "SceneIntl.h" +#include "PsMemoryBuffer.h" +#include "IofxSceneCPU.h" +#include "IofxSceneGPU.h" +#include "IofxActorImpl.h" +#include "RenderVolumeImpl.h" + +#include "ModulePerfScope.h" +using namespace iofx; + +#include "Lock.h" + +namespace nvidia +{ +namespace apex +{ + +#if defined(_USRDLL) + +/* Modules don't have to link against the framework, they keep their own */ +ApexSDKIntl* gApexSdk = 0; +ApexSDK* GetApexSDK() +{ + return gApexSdk; +} +ApexSDKIntl* GetInternalApexSDK() +{ + return gApexSdk; +} + +APEX_API Module* CALL_CONV createModule( + ApexSDKIntl* inSdk, + ModuleIntl** niRef, + uint32_t APEXsdkVersion, + uint32_t PhysXsdkVersion, + ApexCreateError* errorCode) +{ + if (APEXsdkVersion != APEX_SDK_VERSION) + { + if (errorCode) + { + *errorCode = APEX_CE_WRONG_VERSION; + } + return NULL; + } + + if (PhysXsdkVersion != PX_PHYSICS_VERSION) + { + if (errorCode) + { + *errorCode = APEX_CE_WRONG_VERSION; + } + return NULL; + } + + /* Setup common module global variables */ + gApexSdk = inSdk; + ModuleIofxImpl* impl = PX_NEW(ModuleIofx)(inSdk); + *niRef = (ModuleIntl*) impl; + return (Module*) impl; +} +#else +/* Statically linking entry function */ +void instantiateModuleIofx() +{ + ApexSDKIntl* sdk = GetInternalApexSDK(); + iofx::ModuleIofxImpl* impl = PX_NEW(iofx::ModuleIofxImpl)(sdk); + sdk->registerExternalModule((Module*) impl, (ModuleIntl*) impl); +} +#endif +} + +namespace iofx +{ +/* =================== ModuleIofxImpl =================== */ + + +AuthObjTypeID IofxAssetImpl::mAssetTypeID; +#ifdef WITHOUT_APEX_AUTHORING + +class IofxAssetDummyAuthoring : public AssetAuthoring, public UserAllocated +{ +public: + IofxAssetDummyAuthoring(ModuleIofxImpl* module, ResourceList& list, NvParameterized::Interface* params, const char* name) + { + PX_UNUSED(module); + PX_UNUSED(list); + PX_UNUSED(params); + PX_UNUSED(name); + } + + IofxAssetDummyAuthoring(ModuleIofxImpl* module, ResourceList& list, const char* name) + { + PX_UNUSED(module); + PX_UNUSED(list); + PX_UNUSED(name); + } + + IofxAssetDummyAuthoring(ModuleIofxImpl* module, ResourceList& list) + { + PX_UNUSED(module); + PX_UNUSED(list); + } + + virtual void setToolString(const char* /*toolName*/, const char* /*toolVersion*/, uint32_t /*toolChangelist*/) + { + + } + + + virtual void release() + { + destroy(); + } + + // internal + void destroy() + { + delete this; + } + + /** + * \brief Returns the name of this APEX authorable object type + */ + virtual const char* getObjTypeName() const + { + return IOFX_AUTHORING_TYPE_NAME; + } + + /** + * \brief Prepares a fully authored Asset Authoring object for a specified platform + */ + virtual bool prepareForPlatform(nvidia::apex::PlatformTag) + { + PX_ASSERT(0); + return false; + } + + const char* getName(void) const + { + return NULL; + } + + /** + * \brief Save asset's NvParameterized interface, may return NULL + */ + virtual NvParameterized::Interface* getNvParameterized() const + { + PX_ASSERT(0); + return NULL; + } + + virtual NvParameterized::Interface* releaseAndReturnNvParameterizedInterface(void) + { + PX_ALWAYS_ASSERT(); + return NULL; + } +}; + +typedef ApexAuthorableObject<ModuleIofxImpl, IofxAssetImpl, IofxAssetDummyAuthoring> IofxAO; + +#else +typedef ApexAuthorableObject<ModuleIofxImpl, IofxAssetImpl, IofxAssetAuthoringImpl> IofxAO; +#endif + +ModuleIofxImpl::ModuleIofxImpl(ApexSDKIntl* sdk) +{ + mSdk = sdk; + mApiProxy = this; + mName = "IOFX"; + mModuleParams = NULL; + mInteropDisabled = false; + mCudaDisabled = false; + mDeferredDisabled = false; + + /* Register this module's authorable object types and create their namespaces */ + const char* pName = IofxAssetParameters::staticClassName(); + IofxAO* AO = PX_NEW(IofxAO)(this, mAuthorableObjects, pName); + IofxAssetImpl::mAssetTypeID = AO->getResID(); + + /* Register the NvParameterized factories */ + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + ModuleIofxRegistration::invokeRegistration(traits); +} + +AuthObjTypeID ModuleIofxImpl::getModuleID() const +{ + READ_ZONE(); + return IofxAssetImpl::mAssetTypeID; +} + +ModuleIofxImpl::~ModuleIofxImpl() +{ +} + +void ModuleIofxImpl::destroy() +{ + /* Remove the NvParameterized factories */ + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + + if (mModuleParams) + { + mModuleParams->destroy(); + mModuleParams = NULL; + } + + ModuleBase::destroy(); + + if (traits) + { + ModuleIofxRegistration::invokeUnregistration(traits); + } + delete this; +} + +NvParameterized::Interface* ModuleIofxImpl::getDefaultModuleDesc() +{ + READ_ZONE(); + NvParameterized::Traits* traits = mSdk->getParameterizedTraits(); + + if (!mModuleParams) + { + mModuleParams = DYNAMIC_CAST(IofxModuleParameters*) + (traits->createNvParameterized("IofxModuleParameters")); + PX_ASSERT(mModuleParams); + } + else + { + mModuleParams->initDefaults(); + } + + return mModuleParams; +} + +void ModuleIofxImpl::init(const ModuleIofxDesc&) +{ + WRITE_ZONE(); +} + +uint32_t ModuleIofxImpl::forceLoadAssets() +{ + uint32_t loadedAssetCount = 0; + + for (uint32_t i = 0; i < mAuthorableObjects.getSize(); i++) + { + AuthorableObjectIntl* ao = static_cast<AuthorableObjectIntl*>(mAuthorableObjects.getResource(i)); + loadedAssetCount += ao->forceLoadAssets(); + } + return loadedAssetCount; +} + +ModuleSceneIntl* ModuleIofxImpl::createInternalModuleScene(SceneIntl& scene, RenderDebugInterface* debugRender) +{ + IofxScene* res = NULL; +#if APEX_CUDA_SUPPORT + PxGpuDispatcher* gd; + { + READ_LOCK(scene); + gd = scene.getTaskManager()->getGpuDispatcher(); + } + + if (gd && gd->getCudaContextManager()->contextIsValid()) + { + res = PX_NEW(IofxSceneGPU)(*this, scene, debugRender, mIofxScenes); + } + else +#endif + { + res = PX_NEW(IofxSceneCPU)(*this, scene, debugRender, mIofxScenes); + } + return res; +} + +void ModuleIofxImpl::releaseModuleSceneIntl(ModuleSceneIntl& scene) +{ + IofxScene* is = DYNAMIC_CAST(IofxScene*)(&scene); + is->destroy(); +} + +IofxScene* ModuleIofxImpl::getIofxScene(const Scene& apexScene) +{ + for (uint32_t i = 0 ; i < mIofxScenes.getSize() ; i++) + { + IofxScene* is = DYNAMIC_CAST(IofxScene*)(mIofxScenes.getResource(i)); + if (is->mApexScene == &apexScene) + { + return is; + } + } + + PX_ASSERT(!"Unable to locate an appropriate IofxScene"); + return NULL; +} + +const IofxScene* ModuleIofxImpl::getIofxScene(const Scene& apexScene) const +{ + for (uint32_t i = 0 ; i < mIofxScenes.getSize() ; i++) + { + IofxScene* is = DYNAMIC_CAST(IofxScene*)(mIofxScenes.getResource(i)); + if (is->mApexScene == &apexScene) + { + return is; + } + } + + PX_ASSERT(!"Unable to locate an appropriate IofxScene"); + return NULL; +} + +RenderVolume* ModuleIofxImpl::createRenderVolume(const Scene& apexScene, const PxBounds3& b, uint32_t priority, bool allIofx) +{ + WRITE_ZONE(); + IofxScene* is = getIofxScene(apexScene); + if (is) + { + return PX_NEW(RenderVolumeImpl)(*is, b, priority, allIofx); + } + + return NULL; +} + +void ModuleIofxImpl::releaseRenderVolume(RenderVolume& volume) +{ + WRITE_ZONE(); + RenderVolumeImpl* arv = DYNAMIC_CAST(RenderVolumeImpl*)(&volume); + arv->destroy(); +} + + +IofxManagerIntl* ModuleIofxImpl::createActorManager(const Scene& scene, const IofxAsset& asset, const IofxManagerDescIntl& desc) +{ + WRITE_ZONE(); + IofxScene* is = getIofxScene(scene); + return is ? is->createIofxManager(asset, desc) : NULL; +} + +const TestBase* ModuleIofxImpl::getTestBase(Scene* apexScene) const +{ +#if ENABLE_TEST + const IofxScene* scene = getIofxScene(*apexScene); + return static_cast<const TestBase*>(DYNAMIC_CAST(const IofxTestScene*)(scene)); +#else + PX_UNUSED(apexScene); + return 0; +#endif +} + +bool ModuleIofxImpl::setIofxRenderCallback(const Scene& apexScene, IofxRenderCallback* callback) +{ + WRITE_ZONE(); + IofxScene* is = getIofxScene(apexScene); + if (is) + { + is->setIofxRenderCallback(callback); + return true; + } + return false; +} + +IofxRenderCallback* ModuleIofxImpl::getIofxRenderCallback(const Scene& apexScene) const +{ + READ_ZONE(); + const IofxScene* is = getIofxScene(apexScene); + if (is) + { + return is->getIofxRenderCallback(); + } + return NULL; +} + +IofxRenderableIterator* ModuleIofxImpl::createIofxRenderableIterator(const Scene& apexScene) +{ + WRITE_ZONE(); + IofxScene* is = getIofxScene(apexScene); + if (is) + { + return is->createIofxRenderableIterator(); + } + + return NULL; +} + +void ModuleIofxImpl::prepareRenderables(const Scene& apexScene) +{ + WRITE_ZONE(); + URR_SCOPE; + IofxScene* is = getIofxScene(apexScene); + if (is) + { + is->prepareRenderables(); + } +} + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/RenderVolumeImpl.cpp b/APEX_1.4/module/iofx/src/RenderVolumeImpl.cpp new file mode 100644 index 00000000..4138d30e --- /dev/null +++ b/APEX_1.4/module/iofx/src/RenderVolumeImpl.cpp @@ -0,0 +1,168 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "Apex.h" + +#include "RenderVolumeImpl.h" +#include "ModuleIofxImpl.h" +#include "IofxAssetImpl.h" +#include "IofxActorImpl.h" +#include "IofxScene.h" +#include "SceneIntl.h" + +#include "PsArray.h" + +namespace nvidia +{ +namespace iofx +{ + +RenderVolumeImpl::RenderVolumeImpl(IofxScene& scene, const PxBounds3& b, uint32_t priority, bool allIofx) + : mPriority(priority) + , mAllIofx(allIofx) + , mPendingDelete(false) + , mScene(scene) +{ + setOwnershipBounds(b); + + mScene.mAddedRenderVolumesLock.lock(); + mScene.mAddedRenderVolumes.pushBack(this); + mScene.mAddedRenderVolumesLock.unlock(); +} + +RenderVolumeImpl::~RenderVolumeImpl() +{ + mLock.lockWriter(); + while (mIofxActors.size()) + { + IofxActor* iofx = mIofxActors.popBack(); + iofx->release(); + } + mLock.unlockWriter(); +} + +void RenderVolumeImpl::destroy() +{ + if (!mPendingDelete) + { + mPendingDelete = true; + + mScene.mDeletedRenderVolumesLock.lock(); + mScene.mDeletedRenderVolumes.pushBack(this); + mScene.mDeletedRenderVolumesLock.unlock(); + } +} + +void RenderVolumeImpl::release() +{ + if (!mPendingDelete) + { + mScene.mModule->releaseRenderVolume(*this); + } +} + +bool RenderVolumeImpl::addIofxAsset(IofxAsset& iofx) +{ + WRITE_ZONE(); + if (mAllIofx || mPendingDelete) + { + return false; + } + + mLock.lockWriter(); + mIofxAssets.pushBack(&iofx); + mLock.unlockWriter(); + return true; +} + +bool RenderVolumeImpl::addIofxActor(IofxActor& iofx) +{ + if (mPendingDelete) + { + return false; + } + + mLock.lockWriter(); + mIofxActors.pushBack(&iofx); + mLock.unlockWriter(); + return true; +} + +bool RenderVolumeImpl::removeIofxActor(const IofxActor& iofx) +{ + bool res = false; + mLock.lockWriter(); + for (uint32_t i = 0 ; i < mIofxActors.size() ; i++) + { + if (mIofxActors[ i ] == &iofx) + { + mIofxActors.replaceWithLast(i); + res = true; + break; + } + } + mLock.unlockWriter(); + return res; +} + +void RenderVolumeImpl::setPosition(const PxVec3& pos) +{ + WRITE_ZONE(); + PxVec3 ext = mOwnershipBounds.getExtents(); + mOwnershipBounds = physx::PxBounds3(pos - ext, pos + ext); +} + +PxBounds3 RenderVolumeImpl::getBounds() const +{ + READ_ZONE(); + if (mPendingDelete) + { + return PxBounds3::empty(); + } + + PxBounds3 b = PxBounds3::empty(); + nvidia::Array<IofxActor*>::ConstIterator i; + for (i = mIofxActors.begin() ; i != mIofxActors.end() ; i++) + { + b.include((*i)->getBounds()); + } + + return b; +} + +// Callers must acquire render lock for thread safety +bool RenderVolumeImpl::affectsIofxAsset(const IofxAsset& iofx) const +{ + READ_ZONE(); + if (mPendingDelete) + { + return false; + } + + if (mAllIofx) + { + return true; + } + + nvidia::Array<IofxAsset*>::ConstIterator i; + for (i = mIofxAssets.begin() ; i != mIofxAssets.end() ; i++) + { + if (&iofx == *i) + { + return true; + } + } + + return false; +} + +} +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsDensityCompositeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsDensityCompositeModifierParams.cpp new file mode 100644 index 00000000..aa12bd3b --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsDensityCompositeModifierParams.cpp @@ -0,0 +1,459 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsDensityCompositeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsDensityCompositeModifierParamsNS; + +const char* const ColorVsDensityCompositeModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsDensityCompositeModifierParams, ColorVsDensityCompositeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(colorDensityStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((colorDensityStruct_Type*)0)->density), NULL, 0 }, // controlPoints[].density + { TYPE_VEC4, false, (size_t)(&((colorDensityStruct_Type*)0)->color), NULL, 0 }, // controlPoints[].color +}; + + +bool ColorVsDensityCompositeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsDensityCompositeModifierParams::mBuiltFlagMutex; + +ColorVsDensityCompositeModifierParams::ColorVsDensityCompositeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsDensityCompositeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsDensityCompositeModifierParams::~ColorVsDensityCompositeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsDensityCompositeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsDensityCompositeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsDensityCompositeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsDensityCompositeModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsDensityCompositeModifierParams* tmpParam = const_cast<ColorVsDensityCompositeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsDensityCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsDensityCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsDensityCompositeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsDensityCompositeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsDensityCompositeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsDensityCompositeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsDensityComposite modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite color vs density curve", true); + HintTable[5].init("xAxisLabel", "Density", true); + HintTable[6].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "colorDensityStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite color vs density curve", true); + HintTable[5].init("xAxisLabel", "Density", true); + HintTable[6].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("density", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Density", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("color", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max", uint64_t(16), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max", uint64_t(16), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Color is formatted x=R, y=G, z=B, w=A", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsDensityCompositeModifierParams::initStrings(void) +{ +} + +void ColorVsDensityCompositeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(colorDensityStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsDensityCompositeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsDensityCompositeModifierParams::initReferences(void) +{ +} + +void ColorVsDensityCompositeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsDensityCompositeModifierParams::freeStrings(void) +{ +} + +void ColorVsDensityCompositeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsDensityModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsDensityModifierParams.cpp new file mode 100644 index 00000000..168f45c0 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsDensityModifierParams.cpp @@ -0,0 +1,478 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsDensityModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsDensityModifierParamsNS; + +const char* const ColorVsDensityModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsDensityModifierParams, ColorVsDensityModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->colorChannel), NULL, 0 }, // colorChannel + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ColorVsDensityModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsDensityModifierParams::mBuiltFlagMutex; + +ColorVsDensityModifierParams::ColorVsDensityModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsDensityModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsDensityModifierParams::~ColorVsDensityModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsDensityModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsDensityModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsDensityModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsDensityModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsDensityModifierParams* tmpParam = const_cast<ColorVsDensityModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsDensityModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsDensityModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsDensityModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsDensityModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsDensityModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsDensityModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsDensity modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="colorChannel" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("colorChannel", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "alpha", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "alpha", true); + HintTable[1].init("shortDescription", "Color channel", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "red", "green", "blue", "alpha" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[5].init("shortDescription", "Control points for a curve", true); + HintTable[6].init("xAxisLabel", "Density", true); + HintTable[7].init("yAxisLabel", "Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[5].init("shortDescription", "Control points for a curve", true); + HintTable[6].init("xAxisLabel", "Density", true); + HintTable[7].init("yAxisLabel", "Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Density", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsDensityModifierParams::initStrings(void) +{ +} + +void ColorVsDensityModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsDensityModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + colorChannel = (const char*)"alpha"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsDensityModifierParams::initReferences(void) +{ +} + +void ColorVsDensityModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsDensityModifierParams::freeStrings(void) +{ +} + +void ColorVsDensityModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsLifeCompositeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsLifeCompositeModifierParams.cpp new file mode 100644 index 00000000..fbd9c761 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsLifeCompositeModifierParams.cpp @@ -0,0 +1,471 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsLifeCompositeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsLifeCompositeModifierParamsNS; + +const char* const ColorVsLifeCompositeModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsLifeCompositeModifierParams, ColorVsLifeCompositeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(colorLifeStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((colorLifeStruct_Type*)0)->lifeRemaining), NULL, 0 }, // controlPoints[].lifeRemaining + { TYPE_VEC4, false, (size_t)(&((colorLifeStruct_Type*)0)->color), NULL, 0 }, // controlPoints[].color +}; + + +bool ColorVsLifeCompositeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsLifeCompositeModifierParams::mBuiltFlagMutex; + +ColorVsLifeCompositeModifierParams::ColorVsLifeCompositeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsLifeCompositeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsLifeCompositeModifierParams::~ColorVsLifeCompositeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsLifeCompositeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsLifeCompositeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsLifeCompositeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsLifeCompositeModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsLifeCompositeModifierParams* tmpParam = const_cast<ColorVsLifeCompositeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsLifeCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsLifeCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsLifeCompositeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsLifeCompositeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsLifeCompositeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsLifeCompositeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsLifeComposite modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Life Time", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite color vs life curve", true); + HintTable[5].init("xAxisLabel", "Life Time", true); + HintTable[6].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "colorLifeStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Life Time", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite color vs life curve", true); + HintTable[5].init("xAxisLabel", "Life Time", true); + HintTable[6].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].lifeRemaining" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("lifeRemaining", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Life remaining", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("color", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max_w", uint64_t(8), true); + HintTable[2].init("max_x", uint64_t(8), true); + HintTable[3].init("max_y", uint64_t(8), true); + HintTable[4].init("min_w", uint64_t(0), true); + HintTable[5].init("min_x", uint64_t(0), true); + HintTable[6].init("min_y", uint64_t(0), true); + HintTable[7].init("min_z", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#else + + static HintImpl HintTable[9]; + static Hint* HintPtrTable[9] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], &HintTable[8], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max_w", uint64_t(8), true); + HintTable[2].init("max_x", uint64_t(8), true); + HintTable[3].init("max_y", uint64_t(8), true); + HintTable[4].init("min_w", uint64_t(0), true); + HintTable[5].init("min_x", uint64_t(0), true); + HintTable[6].init("min_y", uint64_t(0), true); + HintTable[7].init("min_z", uint64_t(0), true); + HintTable[8].init("shortDescription", "Color is formatted x=R, y=G, z=B, w=A", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 9); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsLifeCompositeModifierParams::initStrings(void) +{ +} + +void ColorVsLifeCompositeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(colorLifeStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsLifeCompositeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsLifeCompositeModifierParams::initReferences(void) +{ +} + +void ColorVsLifeCompositeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsLifeCompositeModifierParams::freeStrings(void) +{ +} + +void ColorVsLifeCompositeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsLifeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsLifeModifierParams.cpp new file mode 100644 index 00000000..801c5209 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsLifeModifierParams.cpp @@ -0,0 +1,474 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsLifeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsLifeModifierParamsNS; + +const char* const ColorVsLifeModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsLifeModifierParams, ColorVsLifeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->colorChannel), NULL, 0 }, // colorChannel + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ColorVsLifeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsLifeModifierParams::mBuiltFlagMutex; + +ColorVsLifeModifierParams::ColorVsLifeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsLifeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsLifeModifierParams::~ColorVsLifeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsLifeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsLifeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsLifeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsLifeModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsLifeModifierParams* tmpParam = const_cast<ColorVsLifeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsLifeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsLifeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsLifeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsLifeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsLife modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="colorChannel" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("colorChannel", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "alpha", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "alpha", true); + HintTable[1].init("shortDescription", "Color channel", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "red", "green", "blue", "alpha" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Life Time", true); + HintTable[2].init("yAxisLabel", "Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Life Time", true); + HintTable[2].init("yAxisLabel", "Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Life", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsLifeModifierParams::initStrings(void) +{ +} + +void ColorVsLifeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsLifeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + colorChannel = (const char*)"alpha"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsLifeModifierParams::initReferences(void) +{ +} + +void ColorVsLifeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsLifeModifierParams::freeStrings(void) +{ +} + +void ColorVsLifeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsTemperatureCompositeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsTemperatureCompositeModifierParams.cpp new file mode 100644 index 00000000..388930f9 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsTemperatureCompositeModifierParams.cpp @@ -0,0 +1,455 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsTemperatureCompositeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsTemperatureCompositeModifierParamsNS; + +const char* const ColorVsTemperatureCompositeModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsTemperatureCompositeModifierParams, ColorVsTemperatureCompositeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(colorTemperatureStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((colorTemperatureStruct_Type*)0)->temperature), NULL, 0 }, // controlPoints[].temperature + { TYPE_VEC4, false, (size_t)(&((colorTemperatureStruct_Type*)0)->color), NULL, 0 }, // controlPoints[].color +}; + + +bool ColorVsTemperatureCompositeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsTemperatureCompositeModifierParams::mBuiltFlagMutex; + +ColorVsTemperatureCompositeModifierParams::ColorVsTemperatureCompositeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsTemperatureCompositeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsTemperatureCompositeModifierParams::~ColorVsTemperatureCompositeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsTemperatureCompositeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsTemperatureCompositeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsTemperatureCompositeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsTemperatureCompositeModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsTemperatureCompositeModifierParams* tmpParam = const_cast<ColorVsTemperatureCompositeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsTemperatureCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsTemperatureCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsTemperatureCompositeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsTemperatureCompositeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsTemperatureCompositeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsTemperatureCompositeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsTemperatureComposite modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite color vs Temperature curve", true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "colorTemperatureStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite color vs Temperature curve", true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].temperature" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("temperature", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Temperature", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("color", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max", uint64_t(16), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max", uint64_t(16), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Color is formatted x=R, y=G, z=B, w=A", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsTemperatureCompositeModifierParams::initStrings(void) +{ +} + +void ColorVsTemperatureCompositeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(colorTemperatureStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsTemperatureCompositeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsTemperatureCompositeModifierParams::initReferences(void) +{ +} + +void ColorVsTemperatureCompositeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsTemperatureCompositeModifierParams::freeStrings(void) +{ +} + +void ColorVsTemperatureCompositeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsTemperatureModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsTemperatureModifierParams.cpp new file mode 100644 index 00000000..3efec478 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsTemperatureModifierParams.cpp @@ -0,0 +1,478 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsTemperatureModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsTemperatureModifierParamsNS; + +const char* const ColorVsTemperatureModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsTemperatureModifierParams, ColorVsTemperatureModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->colorChannel), NULL, 0 }, // colorChannel + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ColorVsTemperatureModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsTemperatureModifierParams::mBuiltFlagMutex; + +ColorVsTemperatureModifierParams::ColorVsTemperatureModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsTemperatureModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsTemperatureModifierParams::~ColorVsTemperatureModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsTemperatureModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsTemperatureModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsTemperatureModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsTemperatureModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsTemperatureModifierParams* tmpParam = const_cast<ColorVsTemperatureModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsTemperatureModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsTemperatureModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsTemperatureModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsTemperatureModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsTemperatureModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsTemperatureModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsTemperature modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="colorChannel" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("colorChannel", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "alpha", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "alpha", true); + HintTable[1].init("shortDescription", "Color channel", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "red", "green", "blue", "alpha" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[5].init("shortDescription", "Control points for a curve", true); + HintTable[6].init("xAxisLabel", "Temperature", true); + HintTable[7].init("yAxisLabel", "Color", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[5].init("shortDescription", "Control points for a curve", true); + HintTable[6].init("xAxisLabel", "Temperature", true); + HintTable[7].init("yAxisLabel", "Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Temperature", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsTemperatureModifierParams::initStrings(void) +{ +} + +void ColorVsTemperatureModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsTemperatureModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + colorChannel = (const char*)"alpha"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsTemperatureModifierParams::initReferences(void) +{ +} + +void ColorVsTemperatureModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsTemperatureModifierParams::freeStrings(void) +{ +} + +void ColorVsTemperatureModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsVelocityCompositeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsVelocityCompositeModifierParams.cpp new file mode 100644 index 00000000..9745d6dc --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsVelocityCompositeModifierParams.cpp @@ -0,0 +1,533 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsVelocityCompositeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsVelocityCompositeModifierParamsNS; + +const char* const ColorVsVelocityCompositeModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsVelocityCompositeModifierParams, ColorVsVelocityCompositeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 7; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->velocity0), NULL, 0 }, // velocity0 + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->velocity1), NULL, 0 }, // velocity1 + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(3), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(colorVelocityStruct_Type), CHILDREN(4), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((colorVelocityStruct_Type*)0)->velocity), NULL, 0 }, // controlPoints[].velocity + { TYPE_VEC4, false, (size_t)(&((colorVelocityStruct_Type*)0)->color), NULL, 0 }, // controlPoints[].color +}; + + +bool ColorVsVelocityCompositeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsVelocityCompositeModifierParams::mBuiltFlagMutex; + +ColorVsVelocityCompositeModifierParams::ColorVsVelocityCompositeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsVelocityCompositeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsVelocityCompositeModifierParams::~ColorVsVelocityCompositeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsVelocityCompositeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsVelocityCompositeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsVelocityCompositeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsVelocityCompositeModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsVelocityCompositeModifierParams* tmpParam = const_cast<ColorVsVelocityCompositeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsVelocityCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsVelocityCompositeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsVelocityCompositeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsVelocityCompositeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsVelocityCompositeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsVelocityCompositeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsVelocityComposite modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="velocity0" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("velocity0", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "First velocity point", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="velocity1" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("velocity1", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("gameScale", "true", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("gameScale", "true", true); + HintTable[1].init("shortDescription", "Second velocity point", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Velocity", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite color vs velocity curve", true); + HintTable[5].init("xAxisLabel", "Velocity", true); + HintTable[6].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("controlPoints", TYPE_STRUCT, "colorVelocityStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Velocity", true); + HintTable[5].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(2), true); + HintTable[2].init("ColorWheel", "true", true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite color vs velocity curve", true); + HintTable[5].init("xAxisLabel", "Velocity", true); + HintTable[6].init("yAxisLabel", "Alpha + Color", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].velocity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("velocity", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Velocity", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="controlPoints[].color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("color", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max_w", uint64_t(8), true); + HintTable[2].init("max_x", uint64_t(8), true); + HintTable[3].init("max_y", uint64_t(8), true); + HintTable[4].init("min_w", uint64_t(0), true); + HintTable[5].init("min_x", uint64_t(0), true); + HintTable[6].init("min_y", uint64_t(0), true); + HintTable[7].init("min_z", uint64_t(0), true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#else + + static HintImpl HintTable[9]; + static Hint* HintPtrTable[9] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], &HintTable[8], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max_w", uint64_t(8), true); + HintTable[2].init("max_x", uint64_t(8), true); + HintTable[3].init("max_y", uint64_t(8), true); + HintTable[4].init("min_w", uint64_t(0), true); + HintTable[5].init("min_x", uint64_t(0), true); + HintTable[6].init("min_y", uint64_t(0), true); + HintTable[7].init("min_z", uint64_t(0), true); + HintTable[8].init("shortDescription", "Color is formatted x=R, y=G, z=B, w=A", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 9); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + + ParamDefTable[0].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(4); + + ParamDefTable[3].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=4, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(5); + Children[1] = PDEF_PTR(6); + + ParamDefTable[4].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsVelocityCompositeModifierParams::initStrings(void) +{ +} + +void ColorVsVelocityCompositeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(colorVelocityStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsVelocityCompositeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + velocity0 = float(0); + velocity1 = float(1); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsVelocityCompositeModifierParams::initReferences(void) +{ +} + +void ColorVsVelocityCompositeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsVelocityCompositeModifierParams::freeStrings(void) +{ +} + +void ColorVsVelocityCompositeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ColorVsVelocityModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ColorVsVelocityModifierParams.cpp new file mode 100644 index 00000000..5b593de8 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ColorVsVelocityModifierParams.cpp @@ -0,0 +1,524 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ColorVsVelocityModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ColorVsVelocityModifierParamsNS; + +const char* const ColorVsVelocityModifierParamsFactory::vptr = + NvParameterized::getVptr<ColorVsVelocityModifierParams, ColorVsVelocityModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 8; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, 7, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 4 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->colorChannel), NULL, 0 }, // colorChannel + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->velocity0), NULL, 0 }, // velocity0 + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->velocity1), NULL, 0 }, // velocity1 + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(4), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(5), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ColorVsVelocityModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ColorVsVelocityModifierParams::mBuiltFlagMutex; + +ColorVsVelocityModifierParams::ColorVsVelocityModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ColorVsVelocityModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ColorVsVelocityModifierParams::~ColorVsVelocityModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ColorVsVelocityModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ColorVsVelocityModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ColorVsVelocityModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ColorVsVelocityModifierParams::getParameterDefinitionTree(void) const +{ + ColorVsVelocityModifierParams* tmpParam = const_cast<ColorVsVelocityModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ColorVsVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ColorVsVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ColorVsVelocityModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ColorVsVelocityModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ColorVsVelocityModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ColorVsVelocityModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ColorVsVelocity modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="colorChannel" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("colorChannel", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "alpha", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "alpha", true); + HintTable[1].init("shortDescription", "Color channel", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "red", "green", "blue", "alpha" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 4); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="velocity0" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("velocity0", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Helpful documentation goes here", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="velocity1" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("velocity1", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Helpful documentation goes here", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Velocity", true); + HintTable[2].init("yAxisLabel", "Color", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Velocity", true); + HintTable[4].init("yAxisLabel", "Color", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Velocity", true); + HintTable[2].init("yAxisLabel", "Color", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Velocity", true); + HintTable[4].init("yAxisLabel", "Color", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Velocity", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Color", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[4]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + + ParamDefTable[0].setChildren(Children, 4); + } + + // SetChildren for: nodeIndex=4, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(5); + + ParamDefTable[4].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=5, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(6); + Children[1] = PDEF_PTR(7); + + ParamDefTable[5].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ColorVsVelocityModifierParams::initStrings(void) +{ +} + +void ColorVsVelocityModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ColorVsVelocityModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + colorChannel = (const char*)"alpha"; + velocity0 = float(0); + velocity1 = float(1); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ColorVsVelocityModifierParams::initReferences(void) +{ +} + +void ColorVsVelocityModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ColorVsVelocityModifierParams::freeStrings(void) +{ +} + +void ColorVsVelocityModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/InitialColorModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/InitialColorModifierParams.cpp new file mode 100644 index 00000000..58ca122d --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/InitialColorModifierParams.cpp @@ -0,0 +1,328 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "InitialColorModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace InitialColorModifierParamsNS; + +const char* const InitialColorModifierParamsFactory::vptr = + NvParameterized::getVptr<InitialColorModifierParams, InitialColorModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_VEC4, false, (size_t)(&((ParametersStruct*)0)->color), NULL, 0 }, // color +}; + + +bool InitialColorModifierParams::mBuiltFlag = false; +NvParameterized::MutexType InitialColorModifierParams::mBuiltFlagMutex; + +InitialColorModifierParams::InitialColorModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &InitialColorModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +InitialColorModifierParams::~InitialColorModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void InitialColorModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~InitialColorModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* InitialColorModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* InitialColorModifierParams::getParameterDefinitionTree(void) const +{ + InitialColorModifierParams* tmpParam = const_cast<InitialColorModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType InitialColorModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType InitialColorModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void InitialColorModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<InitialColorModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void InitialColorModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void InitialColorModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "InitialColor modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("color", TYPE_VEC4, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("COLOR", uint64_t(1), true); + HintTable[1].init("max", uint64_t(1), true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Color is formatted x=R, y=G, z=B, w=A", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void InitialColorModifierParams::initStrings(void) +{ +} + +void InitialColorModifierParams::initDynamicArrays(void) +{ +} + +void InitialColorModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + color = physx::PxVec4(initVec4(1, 1, 1, 1)); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void InitialColorModifierParams::initReferences(void) +{ +} + +void InitialColorModifierParams::freeDynamicArrays(void) +{ +} + +void InitialColorModifierParams::freeStrings(void) +{ +} + +void InitialColorModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/IofxAssetParameters.cpp b/APEX_1.4/module/iofx/src/autogen/IofxAssetParameters.cpp new file mode 100644 index 00000000..5d29be2d --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/IofxAssetParameters.cpp @@ -0,0 +1,425 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "IofxAssetParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace IofxAssetParametersNS; + +const char* const IofxAssetParametersFactory::vptr = + NvParameterized::getVptr<IofxAssetParameters, IofxAssetParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->iofxType), NULL, 0 }, // iofxType + { TYPE_STRUCT, false, (size_t)(&((ParametersStruct*)0)->renderOutput), CHILDREN(2), 2 }, // renderOutput + { TYPE_BOOL, false, (size_t)(&((outputProperties_Type*)0)->useUserSemantic), NULL, 0 }, // renderOutput.useUserSemantic + { TYPE_BOOL, false, (size_t)(&((outputProperties_Type*)0)->useFloat4Color), NULL, 0 }, // renderOutput.useFloat4Color +}; + + +bool IofxAssetParameters::mBuiltFlag = false; +NvParameterized::MutexType IofxAssetParameters::mBuiltFlagMutex; + +IofxAssetParameters::IofxAssetParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &IofxAssetParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +IofxAssetParameters::~IofxAssetParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void IofxAssetParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~IofxAssetParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* IofxAssetParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* IofxAssetParameters::getParameterDefinitionTree(void) const +{ + IofxAssetParameters* tmpParam = const_cast<IofxAssetParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType IofxAssetParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType IofxAssetParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void IofxAssetParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<IofxAssetParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void IofxAssetParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void IofxAssetParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Contains the asset properties for an IOFX", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="iofxType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("iofxType", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("shortDescription", "Contains the mesh or sprite IOFX parameters, only one may be selected", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "MeshIofxParameters", "SpriteIofxParameters" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="renderOutput" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("renderOutput", TYPE_STRUCT, "outputProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "render output properties", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="renderOutput.useUserSemantic" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("useUserSemantic", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "use user semantic in render output", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="renderOutput.useFloat4Color" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("useFloat4Color", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("HIDDEN", uint64_t(1), true); + HintTable[1].init("shortDescription", "use float4 color in render output", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="renderOutput" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void IofxAssetParameters::initStrings(void) +{ +} + +void IofxAssetParameters::initDynamicArrays(void) +{ +} + +void IofxAssetParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + renderOutput.useUserSemantic = bool(false); + renderOutput.useFloat4Color = bool(false); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void IofxAssetParameters::initReferences(void) +{ + iofxType = NULL; + +} + +void IofxAssetParameters::freeDynamicArrays(void) +{ +} + +void IofxAssetParameters::freeStrings(void) +{ +} + +void IofxAssetParameters::freeReferences(void) +{ + if (iofxType) + { + iofxType->destroy(); + } + +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/IofxDebugRenderParams.cpp b/APEX_1.4/module/iofx/src/autogen/IofxDebugRenderParams.cpp new file mode 100644 index 00000000..73271f70 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/IofxDebugRenderParams.cpp @@ -0,0 +1,358 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "IofxDebugRenderParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace IofxDebugRenderParamsNS; + +const char* const IofxDebugRenderParamsFactory::vptr = + NvParameterized::getVptr<IofxDebugRenderParams, IofxDebugRenderParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 4; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->VISUALIZE_IOFX_ACTOR), NULL, 0 }, // VISUALIZE_IOFX_ACTOR + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->VISUALIZE_IOFX_BOUNDING_BOX), NULL, 0 }, // VISUALIZE_IOFX_BOUNDING_BOX + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->VISUALIZE_IOFX_ACTOR_NAME), NULL, 0 }, // VISUALIZE_IOFX_ACTOR_NAME +}; + + +bool IofxDebugRenderParams::mBuiltFlag = false; +NvParameterized::MutexType IofxDebugRenderParams::mBuiltFlagMutex; + +IofxDebugRenderParams::IofxDebugRenderParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &IofxDebugRenderParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +IofxDebugRenderParams::~IofxDebugRenderParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void IofxDebugRenderParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~IofxDebugRenderParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* IofxDebugRenderParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* IofxDebugRenderParams::getParameterDefinitionTree(void) const +{ + IofxDebugRenderParams* tmpParam = const_cast<IofxDebugRenderParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType IofxDebugRenderParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType IofxDebugRenderParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void IofxDebugRenderParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<IofxDebugRenderParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void IofxDebugRenderParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void IofxDebugRenderParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="VISUALIZE_IOFX_ACTOR" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("VISUALIZE_IOFX_ACTOR", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Render IOFX actor in view window", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="VISUALIZE_IOFX_BOUNDING_BOX" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("VISUALIZE_IOFX_BOUNDING_BOX", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Render IOFX bounding box in view window", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="VISUALIZE_IOFX_ACTOR_NAME" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("VISUALIZE_IOFX_ACTOR_NAME", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Render IOFX actor name in view window", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + + ParamDefTable[0].setChildren(Children, 3); + } + + mBuiltFlag = true; + +} +void IofxDebugRenderParams::initStrings(void) +{ +} + +void IofxDebugRenderParams::initDynamicArrays(void) +{ +} + +void IofxDebugRenderParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + VISUALIZE_IOFX_ACTOR = bool(false); + VISUALIZE_IOFX_BOUNDING_BOX = bool(true); + VISUALIZE_IOFX_ACTOR_NAME = bool(true); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void IofxDebugRenderParams::initReferences(void) +{ +} + +void IofxDebugRenderParams::freeDynamicArrays(void) +{ +} + +void IofxDebugRenderParams::freeStrings(void) +{ +} + +void IofxDebugRenderParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/IofxModuleParameters.cpp b/APEX_1.4/module/iofx/src/autogen/IofxModuleParameters.cpp new file mode 100644 index 00000000..4bae7ae3 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/IofxModuleParameters.cpp @@ -0,0 +1,318 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "IofxModuleParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace IofxModuleParametersNS; + +const char* const IofxModuleParametersFactory::vptr = + NvParameterized::getVptr<IofxModuleParameters, IofxModuleParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_U32, false, (size_t)(&((ParametersStruct*)0)->unused), NULL, 0 }, // unused +}; + + +bool IofxModuleParameters::mBuiltFlag = false; +NvParameterized::MutexType IofxModuleParameters::mBuiltFlagMutex; + +IofxModuleParameters::IofxModuleParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &IofxModuleParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +IofxModuleParameters::~IofxModuleParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void IofxModuleParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~IofxModuleParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* IofxModuleParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* IofxModuleParameters::getParameterDefinitionTree(void) const +{ + IofxModuleParameters* tmpParam = const_cast<IofxModuleParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType IofxModuleParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType IofxModuleParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void IofxModuleParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<IofxModuleParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void IofxModuleParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void IofxModuleParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "This class is used for initializing the ModuleIofx.", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="unused" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("unused", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "No parameters necessary", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void IofxModuleParameters::initStrings(void) +{ +} + +void IofxModuleParameters::initDynamicArrays(void) +{ +} + +void IofxModuleParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + unused = uint32_t(0); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void IofxModuleParameters::initReferences(void) +{ +} + +void IofxModuleParameters::freeDynamicArrays(void) +{ +} + +void IofxModuleParameters::freeStrings(void) +{ +} + +void IofxModuleParameters::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/MeshIofxParameters.cpp b/APEX_1.4/module/iofx/src/autogen/MeshIofxParameters.cpp new file mode 100644 index 00000000..05fd8458 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/MeshIofxParameters.cpp @@ -0,0 +1,623 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "MeshIofxParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace MeshIofxParametersNS; + +const char* const MeshIofxParametersFactory::vptr = + NvParameterized::getVptr<MeshIofxParameters, MeshIofxParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 9; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 5, 7, 2, 3, 4, 6, 8, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->renderMeshList), CHILDREN(3), 1 }, // renderMeshList + { TYPE_STRUCT, false, 1 * sizeof(meshProperties_Type), CHILDREN(4), 2 }, // renderMeshList[] + { TYPE_REF, false, (size_t)(&((meshProperties_Type*)0)->meshAssetName), NULL, 0 }, // renderMeshList[].meshAssetName + { TYPE_U32, false, (size_t)(&((meshProperties_Type*)0)->weight), NULL, 0 }, // renderMeshList[].weight + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->spawnModifierList), CHILDREN(6), 1 }, // spawnModifierList + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // spawnModifierList[] + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->continuousModifierList), CHILDREN(7), 1 }, // continuousModifierList + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // continuousModifierList[] +}; + + +bool MeshIofxParameters::mBuiltFlag = false; +NvParameterized::MutexType MeshIofxParameters::mBuiltFlagMutex; + +MeshIofxParameters::MeshIofxParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &MeshIofxParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +MeshIofxParameters::~MeshIofxParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void MeshIofxParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~MeshIofxParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* MeshIofxParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* MeshIofxParameters::getParameterDefinitionTree(void) const +{ + MeshIofxParameters* tmpParam = const_cast<MeshIofxParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType MeshIofxParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType MeshIofxParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void MeshIofxParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<MeshIofxParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [1,0] - renderMeshList.meshAssetName */ +/* [0] - spawnModifierList (not an array of structs) */ +/* [0] - continuousModifierList (not an array of structs) */ + +void MeshIofxParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void MeshIofxParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="renderMeshList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("renderMeshList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An array of mesh asset names with their respective weights (if this is a render mesh IOFX)", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[2] = { 1, 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 2); + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="renderMeshList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("renderMeshList", TYPE_STRUCT, "meshProperties", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "An array of mesh asset names with their respective weights (if this is a render mesh IOFX)", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="renderMeshList[].meshAssetName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("meshAssetName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The render mesh asset name or opaque mesh name", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ApexRenderMesh", "ApexOpaqueMesh" }; + ParamDefTable[3].setRefVariantVals((const char**)RefVariantVals, 2); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="renderMeshList[].weight" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("weight", TYPE_U32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "The weight for this mesh (weighed against other meshes)", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="spawnModifierList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("spawnModifierList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("longDescription", "These modifiers are applied to the instanced objects at object creation.", true); + HintTable[2].init("shortDescription", "Spawn modifier list", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "RotationModifierParams", "SimpleScaleModifierParams", "RandomScaleModifierParams", "InitialColorModifierParams", "ScaleByMassModifierParams" }; + ParamDefTable[5].setRefVariantVals((const char**)RefVariantVals, 5); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="spawnModifierList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("spawnModifierList", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("INCLUDED", uint64_t(1), true); + HintTable[1].init("longDescription", "These modifiers are applied to the instanced objects at object creation.", true); + HintTable[2].init("shortDescription", "Spawn modifier list", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "RotationModifierParams", "SimpleScaleModifierParams", "RandomScaleModifierParams", "InitialColorModifierParams", "ScaleByMassModifierParams" }; + ParamDefTable[6].setRefVariantVals((const char**)RefVariantVals, 5); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=7, longName="continuousModifierList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[7]; + ParamDef->init("continuousModifierList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("HIDE_CLASS1", "ScaleVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ScaleVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsTemperatureModifierParams", true); + HintTable[4].init("INCLUDED", uint64_t(1), true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("HIDE_CLASS1", "ScaleVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ScaleVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsTemperatureModifierParams", true); + HintTable[4].init("INCLUDED", uint64_t(1), true); + HintTable[5].init("longDescription", "These modifiers are applied to the instanced objects every frame.", true); + HintTable[6].init("shortDescription", "Continuous modifier list", true); + ParamDefTable[7].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "RotationModifierParams", "ScaleVsLife3DModifierParams", "ScaleVsDensity3DModifierParams", "ScaleVsTemperature3DModifierParams", "ScaleVsCameraDistance3DModifierParams", "OrientAlongVelocityModifierParams", "ScaleAlongVelocityModifierParams", "ColorVsLifeCompositeModifierParams", "ColorVsDensityCompositeModifierParams", "ColorVsTemperatureCompositeModifierParams", "ScaleVsLifeModifierParams", "ScaleVsDensityModifierParams", "ScaleVsTemperatureModifierParams", "ScaleVsCameraDistanceModifierParams", "ColorVsVelocityCompositeModifierParams" }; + ParamDefTable[7].setRefVariantVals((const char**)RefVariantVals, 15); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=8, longName="continuousModifierList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[8]; + ParamDef->init("continuousModifierList", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("HIDE_CLASS1", "ScaleVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ScaleVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsTemperatureModifierParams", true); + HintTable[4].init("INCLUDED", uint64_t(1), true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("HIDE_CLASS1", "ScaleVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ScaleVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsTemperatureModifierParams", true); + HintTable[4].init("INCLUDED", uint64_t(1), true); + HintTable[5].init("longDescription", "These modifiers are applied to the instanced objects every frame.", true); + HintTable[6].init("shortDescription", "Continuous modifier list", true); + ParamDefTable[8].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "RotationModifierParams", "ScaleVsLife3DModifierParams", "ScaleVsDensity3DModifierParams", "ScaleVsTemperature3DModifierParams", "ScaleVsCameraDistance3DModifierParams", "OrientAlongVelocityModifierParams", "ScaleAlongVelocityModifierParams", "ColorVsLifeCompositeModifierParams", "ColorVsDensityCompositeModifierParams", "ColorVsTemperatureCompositeModifierParams", "ScaleVsLifeModifierParams", "ScaleVsDensityModifierParams", "ScaleVsTemperatureModifierParams", "ScaleVsCameraDistanceModifierParams", "ColorVsVelocityCompositeModifierParams" }; + ParamDefTable[8].setRefVariantVals((const char**)RefVariantVals, 15); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(5); + Children[2] = PDEF_PTR(7); + + ParamDefTable[0].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=1, longName="renderMeshList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="renderMeshList[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=5, longName="spawnModifierList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(6); + + ParamDefTable[5].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=7, longName="continuousModifierList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(8); + + ParamDefTable[7].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void MeshIofxParameters::initStrings(void) +{ +} + +void MeshIofxParameters::initDynamicArrays(void) +{ + renderMeshList.buf = NULL; + renderMeshList.isAllocated = true; + renderMeshList.elementSize = sizeof(meshProperties_Type); + renderMeshList.arraySizes[0] = 0; + spawnModifierList.buf = NULL; + spawnModifierList.isAllocated = true; + spawnModifierList.elementSize = sizeof(NvParameterized::Interface*); + spawnModifierList.arraySizes[0] = 0; + continuousModifierList.buf = NULL; + continuousModifierList.isAllocated = true; + continuousModifierList.elementSize = sizeof(NvParameterized::Interface*); + continuousModifierList.arraySizes[0] = 0; +} + +void MeshIofxParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void MeshIofxParameters::initReferences(void) +{ +} + +void MeshIofxParameters::freeDynamicArrays(void) +{ + if (renderMeshList.isAllocated && renderMeshList.buf) + { + mParameterizedTraits->free(renderMeshList.buf); + } + if (spawnModifierList.isAllocated && spawnModifierList.buf) + { + mParameterizedTraits->free(spawnModifierList.buf); + } + if (continuousModifierList.isAllocated && continuousModifierList.buf) + { + mParameterizedTraits->free(continuousModifierList.buf); + } +} + +void MeshIofxParameters::freeStrings(void) +{ +} + +void MeshIofxParameters::freeReferences(void) +{ + + for (int i = 0; i < renderMeshList.arraySizes[0]; i++) + { + if (renderMeshList.buf[i].meshAssetName) + { + renderMeshList.buf[i].meshAssetName->destroy(); + } + } + + for (int i = 0; i < spawnModifierList.arraySizes[0]; ++i) + { + if (spawnModifierList.buf[i]) + { + spawnModifierList.buf[i]->destroy(); + } + } + + for (int i = 0; i < continuousModifierList.arraySizes[0]; ++i) + { + if (continuousModifierList.buf[i]) + { + continuousModifierList.buf[i]->destroy(); + } + } +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/OrientAlongVelocityModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/OrientAlongVelocityModifierParams.cpp new file mode 100644 index 00000000..e2e456b5 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/OrientAlongVelocityModifierParams.cpp @@ -0,0 +1,318 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "OrientAlongVelocityModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace OrientAlongVelocityModifierParamsNS; + +const char* const OrientAlongVelocityModifierParamsFactory::vptr = + NvParameterized::getVptr<OrientAlongVelocityModifierParams, OrientAlongVelocityModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->modelForward), NULL, 0 }, // modelForward +}; + + +bool OrientAlongVelocityModifierParams::mBuiltFlag = false; +NvParameterized::MutexType OrientAlongVelocityModifierParams::mBuiltFlagMutex; + +OrientAlongVelocityModifierParams::OrientAlongVelocityModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &OrientAlongVelocityModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +OrientAlongVelocityModifierParams::~OrientAlongVelocityModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void OrientAlongVelocityModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~OrientAlongVelocityModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* OrientAlongVelocityModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* OrientAlongVelocityModifierParams::getParameterDefinitionTree(void) const +{ + OrientAlongVelocityModifierParams* tmpParam = const_cast<OrientAlongVelocityModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType OrientAlongVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType OrientAlongVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void OrientAlongVelocityModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<OrientAlongVelocityModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void OrientAlongVelocityModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void OrientAlongVelocityModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "OrientAlongVelocity modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="modelForward" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("modelForward", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Model forward", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void OrientAlongVelocityModifierParams::initStrings(void) +{ +} + +void OrientAlongVelocityModifierParams::initDynamicArrays(void) +{ +} + +void OrientAlongVelocityModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + modelForward = physx::PxVec3(init(0, 1, 0)); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void OrientAlongVelocityModifierParams::initReferences(void) +{ +} + +void OrientAlongVelocityModifierParams::freeDynamicArrays(void) +{ +} + +void OrientAlongVelocityModifierParams::freeStrings(void) +{ +} + +void OrientAlongVelocityModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/OrientScaleAlongScreenVelocityModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/OrientScaleAlongScreenVelocityModifierParams.cpp new file mode 100644 index 00000000..e18ecf54 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/OrientScaleAlongScreenVelocityModifierParams.cpp @@ -0,0 +1,395 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "OrientScaleAlongScreenVelocityModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace OrientScaleAlongScreenVelocityModifierParamsNS; + +const char* const OrientScaleAlongScreenVelocityModifierParamsFactory::vptr = + NvParameterized::getVptr<OrientScaleAlongScreenVelocityModifierParams, OrientScaleAlongScreenVelocityModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 4; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->scalePerVelocity), NULL, 0 }, // scalePerVelocity + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->scaleChangeLimit), NULL, 0 }, // scaleChangeLimit + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->scaleChangeDelay), NULL, 0 }, // scaleChangeDelay +}; + + +bool OrientScaleAlongScreenVelocityModifierParams::mBuiltFlag = false; +NvParameterized::MutexType OrientScaleAlongScreenVelocityModifierParams::mBuiltFlagMutex; + +OrientScaleAlongScreenVelocityModifierParams::OrientScaleAlongScreenVelocityModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &OrientScaleAlongScreenVelocityModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +OrientScaleAlongScreenVelocityModifierParams::~OrientScaleAlongScreenVelocityModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void OrientScaleAlongScreenVelocityModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~OrientScaleAlongScreenVelocityModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* OrientScaleAlongScreenVelocityModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* OrientScaleAlongScreenVelocityModifierParams::getParameterDefinitionTree(void) const +{ + OrientScaleAlongScreenVelocityModifierParams* tmpParam = const_cast<OrientScaleAlongScreenVelocityModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType OrientScaleAlongScreenVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType OrientScaleAlongScreenVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void OrientScaleAlongScreenVelocityModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<OrientScaleAlongScreenVelocityModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void OrientScaleAlongScreenVelocityModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void OrientScaleAlongScreenVelocityModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "OrientScaleAlongScreenVelocity modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scalePerVelocity" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scalePerVelocity", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "Scale(Velocity) = 1 + |Velocity| * scalePerVelocity", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Scale per velocity", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="scaleChangeLimit" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("scaleChangeLimit", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "This value limits the scale change per unit time, set to 0 to disable the limit", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Scale change limimt", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="scaleChangeDelay" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("scaleChangeDelay", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("longDescription", "This value is proportional to a delay in time of the scale change, set to 0 to disable the delay", true); + HintTable[2].init("min", uint64_t(0), true); + HintTable[3].init("shortDescription", "Scale change delay", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + + ParamDefTable[0].setChildren(Children, 3); + } + + mBuiltFlag = true; + +} +void OrientScaleAlongScreenVelocityModifierParams::initStrings(void) +{ +} + +void OrientScaleAlongScreenVelocityModifierParams::initDynamicArrays(void) +{ +} + +void OrientScaleAlongScreenVelocityModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scalePerVelocity = float(0.0f); + scaleChangeLimit = float(0.0f); + scaleChangeDelay = float(0.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void OrientScaleAlongScreenVelocityModifierParams::initReferences(void) +{ +} + +void OrientScaleAlongScreenVelocityModifierParams::freeDynamicArrays(void) +{ +} + +void OrientScaleAlongScreenVelocityModifierParams::freeStrings(void) +{ +} + +void OrientScaleAlongScreenVelocityModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/RandomRotationModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/RandomRotationModifierParams.cpp new file mode 100644 index 00000000..0f0fe9d5 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/RandomRotationModifierParams.cpp @@ -0,0 +1,355 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "RandomRotationModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace RandomRotationModifierParamsNS; + +const char* const RandomRotationModifierParamsFactory::vptr = + NvParameterized::getVptr<RandomRotationModifierParams, RandomRotationModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 3; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->minRotation), NULL, 0 }, // minRotation + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->maxRotation), NULL, 0 }, // maxRotation +}; + + +bool RandomRotationModifierParams::mBuiltFlag = false; +NvParameterized::MutexType RandomRotationModifierParams::mBuiltFlagMutex; + +RandomRotationModifierParams::RandomRotationModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RandomRotationModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RandomRotationModifierParams::~RandomRotationModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RandomRotationModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~RandomRotationModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RandomRotationModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RandomRotationModifierParams::getParameterDefinitionTree(void) const +{ + RandomRotationModifierParams* tmpParam = const_cast<RandomRotationModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RandomRotationModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType RandomRotationModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void RandomRotationModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RandomRotationModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RandomRotationModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void RandomRotationModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "RandomRotation modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="minRotation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("minRotation", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Minimum rotation in degrees", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="maxRotation" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("maxRotation", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Maximum rotation in degrees", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void RandomRotationModifierParams::initStrings(void) +{ +} + +void RandomRotationModifierParams::initDynamicArrays(void) +{ +} + +void RandomRotationModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + minRotation = float(0.0f); + maxRotation = float(0.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RandomRotationModifierParams::initReferences(void) +{ +} + +void RandomRotationModifierParams::freeDynamicArrays(void) +{ +} + +void RandomRotationModifierParams::freeStrings(void) +{ +} + +void RandomRotationModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/RandomScaleModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/RandomScaleModifierParams.cpp new file mode 100644 index 00000000..9403c5a3 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/RandomScaleModifierParams.cpp @@ -0,0 +1,355 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "RandomScaleModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace RandomScaleModifierParamsNS; + +const char* const RandomScaleModifierParamsFactory::vptr = + NvParameterized::getVptr<RandomScaleModifierParams, RandomScaleModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 3; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->minScaleFactor), NULL, 0 }, // minScaleFactor + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->maxScaleFactor), NULL, 0 }, // maxScaleFactor +}; + + +bool RandomScaleModifierParams::mBuiltFlag = false; +NvParameterized::MutexType RandomScaleModifierParams::mBuiltFlagMutex; + +RandomScaleModifierParams::RandomScaleModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RandomScaleModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RandomScaleModifierParams::~RandomScaleModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RandomScaleModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~RandomScaleModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RandomScaleModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RandomScaleModifierParams::getParameterDefinitionTree(void) const +{ + RandomScaleModifierParams* tmpParam = const_cast<RandomScaleModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RandomScaleModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType RandomScaleModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void RandomScaleModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RandomScaleModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RandomScaleModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void RandomScaleModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "RandomScale modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="minScaleFactor" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("minScaleFactor", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "Scale factor", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="maxScaleFactor" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("maxScaleFactor", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "Scale factor", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void RandomScaleModifierParams::initStrings(void) +{ +} + +void RandomScaleModifierParams::initDynamicArrays(void) +{ +} + +void RandomScaleModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + minScaleFactor = float(1.0f); + maxScaleFactor = float(1.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RandomScaleModifierParams::initReferences(void) +{ +} + +void RandomScaleModifierParams::freeDynamicArrays(void) +{ +} + +void RandomScaleModifierParams::freeStrings(void) +{ +} + +void RandomScaleModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/RandomSubtextureModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/RandomSubtextureModifierParams.cpp new file mode 100644 index 00000000..624d925b --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/RandomSubtextureModifierParams.cpp @@ -0,0 +1,355 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "RandomSubtextureModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace RandomSubtextureModifierParamsNS; + +const char* const RandomSubtextureModifierParamsFactory::vptr = + NvParameterized::getVptr<RandomSubtextureModifierParams, RandomSubtextureModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 3; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->minSubtexture), NULL, 0 }, // minSubtexture + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->maxSubtexture), NULL, 0 }, // maxSubtexture +}; + + +bool RandomSubtextureModifierParams::mBuiltFlag = false; +NvParameterized::MutexType RandomSubtextureModifierParams::mBuiltFlagMutex; + +RandomSubtextureModifierParams::RandomSubtextureModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RandomSubtextureModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RandomSubtextureModifierParams::~RandomSubtextureModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RandomSubtextureModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~RandomSubtextureModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RandomSubtextureModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RandomSubtextureModifierParams::getParameterDefinitionTree(void) const +{ + RandomSubtextureModifierParams* tmpParam = const_cast<RandomSubtextureModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RandomSubtextureModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType RandomSubtextureModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void RandomSubtextureModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RandomSubtextureModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RandomSubtextureModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void RandomSubtextureModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "RandomSubtexture modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="minSubtexture" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("minSubtexture", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Minimum subtexture index", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="maxSubtexture" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("maxSubtexture", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Maximum subtexture index", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void RandomSubtextureModifierParams::initStrings(void) +{ +} + +void RandomSubtextureModifierParams::initDynamicArrays(void) +{ +} + +void RandomSubtextureModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + minSubtexture = float(0.0f); + maxSubtexture = float(0.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RandomSubtextureModifierParams::initReferences(void) +{ +} + +void RandomSubtextureModifierParams::freeDynamicArrays(void) +{ +} + +void RandomSubtextureModifierParams::freeStrings(void) +{ +} + +void RandomSubtextureModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/RotationModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/RotationModifierParams.cpp new file mode 100644 index 00000000..6c363524 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/RotationModifierParams.cpp @@ -0,0 +1,481 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "RotationModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace RotationModifierParamsNS; + +const char* const RotationModifierParamsFactory::vptr = + NvParameterized::getVptr<RotationModifierParams, RotationModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 7; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, 6, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 6 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->rollType), NULL, 0 }, // rollType + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->maxRotationRatePerSec), NULL, 0 }, // maxRotationRatePerSec + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->maxSettleRatePerSec), NULL, 0 }, // maxSettleRatePerSec + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->inAirRotationMultiplier), NULL, 0 }, // inAirRotationMultiplier + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->collisionRotationMultiplier), NULL, 0 }, // collisionRotationMultiplier + { TYPE_BOOL, false, (size_t)(&((ParametersStruct*)0)->includeVerticalDirection), NULL, 0 }, // includeVerticalDirection +}; + + +bool RotationModifierParams::mBuiltFlag = false; +NvParameterized::MutexType RotationModifierParams::mBuiltFlagMutex; + +RotationModifierParams::RotationModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RotationModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RotationModifierParams::~RotationModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RotationModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~RotationModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RotationModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RotationModifierParams::getParameterDefinitionTree(void) const +{ + RotationModifierParams* tmpParam = const_cast<RotationModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RotationModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType RotationModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void RotationModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RotationModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RotationModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void RotationModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Rotation modifier parameters.", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="rollType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("rollType", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "SPHERICAL", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "SPHERICAL", true); + HintTable[1].init("shortDescription", "Roll type", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "SPHERICAL", "CUBIC", "FLAT_X", "FLAT_Y", "FLAT_Z", "LONG_X", "LONG_Y", "LONG_Z" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 8); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="maxRotationRatePerSec" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("maxRotationRatePerSec", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Maximum rotation rate for instanced mesh objects", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="maxSettleRatePerSec" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("maxSettleRatePerSec", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "Maximum settle rate for instanced mesh objects", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="inAirRotationMultiplier" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("inAirRotationMultiplier", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "This value is multiplied by the rotation delta to increase or decrease rotations/frame if there are no particle collisions", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="collisionRotationMultiplier" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("collisionRotationMultiplier", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "This value is multiplied by the rotation delta to increase or decrease rotations/frame while colliding objects", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=6, longName="includeVerticalDirection" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[6]; + ParamDef->init("includeVerticalDirection", TYPE_BOOL, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "false", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "false", true); + HintTable[1].init("shortDescription", "If false, the vertical speed of the object does not affect the rotation", true); + ParamDefTable[6].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[6]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(3); + Children[3] = PDEF_PTR(4); + Children[4] = PDEF_PTR(5); + Children[5] = PDEF_PTR(6); + + ParamDefTable[0].setChildren(Children, 6); + } + + mBuiltFlag = true; + +} +void RotationModifierParams::initStrings(void) +{ +} + +void RotationModifierParams::initDynamicArrays(void) +{ +} + +void RotationModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + rollType = (const char*)"SPHERICAL"; + maxRotationRatePerSec = float(0.0f); + maxSettleRatePerSec = float(1.0f); + inAirRotationMultiplier = float(1.0f); + collisionRotationMultiplier = float(1.0f); + includeVerticalDirection = bool(false); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RotationModifierParams::initReferences(void) +{ +} + +void RotationModifierParams::freeDynamicArrays(void) +{ +} + +void RotationModifierParams::freeStrings(void) +{ +} + +void RotationModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/RotationRateModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/RotationRateModifierParams.cpp new file mode 100644 index 00000000..7d2ea83d --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/RotationRateModifierParams.cpp @@ -0,0 +1,324 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "RotationRateModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace RotationRateModifierParamsNS; + +const char* const RotationRateModifierParamsFactory::vptr = + NvParameterized::getVptr<RotationRateModifierParams, RotationRateModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->rotationRate), NULL, 0 }, // rotationRate +}; + + +bool RotationRateModifierParams::mBuiltFlag = false; +NvParameterized::MutexType RotationRateModifierParams::mBuiltFlagMutex; + +RotationRateModifierParams::RotationRateModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RotationRateModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RotationRateModifierParams::~RotationRateModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RotationRateModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~RotationRateModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RotationRateModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RotationRateModifierParams::getParameterDefinitionTree(void) const +{ + RotationRateModifierParams* tmpParam = const_cast<RotationRateModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RotationRateModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType RotationRateModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void RotationRateModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RotationRateModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RotationRateModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void RotationRateModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "RotationRate modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="rotationRate" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("rotationRate", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(0), true); + HintTable[1].init("shortDescription", "Rotation Rate (revs/sec) for sprite objects", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void RotationRateModifierParams::initStrings(void) +{ +} + +void RotationRateModifierParams::initDynamicArrays(void) +{ +} + +void RotationRateModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + rotationRate = float(0.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RotationRateModifierParams::initReferences(void) +{ +} + +void RotationRateModifierParams::freeDynamicArrays(void) +{ +} + +void RotationRateModifierParams::freeStrings(void) +{ +} + +void RotationRateModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/RotationRateVsLifeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/RotationRateVsLifeModifierParams.cpp new file mode 100644 index 00000000..47a3142b --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/RotationRateVsLifeModifierParams.cpp @@ -0,0 +1,441 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "RotationRateVsLifeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace RotationRateVsLifeModifierParamsNS; + +const char* const RotationRateVsLifeModifierParamsFactory::vptr = + NvParameterized::getVptr<RotationRateVsLifeModifierParams, RotationRateVsLifeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool RotationRateVsLifeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType RotationRateVsLifeModifierParams::mBuiltFlagMutex; + +RotationRateVsLifeModifierParams::RotationRateVsLifeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &RotationRateVsLifeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +RotationRateVsLifeModifierParams::~RotationRateVsLifeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void RotationRateVsLifeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~RotationRateVsLifeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* RotationRateVsLifeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* RotationRateVsLifeModifierParams::getParameterDefinitionTree(void) const +{ + RotationRateVsLifeModifierParams* tmpParam = const_cast<RotationRateVsLifeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType RotationRateVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType RotationRateVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void RotationRateVsLifeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<RotationRateVsLifeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void RotationRateVsLifeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void RotationRateVsLifeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "RotationRateVsLife modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Rotation Rate (revs/sec)", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[4].init("shortDescription", "Control points for a curve", true); + HintTable[5].init("xAxisLabel", "Life Time", true); + HintTable[6].init("yAxisLabel", "Rotation Rate (revs/sec)", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Rotation Rate (revs/sec)", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[4].init("shortDescription", "Control points for a curve", true); + HintTable[5].init("xAxisLabel", "Life Time", true); + HintTable[6].init("yAxisLabel", "Rotation Rate (revs/sec)", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Life time", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Rotation rate (revs/sec)", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void RotationRateVsLifeModifierParams::initStrings(void) +{ +} + +void RotationRateVsLifeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void RotationRateVsLifeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void RotationRateVsLifeModifierParams::initReferences(void) +{ +} + +void RotationRateVsLifeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void RotationRateVsLifeModifierParams::freeStrings(void) +{ +} + +void RotationRateVsLifeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleAlongVelocityModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleAlongVelocityModifierParams.cpp new file mode 100644 index 00000000..89e034e4 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleAlongVelocityModifierParams.cpp @@ -0,0 +1,324 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleAlongVelocityModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleAlongVelocityModifierParamsNS; + +const char* const ScaleAlongVelocityModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleAlongVelocityModifierParams, ScaleAlongVelocityModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_F32, false, (size_t)(&((ParametersStruct*)0)->scaleFactor), NULL, 0 }, // scaleFactor +}; + + +bool ScaleAlongVelocityModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleAlongVelocityModifierParams::mBuiltFlagMutex; + +ScaleAlongVelocityModifierParams::ScaleAlongVelocityModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleAlongVelocityModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleAlongVelocityModifierParams::~ScaleAlongVelocityModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleAlongVelocityModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleAlongVelocityModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleAlongVelocityModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleAlongVelocityModifierParams::getParameterDefinitionTree(void) const +{ + ScaleAlongVelocityModifierParams* tmpParam = const_cast<ScaleAlongVelocityModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleAlongVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleAlongVelocityModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleAlongVelocityModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleAlongVelocityModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleAlongVelocityModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleAlongVelocityModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleAlongVelocity modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scaleFactor" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scaleFactor", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", uint64_t(1), true); + HintTable[1].init("shortDescription", "Scale factor", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void ScaleAlongVelocityModifierParams::initStrings(void) +{ +} + +void ScaleAlongVelocityModifierParams::initDynamicArrays(void) +{ +} + +void ScaleAlongVelocityModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scaleFactor = float(1.0f); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleAlongVelocityModifierParams::initReferences(void) +{ +} + +void ScaleAlongVelocityModifierParams::freeDynamicArrays(void) +{ +} + +void ScaleAlongVelocityModifierParams::freeStrings(void) +{ +} + +void ScaleAlongVelocityModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleByMassModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleByMassModifierParams.cpp new file mode 100644 index 00000000..a0e5f01c --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleByMassModifierParams.cpp @@ -0,0 +1,280 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleByMassModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleByMassModifierParamsNS; + +const char* const ScaleByMassModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleByMassModifierParams, ScaleByMassModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 1; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, NULL, 0 }, +}; + + +bool ScaleByMassModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleByMassModifierParams::mBuiltFlagMutex; + +ScaleByMassModifierParams::ScaleByMassModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleByMassModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleByMassModifierParams::~ScaleByMassModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleByMassModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleByMassModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleByMassModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleByMassModifierParams::getParameterDefinitionTree(void) const +{ + ScaleByMassModifierParams* tmpParam = const_cast<ScaleByMassModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleByMassModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleByMassModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleByMassModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleByMassModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleByMassModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleByMassModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleByMass modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + mBuiltFlag = true; + +} +void ScaleByMassModifierParams::initStrings(void) +{ +} + +void ScaleByMassModifierParams::initDynamicArrays(void) +{ +} + +void ScaleByMassModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleByMassModifierParams::initReferences(void) +{ +} + +void ScaleByMassModifierParams::freeDynamicArrays(void) +{ +} + +void ScaleByMassModifierParams::freeStrings(void) +{ +} + +void ScaleByMassModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistance2DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistance2DModifierParams.cpp new file mode 100644 index 00000000..c30f2a94 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistance2DModifierParams.cpp @@ -0,0 +1,451 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsCameraDistance2DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsCameraDistance2DModifierParamsNS; + +const char* const ScaleVsCameraDistance2DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsCameraDistance2DModifierParams, ScaleVsCameraDistance2DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleCameraDistanceStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleCameraDistanceStruct_Type*)0)->cameraDistance), NULL, 0 }, // controlPoints[].cameraDistance + { TYPE_VEC2, false, (size_t)(&((scaleCameraDistanceStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsCameraDistance2DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsCameraDistance2DModifierParams::mBuiltFlagMutex; + +ScaleVsCameraDistance2DModifierParams::ScaleVsCameraDistance2DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsCameraDistance2DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsCameraDistance2DModifierParams::~ScaleVsCameraDistance2DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsCameraDistance2DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsCameraDistance2DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsCameraDistance2DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsCameraDistance2DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsCameraDistance2DModifierParams* tmpParam = const_cast<ScaleVsCameraDistance2DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsCameraDistance2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsCameraDistance2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsCameraDistance2DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsCameraDistance2DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsCameraDistance2DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsCameraDistance2DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsCameraDistance2D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Camera Distance", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 2D scale vs camera distance curve", true); + HintTable[4].init("xAxisLabel", "Camera Distance", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleCameraDistanceStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Camera Distance", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 2D scale vs camera distance curve", true); + HintTable[4].init("xAxisLabel", "Camera Distance", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].cameraDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("cameraDistance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Camera distance", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC2, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsCameraDistance2DModifierParams::initStrings(void) +{ +} + +void ScaleVsCameraDistance2DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleCameraDistanceStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsCameraDistance2DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsCameraDistance2DModifierParams::initReferences(void) +{ +} + +void ScaleVsCameraDistance2DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsCameraDistance2DModifierParams::freeStrings(void) +{ +} + +void ScaleVsCameraDistance2DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistance3DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistance3DModifierParams.cpp new file mode 100644 index 00000000..87ea4207 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistance3DModifierParams.cpp @@ -0,0 +1,451 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsCameraDistance3DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsCameraDistance3DModifierParamsNS; + +const char* const ScaleVsCameraDistance3DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsCameraDistance3DModifierParams, ScaleVsCameraDistance3DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleCameraDistanceStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleCameraDistanceStruct_Type*)0)->cameraDistance), NULL, 0 }, // controlPoints[].cameraDistance + { TYPE_VEC3, false, (size_t)(&((scaleCameraDistanceStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsCameraDistance3DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsCameraDistance3DModifierParams::mBuiltFlagMutex; + +ScaleVsCameraDistance3DModifierParams::ScaleVsCameraDistance3DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsCameraDistance3DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsCameraDistance3DModifierParams::~ScaleVsCameraDistance3DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsCameraDistance3DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsCameraDistance3DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsCameraDistance3DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsCameraDistance3DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsCameraDistance3DModifierParams* tmpParam = const_cast<ScaleVsCameraDistance3DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsCameraDistance3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsCameraDistance3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsCameraDistance3DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsCameraDistance3DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsCameraDistance3DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsCameraDistance3DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsCameraDistance3D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Camera Distance", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 3D scale vs camera distance curve", true); + HintTable[4].init("xAxisLabel", "Camera Distance", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleCameraDistanceStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Camera Distance", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 3D scale vs camera distance curve", true); + HintTable[4].init("xAxisLabel", "Camera Distance", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].cameraDistance" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("cameraDistance", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Camera distance", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsCameraDistance3DModifierParams::initStrings(void) +{ +} + +void ScaleVsCameraDistance3DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleCameraDistanceStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsCameraDistance3DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsCameraDistance3DModifierParams::initReferences(void) +{ +} + +void ScaleVsCameraDistance3DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsCameraDistance3DModifierParams::freeStrings(void) +{ +} + +void ScaleVsCameraDistance3DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistanceModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistanceModifierParams.cpp new file mode 100644 index 00000000..b3c69217 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsCameraDistanceModifierParams.cpp @@ -0,0 +1,466 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsCameraDistanceModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsCameraDistanceModifierParamsNS; + +const char* const ScaleVsCameraDistanceModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsCameraDistanceModifierParams, ScaleVsCameraDistanceModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->scaleAxis), NULL, 0 }, // scaleAxis + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ScaleVsCameraDistanceModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsCameraDistanceModifierParams::mBuiltFlagMutex; + +ScaleVsCameraDistanceModifierParams::ScaleVsCameraDistanceModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsCameraDistanceModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsCameraDistanceModifierParams::~ScaleVsCameraDistanceModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsCameraDistanceModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsCameraDistanceModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsCameraDistanceModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsCameraDistanceModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsCameraDistanceModifierParams* tmpParam = const_cast<ScaleVsCameraDistanceModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsCameraDistanceModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsCameraDistanceModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsCameraDistanceModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsCameraDistanceModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsCameraDistanceModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsCameraDistanceModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsCameraDistance modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scaleAxis" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scaleAxis", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "xAxis", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "xAxis", true); + HintTable[1].init("shortDescription", "Scale axis to which the curve will be applied", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "xAxis", "yAxis", "zAxis" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Camera Distance", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Camera Distance", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Camera Distance", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Camera Distance", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Camera distance", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Scale", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsCameraDistanceModifierParams::initStrings(void) +{ +} + +void ScaleVsCameraDistanceModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsCameraDistanceModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scaleAxis = (const char*)"xAxis"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsCameraDistanceModifierParams::initReferences(void) +{ +} + +void ScaleVsCameraDistanceModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsCameraDistanceModifierParams::freeStrings(void) +{ +} + +void ScaleVsCameraDistanceModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsDensity2DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsDensity2DModifierParams.cpp new file mode 100644 index 00000000..13191419 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsDensity2DModifierParams.cpp @@ -0,0 +1,455 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsDensity2DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsDensity2DModifierParamsNS; + +const char* const ScaleVsDensity2DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsDensity2DModifierParams, ScaleVsDensity2DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleDensityStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleDensityStruct_Type*)0)->density), NULL, 0 }, // controlPoints[].density + { TYPE_VEC2, false, (size_t)(&((scaleDensityStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsDensity2DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsDensity2DModifierParams::mBuiltFlagMutex; + +ScaleVsDensity2DModifierParams::ScaleVsDensity2DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsDensity2DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsDensity2DModifierParams::~ScaleVsDensity2DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsDensity2DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsDensity2DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsDensity2DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsDensity2DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsDensity2DModifierParams* tmpParam = const_cast<ScaleVsDensity2DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsDensity2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsDensity2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsDensity2DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsDensity2DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsDensity2DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsDensity2DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsDensity2D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite 2D scale vs density curve", true); + HintTable[5].init("xAxisLabel", "Density", true); + HintTable[6].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleDensityStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1000), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite 2D scale vs density curve", true); + HintTable[5].init("xAxisLabel", "Density", true); + HintTable[6].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("density", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Density", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC2, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsDensity2DModifierParams::initStrings(void) +{ +} + +void ScaleVsDensity2DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleDensityStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsDensity2DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsDensity2DModifierParams::initReferences(void) +{ +} + +void ScaleVsDensity2DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsDensity2DModifierParams::freeStrings(void) +{ +} + +void ScaleVsDensity2DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsDensity3DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsDensity3DModifierParams.cpp new file mode 100644 index 00000000..5f1852ef --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsDensity3DModifierParams.cpp @@ -0,0 +1,455 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsDensity3DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsDensity3DModifierParamsNS; + +const char* const ScaleVsDensity3DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsDensity3DModifierParams, ScaleVsDensity3DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleDensityStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleDensityStruct_Type*)0)->density), NULL, 0 }, // controlPoints[].density + { TYPE_VEC3, false, (size_t)(&((scaleDensityStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsDensity3DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsDensity3DModifierParams::mBuiltFlagMutex; + +ScaleVsDensity3DModifierParams::ScaleVsDensity3DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsDensity3DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsDensity3DModifierParams::~ScaleVsDensity3DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsDensity3DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsDensity3DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsDensity3DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsDensity3DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsDensity3DModifierParams* tmpParam = const_cast<ScaleVsDensity3DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsDensity3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsDensity3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsDensity3DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsDensity3DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsDensity3DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsDensity3DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsDensity3D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite 3D scale vs density curve", true); + HintTable[5].init("xAxisLabel", "Density", true); + HintTable[6].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleDensityStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("xAxisLabel", "Density", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_X_SCALE_PHYSX3", uint64_t(1), true); + HintTable[2].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[3].init("editorCurve", uint64_t(1), true); + HintTable[4].init("shortDescription", "Control points for a composite 3D scale vs density curve", true); + HintTable[5].init("xAxisLabel", "Density", true); + HintTable[6].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].density" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("density", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Density", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsDensity3DModifierParams::initStrings(void) +{ +} + +void ScaleVsDensity3DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleDensityStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsDensity3DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsDensity3DModifierParams::initReferences(void) +{ +} + +void ScaleVsDensity3DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsDensity3DModifierParams::freeStrings(void) +{ +} + +void ScaleVsDensity3DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsDensityModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsDensityModifierParams.cpp new file mode 100644 index 00000000..e451646a --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsDensityModifierParams.cpp @@ -0,0 +1,466 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsDensityModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsDensityModifierParamsNS; + +const char* const ScaleVsDensityModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsDensityModifierParams, ScaleVsDensityModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->scaleAxis), NULL, 0 }, // scaleAxis + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ScaleVsDensityModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsDensityModifierParams::mBuiltFlagMutex; + +ScaleVsDensityModifierParams::ScaleVsDensityModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsDensityModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsDensityModifierParams::~ScaleVsDensityModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsDensityModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsDensityModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsDensityModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsDensityModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsDensityModifierParams* tmpParam = const_cast<ScaleVsDensityModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsDensityModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsDensityModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsDensityModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsDensityModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsDensityModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsDensityModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsDensity modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scaleAxis" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scaleAxis", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "xAxis", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "xAxis", true); + HintTable[1].init("shortDescription", "Scale axis to which the curve will be applied", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "xAxis", "yAxis", "zAxis" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Density", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Density", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Density", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Density", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Density", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Scale", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsDensityModifierParams::initStrings(void) +{ +} + +void ScaleVsDensityModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsDensityModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scaleAxis = (const char*)"xAxis"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsDensityModifierParams::initReferences(void) +{ +} + +void ScaleVsDensityModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsDensityModifierParams::freeStrings(void) +{ +} + +void ScaleVsDensityModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsLife2DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsLife2DModifierParams.cpp new file mode 100644 index 00000000..f4166d50 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsLife2DModifierParams.cpp @@ -0,0 +1,453 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsLife2DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsLife2DModifierParamsNS; + +const char* const ScaleVsLife2DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsLife2DModifierParams, ScaleVsLife2DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleLifeStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleLifeStruct_Type*)0)->lifeRemaining), NULL, 0 }, // controlPoints[].lifeRemaining + { TYPE_VEC2, false, (size_t)(&((scaleLifeStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsLife2DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsLife2DModifierParams::mBuiltFlagMutex; + +ScaleVsLife2DModifierParams::ScaleVsLife2DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsLife2DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsLife2DModifierParams::~ScaleVsLife2DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsLife2DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsLife2DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsLife2DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsLife2DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsLife2DModifierParams* tmpParam = const_cast<ScaleVsLife2DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsLife2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsLife2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsLife2DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsLife2DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsLife2DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsLife2DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsLife2D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite scale vs life curve", true); + HintTable[4].init("xAxisLabel", "Life Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleLifeStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite scale vs life curve", true); + HintTable[4].init("xAxisLabel", "Life Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].lifeRemaining" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("lifeRemaining", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Life remaining", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC2, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsLife2DModifierParams::initStrings(void) +{ +} + +void ScaleVsLife2DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleLifeStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsLife2DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsLife2DModifierParams::initReferences(void) +{ +} + +void ScaleVsLife2DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsLife2DModifierParams::freeStrings(void) +{ +} + +void ScaleVsLife2DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsLife3DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsLife3DModifierParams.cpp new file mode 100644 index 00000000..a53da682 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsLife3DModifierParams.cpp @@ -0,0 +1,453 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsLife3DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsLife3DModifierParamsNS; + +const char* const ScaleVsLife3DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsLife3DModifierParams, ScaleVsLife3DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleLifeStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleLifeStruct_Type*)0)->lifeRemaining), NULL, 0 }, // controlPoints[].lifeRemaining + { TYPE_VEC3, false, (size_t)(&((scaleLifeStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsLife3DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsLife3DModifierParams::mBuiltFlagMutex; + +ScaleVsLife3DModifierParams::ScaleVsLife3DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsLife3DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsLife3DModifierParams::~ScaleVsLife3DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsLife3DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsLife3DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsLife3DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsLife3DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsLife3DModifierParams* tmpParam = const_cast<ScaleVsLife3DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsLife3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsLife3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsLife3DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsLife3DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsLife3DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsLife3DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsLife3D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite scale vs life curve", true); + HintTable[4].init("xAxisLabel", "Life Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleLifeStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite scale vs life curve", true); + HintTable[4].init("xAxisLabel", "Life Time", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].lifeRemaining" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("lifeRemaining", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Life remaining", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsLife3DModifierParams::initStrings(void) +{ +} + +void ScaleVsLife3DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleLifeStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsLife3DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsLife3DModifierParams::initReferences(void) +{ +} + +void ScaleVsLife3DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsLife3DModifierParams::freeStrings(void) +{ +} + +void ScaleVsLife3DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsLifeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsLifeModifierParams.cpp new file mode 100644 index 00000000..364cded7 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsLifeModifierParams.cpp @@ -0,0 +1,474 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsLifeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsLifeModifierParamsNS; + +const char* const ScaleVsLifeModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsLifeModifierParams, ScaleVsLifeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->scaleAxis), NULL, 0 }, // scaleAxis + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ScaleVsLifeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsLifeModifierParams::mBuiltFlagMutex; + +ScaleVsLifeModifierParams::ScaleVsLifeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsLifeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsLifeModifierParams::~ScaleVsLifeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsLifeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsLifeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsLifeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsLifeModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsLifeModifierParams* tmpParam = const_cast<ScaleVsLifeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsLifeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsLifeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsLifeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsLifeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsLife modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scaleAxis" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scaleAxis", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "xAxis", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "xAxis", true); + HintTable[1].init("shortDescription", "Scale axis to which the curve will be applied", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "xAxis", "yAxis", "zAxis" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Life Time", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Life Time", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Life", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Scale", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsLifeModifierParams::initStrings(void) +{ +} + +void ScaleVsLifeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsLifeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scaleAxis = (const char*)"xAxis"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsLifeModifierParams::initReferences(void) +{ +} + +void ScaleVsLifeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsLifeModifierParams::freeStrings(void) +{ +} + +void ScaleVsLifeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperature2DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperature2DModifierParams.cpp new file mode 100644 index 00000000..d5c70695 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperature2DModifierParams.cpp @@ -0,0 +1,451 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsTemperature2DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsTemperature2DModifierParamsNS; + +const char* const ScaleVsTemperature2DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsTemperature2DModifierParams, ScaleVsTemperature2DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleTemperatureStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleTemperatureStruct_Type*)0)->temperature), NULL, 0 }, // controlPoints[].temperature + { TYPE_VEC2, false, (size_t)(&((scaleTemperatureStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsTemperature2DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsTemperature2DModifierParams::mBuiltFlagMutex; + +ScaleVsTemperature2DModifierParams::ScaleVsTemperature2DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsTemperature2DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsTemperature2DModifierParams::~ScaleVsTemperature2DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsTemperature2DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsTemperature2DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsTemperature2DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsTemperature2DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsTemperature2DModifierParams* tmpParam = const_cast<ScaleVsTemperature2DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsTemperature2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsTemperature2DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsTemperature2DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsTemperature2DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsTemperature2DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsTemperature2DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsTemperature2D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 2D scale vs Temperature curve", true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleTemperatureStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 2D scale vs Temperature curve", true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].temperature" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("temperature", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Temperature", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC2, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsTemperature2DModifierParams::initStrings(void) +{ +} + +void ScaleVsTemperature2DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleTemperatureStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsTemperature2DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsTemperature2DModifierParams::initReferences(void) +{ +} + +void ScaleVsTemperature2DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsTemperature2DModifierParams::freeStrings(void) +{ +} + +void ScaleVsTemperature2DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperature3DModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperature3DModifierParams.cpp new file mode 100644 index 00000000..f66a52e7 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperature3DModifierParams.cpp @@ -0,0 +1,451 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsTemperature3DModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsTemperature3DModifierParamsNS; + +const char* const ScaleVsTemperature3DModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsTemperature3DModifierParams, ScaleVsTemperature3DModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(scaleTemperatureStruct_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((scaleTemperatureStruct_Type*)0)->temperature), NULL, 0 }, // controlPoints[].temperature + { TYPE_VEC3, false, (size_t)(&((scaleTemperatureStruct_Type*)0)->scale), NULL, 0 }, // controlPoints[].scale +}; + + +bool ScaleVsTemperature3DModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsTemperature3DModifierParams::mBuiltFlagMutex; + +ScaleVsTemperature3DModifierParams::ScaleVsTemperature3DModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsTemperature3DModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsTemperature3DModifierParams::~ScaleVsTemperature3DModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsTemperature3DModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsTemperature3DModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsTemperature3DModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsTemperature3DModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsTemperature3DModifierParams* tmpParam = const_cast<ScaleVsTemperature3DModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsTemperature3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsTemperature3DModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsTemperature3DModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsTemperature3DModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsTemperature3DModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsTemperature3DModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsTemperature3D modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 3D scale vs Temperature curve", true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "scaleTemperatureStruct", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[6]; + static Hint* HintPtrTable[6] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(1), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("shortDescription", "Control points for a composite 3D scale vs Temperature curve", true); + HintTable[4].init("xAxisLabel", "Temperature", true); + HintTable[5].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 6); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].temperature" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("temperature", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Temperature", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].scale" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("scale", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("min", uint64_t(0), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("min", uint64_t(0), true); + HintTable[1].init("shortDescription", "Scale", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsTemperature3DModifierParams::initStrings(void) +{ +} + +void ScaleVsTemperature3DModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(scaleTemperatureStruct_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsTemperature3DModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsTemperature3DModifierParams::initReferences(void) +{ +} + +void ScaleVsTemperature3DModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsTemperature3DModifierParams::freeStrings(void) +{ +} + +void ScaleVsTemperature3DModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperatureModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperatureModifierParams.cpp new file mode 100644 index 00000000..cea69421 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ScaleVsTemperatureModifierParams.cpp @@ -0,0 +1,466 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ScaleVsTemperatureModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ScaleVsTemperatureModifierParamsNS; + +const char* const ScaleVsTemperatureModifierParamsFactory::vptr = + NvParameterized::getVptr<ScaleVsTemperatureModifierParams, ScaleVsTemperatureModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 2 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->scaleAxis), NULL, 0 }, // scaleAxis + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(2), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(3), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool ScaleVsTemperatureModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ScaleVsTemperatureModifierParams::mBuiltFlagMutex; + +ScaleVsTemperatureModifierParams::ScaleVsTemperatureModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ScaleVsTemperatureModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ScaleVsTemperatureModifierParams::~ScaleVsTemperatureModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ScaleVsTemperatureModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ScaleVsTemperatureModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ScaleVsTemperatureModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ScaleVsTemperatureModifierParams::getParameterDefinitionTree(void) const +{ + ScaleVsTemperatureModifierParams* tmpParam = const_cast<ScaleVsTemperatureModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ScaleVsTemperatureModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ScaleVsTemperatureModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ScaleVsTemperatureModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ScaleVsTemperatureModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ScaleVsTemperatureModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ScaleVsTemperatureModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ScaleVsTemperature modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scaleAxis" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scaleAxis", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "xAxis", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "xAxis", true); + HintTable[1].init("shortDescription", "Scale axis to which the curve will be applied", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "xAxis", "yAxis", "zAxis" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 3); + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Temperature", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("xAxisLabel", "Temperature", true); + HintTable[2].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#else + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("editorCurve", uint64_t(1), true); + HintTable[1].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[2].init("shortDescription", "Control points for a curve", true); + HintTable[3].init("xAxisLabel", "Temperature", true); + HintTable[4].init("yAxisLabel", "Scale", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Temperature", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Scale", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + + ParamDefTable[0].setChildren(Children, 2); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=3, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(4); + Children[1] = PDEF_PTR(5); + + ParamDefTable[3].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void ScaleVsTemperatureModifierParams::initStrings(void) +{ +} + +void ScaleVsTemperatureModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void ScaleVsTemperatureModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scaleAxis = (const char*)"xAxis"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ScaleVsTemperatureModifierParams::initReferences(void) +{ +} + +void ScaleVsTemperatureModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void ScaleVsTemperatureModifierParams::freeStrings(void) +{ +} + +void ScaleVsTemperatureModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/SimpleScaleModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/SimpleScaleModifierParams.cpp new file mode 100644 index 00000000..d6071a72 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/SimpleScaleModifierParams.cpp @@ -0,0 +1,318 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "SimpleScaleModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace SimpleScaleModifierParamsNS; + +const char* const SimpleScaleModifierParamsFactory::vptr = + NvParameterized::getVptr<SimpleScaleModifierParams, SimpleScaleModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_VEC3, false, (size_t)(&((ParametersStruct*)0)->scaleFactor), NULL, 0 }, // scaleFactor +}; + + +bool SimpleScaleModifierParams::mBuiltFlag = false; +NvParameterized::MutexType SimpleScaleModifierParams::mBuiltFlagMutex; + +SimpleScaleModifierParams::SimpleScaleModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &SimpleScaleModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +SimpleScaleModifierParams::~SimpleScaleModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void SimpleScaleModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~SimpleScaleModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* SimpleScaleModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* SimpleScaleModifierParams::getParameterDefinitionTree(void) const +{ + SimpleScaleModifierParams* tmpParam = const_cast<SimpleScaleModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType SimpleScaleModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType SimpleScaleModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void SimpleScaleModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<SimpleScaleModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void SimpleScaleModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void SimpleScaleModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "SimpleScale modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="scaleFactor" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("scaleFactor", TYPE_VEC3, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Scale factor", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void SimpleScaleModifierParams::initStrings(void) +{ +} + +void SimpleScaleModifierParams::initDynamicArrays(void) +{ +} + +void SimpleScaleModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + scaleFactor = physx::PxVec3(init(1, 1, 1)); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void SimpleScaleModifierParams::initReferences(void) +{ +} + +void SimpleScaleModifierParams::freeDynamicArrays(void) +{ +} + +void SimpleScaleModifierParams::freeStrings(void) +{ +} + +void SimpleScaleModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/SpriteIofxParameters.cpp b/APEX_1.4/module/iofx/src/autogen/SpriteIofxParameters.cpp new file mode 100644 index 00000000..99c3c81b --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/SpriteIofxParameters.cpp @@ -0,0 +1,534 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "SpriteIofxParameters.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace SpriteIofxParametersNS; + +const char* const SpriteIofxParametersFactory::vptr = + NvParameterized::getVptr<SpriteIofxParameters, SpriteIofxParameters::ClassAlignment>(); + +const uint32_t NumParamDefs = 6; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 4, 3, 5, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 3 }, + { TYPE_REF, false, (size_t)(&((ParametersStruct*)0)->spriteMaterialName), NULL, 0 }, // spriteMaterialName + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->spawnModifierList), CHILDREN(3), 1 }, // spawnModifierList + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // spawnModifierList[] + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->continuousModifierList), CHILDREN(4), 1 }, // continuousModifierList + { TYPE_REF, false, 1 * sizeof(NvParameterized::Interface*), NULL, 0 }, // continuousModifierList[] +}; + + +bool SpriteIofxParameters::mBuiltFlag = false; +NvParameterized::MutexType SpriteIofxParameters::mBuiltFlagMutex; + +SpriteIofxParameters::SpriteIofxParameters(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &SpriteIofxParametersFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +SpriteIofxParameters::~SpriteIofxParameters() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void SpriteIofxParameters::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~SpriteIofxParameters(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* SpriteIofxParameters::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* SpriteIofxParameters::getParameterDefinitionTree(void) const +{ + SpriteIofxParameters* tmpParam = const_cast<SpriteIofxParameters*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType SpriteIofxParameters::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType SpriteIofxParameters::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void SpriteIofxParameters::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<SpriteIofxParameters::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ +/* [0] - spawnModifierList (not an array of structs) */ +/* [0] - continuousModifierList (not an array of structs) */ + +void SpriteIofxParameters::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void SpriteIofxParameters::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="spriteMaterialName" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("spriteMaterialName", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "The sprite material name (if this is a sprite IOFX)", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ApexMaterials" }; + ParamDefTable[1].setRefVariantVals((const char**)RefVariantVals, 1); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="spawnModifierList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("spawnModifierList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("INCLUDED", uint64_t(1), true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("INCLUDED", uint64_t(1), true); + HintTable[2].init("longDescription", "These modifiers are applied to the instanced objects at object creation. (Currently RotationModifierParams is unsupported for sprites)", true); + HintTable[3].init("shortDescription", "Spawn modifier list", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "SimpleScaleModifierParams", "RandomScaleModifierParams", "InitialColorModifierParams", "RandomSubtextureModifierParams", "RandomRotationModifierParams", "ColorVsLifeModifierParams", "ScaleByMassModifierParams" }; + ParamDefTable[2].setRefVariantVals((const char**)RefVariantVals, 7); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="spawnModifierList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("spawnModifierList", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("INCLUDED", uint64_t(1), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[4]; + static Hint* HintPtrTable[4] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("INCLUDED", uint64_t(1), true); + HintTable[2].init("longDescription", "These modifiers are applied to the instanced objects at object creation. (Currently RotationModifierParams is unsupported for sprites)", true); + HintTable[3].init("shortDescription", "Spawn modifier list", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 4); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "SimpleScaleModifierParams", "RandomScaleModifierParams", "InitialColorModifierParams", "RandomSubtextureModifierParams", "RandomRotationModifierParams", "ColorVsLifeModifierParams", "ScaleByMassModifierParams" }; + ParamDefTable[3].setRefVariantVals((const char**)RefVariantVals, 7); + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="continuousModifierList" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("continuousModifierList", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ColorVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsDensityModifierParams", true); + HintTable[4].init("HIDE_CLASS5", "ScaleVsLifeModifierParams", true); + HintTable[5].init("HIDE_CLASS6", "ColorVsTemperatureModifierParams", true); + HintTable[6].init("HIDE_CLASS7", "ScaleVsTemperatureModifierParams", true); + HintTable[7].init("INCLUDED", uint64_t(1), true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#else + + static HintImpl HintTable[10]; + static Hint* HintPtrTable[10] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], &HintTable[8], &HintTable[9], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ColorVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsDensityModifierParams", true); + HintTable[4].init("HIDE_CLASS5", "ScaleVsLifeModifierParams", true); + HintTable[5].init("HIDE_CLASS6", "ColorVsTemperatureModifierParams", true); + HintTable[6].init("HIDE_CLASS7", "ScaleVsTemperatureModifierParams", true); + HintTable[7].init("INCLUDED", uint64_t(1), true); + HintTable[8].init("longDescription", "These modifiers are applied to the instanced objects every frame. (Currently RotationModifierParams is unsupported for sprites)", true); + HintTable[9].init("shortDescription", "Continuous modifier list", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 10); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ColorVsLifeCompositeModifierParams", "ColorVsDensityCompositeModifierParams", "ColorVsTemperatureCompositeModifierParams", "ScaleVsLife2DModifierParams", "ScaleVsDensity2DModifierParams", "ScaleVsTemperature2DModifierParams", "ScaleVsCameraDistance2DModifierParams", "SubtextureVsLifeModifierParams", "ViewDirectionSortingModifierParams", "ColorVsLifeModifierParams", "ColorVsDensityModifierParams", "ColorVsTemperatureModifierParams", "ScaleVsLifeModifierParams", "ScaleVsDensityModifierParams", "ScaleVsTemperatureModifierParams", "ScaleVsCameraDistanceModifierParams", "RotationRateModifierParams", "RotationRateVsLifeModifierParams", "OrientScaleAlongScreenVelocityModifierParams", "ColorVsVelocityCompositeModifierParams" }; + ParamDefTable[4].setRefVariantVals((const char**)RefVariantVals, 20); + + + ParamDef->setArraySize(-1); + static const uint8_t dynHandleIndices[1] = { 0, }; + ParamDef->setDynamicHandleIndicesMap(dynHandleIndices, 1); + + } + + // Initialize DefinitionImpl node: nodeIndex=5, longName="continuousModifierList[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[5]; + ParamDef->init("continuousModifierList", TYPE_REF, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[8]; + static Hint* HintPtrTable[8] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ColorVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsDensityModifierParams", true); + HintTable[4].init("HIDE_CLASS5", "ScaleVsLifeModifierParams", true); + HintTable[5].init("HIDE_CLASS6", "ColorVsTemperatureModifierParams", true); + HintTable[6].init("HIDE_CLASS7", "ScaleVsTemperatureModifierParams", true); + HintTable[7].init("INCLUDED", uint64_t(1), true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 8); + +#else + + static HintImpl HintTable[10]; + static Hint* HintPtrTable[10] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], &HintTable[7], &HintTable[8], &HintTable[9], }; + HintTable[0].init("HIDE_CLASS1", "ColorVsLifeModifierParams", true); + HintTable[1].init("HIDE_CLASS2", "ColorVsDensityModifierParams", true); + HintTable[2].init("HIDE_CLASS3", "ScaleVsCameraDistanceModifierParams", true); + HintTable[3].init("HIDE_CLASS4", "ScaleVsDensityModifierParams", true); + HintTable[4].init("HIDE_CLASS5", "ScaleVsLifeModifierParams", true); + HintTable[5].init("HIDE_CLASS6", "ColorVsTemperatureModifierParams", true); + HintTable[6].init("HIDE_CLASS7", "ScaleVsTemperatureModifierParams", true); + HintTable[7].init("INCLUDED", uint64_t(1), true); + HintTable[8].init("longDescription", "These modifiers are applied to the instanced objects every frame. (Currently RotationModifierParams is unsupported for sprites)", true); + HintTable[9].init("shortDescription", "Continuous modifier list", true); + ParamDefTable[5].setHints((const NvParameterized::Hint**)HintPtrTable, 10); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + static const char* const RefVariantVals[] = { "ColorVsLifeCompositeModifierParams", "ColorVsDensityCompositeModifierParams", "ColorVsTemperatureCompositeModifierParams", "ScaleVsLife2DModifierParams", "ScaleVsDensity2DModifierParams", "ScaleVsTemperature2DModifierParams", "ScaleVsCameraDistance2DModifierParams", "SubtextureVsLifeModifierParams", "ViewDirectionSortingModifierParams", "ColorVsLifeModifierParams", "ColorVsDensityModifierParams", "ColorVsTemperatureModifierParams", "ScaleVsLifeModifierParams", "ScaleVsDensityModifierParams", "ScaleVsTemperatureModifierParams", "ScaleVsCameraDistanceModifierParams", "RotationRateModifierParams", "RotationRateVsLifeModifierParams", "OrientScaleAlongScreenVelocityModifierParams", "ColorVsVelocityCompositeModifierParams" }; + ParamDefTable[5].setRefVariantVals((const char**)RefVariantVals, 20); + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[3]; + Children[0] = PDEF_PTR(1); + Children[1] = PDEF_PTR(2); + Children[2] = PDEF_PTR(4); + + ParamDefTable[0].setChildren(Children, 3); + } + + // SetChildren for: nodeIndex=2, longName="spawnModifierList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(3); + + ParamDefTable[2].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=4, longName="continuousModifierList" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(5); + + ParamDefTable[4].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void SpriteIofxParameters::initStrings(void) +{ +} + +void SpriteIofxParameters::initDynamicArrays(void) +{ + spawnModifierList.buf = NULL; + spawnModifierList.isAllocated = true; + spawnModifierList.elementSize = sizeof(NvParameterized::Interface*); + spawnModifierList.arraySizes[0] = 0; + continuousModifierList.buf = NULL; + continuousModifierList.isAllocated = true; + continuousModifierList.elementSize = sizeof(NvParameterized::Interface*); + continuousModifierList.arraySizes[0] = 0; +} + +void SpriteIofxParameters::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void SpriteIofxParameters::initReferences(void) +{ + spriteMaterialName = NULL; + +} + +void SpriteIofxParameters::freeDynamicArrays(void) +{ + if (spawnModifierList.isAllocated && spawnModifierList.buf) + { + mParameterizedTraits->free(spawnModifierList.buf); + } + if (continuousModifierList.isAllocated && continuousModifierList.buf) + { + mParameterizedTraits->free(continuousModifierList.buf); + } +} + +void SpriteIofxParameters::freeStrings(void) +{ +} + +void SpriteIofxParameters::freeReferences(void) +{ + if (spriteMaterialName) + { + spriteMaterialName->destroy(); + } + + + for (int i = 0; i < spawnModifierList.arraySizes[0]; ++i) + { + if (spawnModifierList.buf[i]) + { + spawnModifierList.buf[i]->destroy(); + } + } + + for (int i = 0; i < continuousModifierList.arraySizes[0]; ++i) + { + if (continuousModifierList.buf[i]) + { + continuousModifierList.buf[i]->destroy(); + } + } +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/SubtextureVsLifeModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/SubtextureVsLifeModifierParams.cpp new file mode 100644 index 00000000..95d8e868 --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/SubtextureVsLifeModifierParams.cpp @@ -0,0 +1,449 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "SubtextureVsLifeModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace SubtextureVsLifeModifierParamsNS; + +const char* const SubtextureVsLifeModifierParamsFactory::vptr = + NvParameterized::getVptr<SubtextureVsLifeModifierParams, SubtextureVsLifeModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 5; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, 2, 3, 4, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ARRAY, true, (size_t)(&((ParametersStruct*)0)->controlPoints), CHILDREN(1), 1 }, // controlPoints + { TYPE_STRUCT, false, 1 * sizeof(vec2_Type), CHILDREN(2), 2 }, // controlPoints[] + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->x), NULL, 0 }, // controlPoints[].x + { TYPE_F32, false, (size_t)(&((vec2_Type*)0)->y), NULL, 0 }, // controlPoints[].y +}; + + +bool SubtextureVsLifeModifierParams::mBuiltFlag = false; +NvParameterized::MutexType SubtextureVsLifeModifierParams::mBuiltFlagMutex; + +SubtextureVsLifeModifierParams::SubtextureVsLifeModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &SubtextureVsLifeModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +SubtextureVsLifeModifierParams::~SubtextureVsLifeModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void SubtextureVsLifeModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~SubtextureVsLifeModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* SubtextureVsLifeModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* SubtextureVsLifeModifierParams::getParameterDefinitionTree(void) const +{ + SubtextureVsLifeModifierParams* tmpParam = const_cast<SubtextureVsLifeModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType SubtextureVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType SubtextureVsLifeModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void SubtextureVsLifeModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<SubtextureVsLifeModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void SubtextureVsLifeModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void SubtextureVsLifeModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "SubtextureVsLife modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="controlPoints" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("controlPoints", TYPE_ARRAY, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "SubTexture", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[4].init("shortDescription", "Control points for a curve", true); + HintTable[5].init("xAxisLabel", "Life Time", true); + HintTable[6].init("yAxisLabel", "SubTexture", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + ParamDef->setArraySize(-1); + } + + // Initialize DefinitionImpl node: nodeIndex=2, longName="controlPoints[]" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[2]; + ParamDef->init("controlPoints", TYPE_STRUCT, "vec2", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[5]; + static Hint* HintPtrTable[5] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("xAxisLabel", "Life Time", true); + HintTable[4].init("yAxisLabel", "SubTexture", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 5); + +#else + + static HintImpl HintTable[7]; + static Hint* HintPtrTable[7] = { &HintTable[0], &HintTable[1], &HintTable[2], &HintTable[3], &HintTable[4], &HintTable[5], &HintTable[6], }; + HintTable[0].init("CURVE_X_SCALE", uint64_t(1), true); + HintTable[1].init("CURVE_Y_SCALE", uint64_t(16), true); + HintTable[2].init("editorCurve", uint64_t(1), true); + HintTable[3].init("longDescription", "controlPoints is a sorted list of control points for a curve. Currently, the curve is a lame\nlirp'd curve. We could add support for other curvetypes in the future, either bezier curves,\nsplines, etc.\n", true); + HintTable[4].init("shortDescription", "Control points for a curve", true); + HintTable[5].init("xAxisLabel", "Life Time", true); + HintTable[6].init("yAxisLabel", "SubTexture", true); + ParamDefTable[2].setHints((const NvParameterized::Hint**)HintPtrTable, 7); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=3, longName="controlPoints[].x" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[3]; + ParamDef->init("x", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#else + + static HintImpl HintTable[3]; + static Hint* HintPtrTable[3] = { &HintTable[0], &HintTable[1], &HintTable[2], }; + HintTable[0].init("max", uint64_t(1), true); + HintTable[1].init("min", uint64_t(0), true); + HintTable[2].init("shortDescription", "Life time", true); + ParamDefTable[3].setHints((const NvParameterized::Hint**)HintPtrTable, 3); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=4, longName="controlPoints[].y" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[4]; + ParamDef->init("y", TYPE_F32, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "Subtexture id", true); + ParamDefTable[4].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=1, longName="controlPoints" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(2); + + ParamDefTable[1].setChildren(Children, 1); + } + + // SetChildren for: nodeIndex=2, longName="controlPoints[]" + { + static Definition* Children[2]; + Children[0] = PDEF_PTR(3); + Children[1] = PDEF_PTR(4); + + ParamDefTable[2].setChildren(Children, 2); + } + + mBuiltFlag = true; + +} +void SubtextureVsLifeModifierParams::initStrings(void) +{ +} + +void SubtextureVsLifeModifierParams::initDynamicArrays(void) +{ + controlPoints.buf = NULL; + controlPoints.isAllocated = true; + controlPoints.elementSize = sizeof(vec2_Type); + controlPoints.arraySizes[0] = 0; +} + +void SubtextureVsLifeModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void SubtextureVsLifeModifierParams::initReferences(void) +{ +} + +void SubtextureVsLifeModifierParams::freeDynamicArrays(void) +{ + if (controlPoints.isAllocated && controlPoints.buf) + { + mParameterizedTraits->free(controlPoints.buf); + } +} + +void SubtextureVsLifeModifierParams::freeStrings(void) +{ +} + +void SubtextureVsLifeModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia diff --git a/APEX_1.4/module/iofx/src/autogen/ViewDirectionSortingModifierParams.cpp b/APEX_1.4/module/iofx/src/autogen/ViewDirectionSortingModifierParams.cpp new file mode 100644 index 00000000..528175bb --- /dev/null +++ b/APEX_1.4/module/iofx/src/autogen/ViewDirectionSortingModifierParams.cpp @@ -0,0 +1,326 @@ +// This code contains NVIDIA Confidential Information and is disclosed to you +// under a form of NVIDIA software license agreement provided separately to you. +// +// Notice +// NVIDIA Corporation and its licensors retain all intellectual property and +// proprietary rights in and to this software and related documentation and +// any modifications thereto. Any use, reproduction, disclosure, or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA Corporation is strictly prohibited. +// +// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES +// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO +// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, +// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. +// +// Information and code furnished is believed to be accurate and reliable. +// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such +// information or for any infringement of patents or other rights of third parties that may +// result from its use. No license is granted by implication or otherwise under any patent +// or patent rights of NVIDIA Corporation. Details are subject to change without notice. +// This code supersedes and replaces all information previously supplied. +// NVIDIA Corporation products are not authorized for use as critical +// components in life support devices or systems without express written approval of +// NVIDIA Corporation. +// +// Copyright (c) 2008-2015 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#include "ViewDirectionSortingModifierParams.h" +#include <string.h> +#include <stdlib.h> + +using namespace NvParameterized; + +namespace nvidia +{ +namespace iofx +{ + +using namespace ViewDirectionSortingModifierParamsNS; + +const char* const ViewDirectionSortingModifierParamsFactory::vptr = + NvParameterized::getVptr<ViewDirectionSortingModifierParams, ViewDirectionSortingModifierParams::ClassAlignment>(); + +const uint32_t NumParamDefs = 2; +static NvParameterized::DefinitionImpl* ParamDefTable; // now allocated in buildTree [NumParamDefs]; + + +static const size_t ParamLookupChildrenTable[] = +{ + 1, +}; + +#define TENUM(type) nvidia::##type +#define CHILDREN(index) &ParamLookupChildrenTable[index] +static const NvParameterized::ParamLookupNode ParamLookupTable[NumParamDefs] = +{ + { TYPE_STRUCT, false, 0, CHILDREN(0), 1 }, + { TYPE_ENUM, false, (size_t)(&((ParametersStruct*)0)->sortType), NULL, 0 }, // sortType +}; + + +bool ViewDirectionSortingModifierParams::mBuiltFlag = false; +NvParameterized::MutexType ViewDirectionSortingModifierParams::mBuiltFlagMutex; + +ViewDirectionSortingModifierParams::ViewDirectionSortingModifierParams(NvParameterized::Traits* traits, void* buf, int32_t* refCount) : + NvParameters(traits, buf, refCount) +{ + //mParameterizedTraits->registerFactory(className(), &ViewDirectionSortingModifierParamsFactoryInst); + + if (!buf) //Do not init data if it is inplace-deserialized + { + initDynamicArrays(); + initStrings(); + initReferences(); + initDefaults(); + } +} + +ViewDirectionSortingModifierParams::~ViewDirectionSortingModifierParams() +{ + freeStrings(); + freeReferences(); + freeDynamicArrays(); +} + +void ViewDirectionSortingModifierParams::destroy() +{ + // We cache these fields here to avoid overwrite in destructor + bool doDeallocateSelf = mDoDeallocateSelf; + NvParameterized::Traits* traits = mParameterizedTraits; + int32_t* refCount = mRefCount; + void* buf = mBuffer; + + this->~ViewDirectionSortingModifierParams(); + + NvParameters::destroy(this, traits, doDeallocateSelf, refCount, buf); +} + +const NvParameterized::DefinitionImpl* ViewDirectionSortingModifierParams::getParameterDefinitionTree(void) +{ + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +const NvParameterized::DefinitionImpl* ViewDirectionSortingModifierParams::getParameterDefinitionTree(void) const +{ + ViewDirectionSortingModifierParams* tmpParam = const_cast<ViewDirectionSortingModifierParams*>(this); + + if (!mBuiltFlag) // Double-checked lock + { + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + if (!mBuiltFlag) + { + tmpParam->buildTree(); + } + } + + return(&ParamDefTable[0]); +} + +NvParameterized::ErrorType ViewDirectionSortingModifierParams::getParameterHandle(const char* long_name, Handle& handle) const +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +NvParameterized::ErrorType ViewDirectionSortingModifierParams::getParameterHandle(const char* long_name, Handle& handle) +{ + ErrorType Ret = NvParameters::getParameterHandle(long_name, handle); + if (Ret != ERROR_NONE) + { + return(Ret); + } + + size_t offset; + void* ptr; + + getVarPtr(handle, ptr, offset); + + if (ptr == NULL) + { + return(ERROR_INDEX_OUT_OF_RANGE); + } + + return(ERROR_NONE); +} + +void ViewDirectionSortingModifierParams::getVarPtr(const Handle& handle, void*& ptr, size_t& offset) const +{ + ptr = getVarPtrHelper(&ParamLookupTable[0], const_cast<ViewDirectionSortingModifierParams::ParametersStruct*>(¶meters()), handle, offset); +} + + +/* Dynamic Handle Indices */ + +void ViewDirectionSortingModifierParams::freeParameterDefinitionTable(NvParameterized::Traits* traits) +{ + if (!traits) + { + return; + } + + if (!mBuiltFlag) // Double-checked lock + { + return; + } + + NvParameterized::MutexType::ScopedLock lock(mBuiltFlagMutex); + + if (!mBuiltFlag) + { + return; + } + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + ParamDefTable[i].~DefinitionImpl(); + } + + traits->free(ParamDefTable); + + mBuiltFlag = false; +} + +#define PDEF_PTR(index) (&ParamDefTable[index]) + +void ViewDirectionSortingModifierParams::buildTree(void) +{ + + uint32_t allocSize = sizeof(NvParameterized::DefinitionImpl) * NumParamDefs; + ParamDefTable = (NvParameterized::DefinitionImpl*)(mParameterizedTraits->alloc(allocSize)); + memset(ParamDefTable, 0, allocSize); + + for (uint32_t i = 0; i < NumParamDefs; ++i) + { + NV_PARAM_PLACEMENT_NEW(ParamDefTable + i, NvParameterized::DefinitionImpl)(*mParameterizedTraits); + } + + // Initialize DefinitionImpl node: nodeIndex=0, longName="" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[0]; + ParamDef->init("", TYPE_STRUCT, "STRUCT", true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + +#else + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("shortDescription", "ViewDirectionSorting modifier parameters", true); + ParamDefTable[0].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + + + + + } + + // Initialize DefinitionImpl node: nodeIndex=1, longName="sortType" + { + NvParameterized::DefinitionImpl* ParamDef = &ParamDefTable[1]; + ParamDef->init("sortType", TYPE_ENUM, NULL, true); + +#ifdef NV_PARAMETERIZED_HIDE_DESCRIPTIONS + + static HintImpl HintTable[1]; + static Hint* HintPtrTable[1] = { &HintTable[0], }; + HintTable[0].init("defaultValue", "default", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 1); + +#else + + static HintImpl HintTable[2]; + static Hint* HintPtrTable[2] = { &HintTable[0], &HintTable[1], }; + HintTable[0].init("defaultValue", "default", true); + HintTable[1].init("shortDescription", "Sort type", true); + ParamDefTable[1].setHints((const NvParameterized::Hint**)HintPtrTable, 2); + +#endif /* NV_PARAMETERIZED_HIDE_DESCRIPTIONS */ + + static const char* const EnumVals[] = { "default" }; + ParamDefTable[1].setEnumVals((const char**)EnumVals, 1); + + + + + } + + // SetChildren for: nodeIndex=0, longName="" + { + static Definition* Children[1]; + Children[0] = PDEF_PTR(1); + + ParamDefTable[0].setChildren(Children, 1); + } + + mBuiltFlag = true; + +} +void ViewDirectionSortingModifierParams::initStrings(void) +{ +} + +void ViewDirectionSortingModifierParams::initDynamicArrays(void) +{ +} + +void ViewDirectionSortingModifierParams::initDefaults(void) +{ + + freeStrings(); + freeReferences(); + freeDynamicArrays(); + sortType = (const char*)"default"; + + initDynamicArrays(); + initStrings(); + initReferences(); +} + +void ViewDirectionSortingModifierParams::initReferences(void) +{ +} + +void ViewDirectionSortingModifierParams::freeDynamicArrays(void) +{ +} + +void ViewDirectionSortingModifierParams::freeStrings(void) +{ +} + +void ViewDirectionSortingModifierParams::freeReferences(void) +{ +} + +} // namespace iofx +} // namespace nvidia |