diff options
| author | Bryan Galdrikian <[email protected]> | 2018-01-26 21:55:41 -0800 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2018-01-26 21:55:41 -0800 |
| commit | ac961c33c61b487d982ca9cf9b04ba4ac754ecda (patch) | |
| tree | 2600d61bb009f065384d548eb16fdc2d12f0f227 /sdk/extensions/import/apexmodules/modules/common/include | |
| parent | Updated release notes (diff) | |
| download | blast-ac961c33c61b487d982ca9cf9b04ba4ac754ecda.tar.xz blast-ac961c33c61b487d982ca9cf9b04ba4ac754ecda.zip | |
Apex dependency removed (used in ExtImport)
Mesh corruption and crash fit for UV fitting function
Updated release_notes.txt
Diffstat (limited to 'sdk/extensions/import/apexmodules/modules/common/include')
5 files changed, 1160 insertions, 0 deletions
diff --git a/sdk/extensions/import/apexmodules/modules/common/include/ApexCommonStructs.h b/sdk/extensions/import/apexmodules/modules/common/include/ApexCommonStructs.h new file mode 100644 index 0000000..4488c46 --- /dev/null +++ b/sdk/extensions/import/apexmodules/modules/common/include/ApexCommonStructs.h @@ -0,0 +1,251 @@ +#ifndef APEXCOMMONSTRUCTS_H +#define APEXCOMMONSTRUCTS_H + +#include <PxPreprocessor.h> +#include "PxAssert.h" +#include "PxMat44.h" + + +using namespace physx; + +/* +From APEX +*/ + +struct IntPair +{ + void set(int32_t _i0, int32_t _i1) + { + i0 = _i0; + i1 = _i1; + } + + int32_t i0, i1; + + static int compare(const void* a, const void* b) + { + const int32_t diff0 = ((IntPair*)a)->i0 - ((IntPair*)b)->i0; + return diff0 ? diff0 : (((IntPair*)a)->i1 - ((IntPair*)b)->i1); + } +}; + +struct RenderVertexSemantic +{ + /** + \brief Enum of vertex buffer semantics types + */ + enum Enum + { + CUSTOM = -1, //!< User-defined + + POSITION = 0, //!< Position of vertex + NORMAL, //!< Normal at vertex + TANGENT, //!< Tangent at vertex + BINORMAL, //!< Binormal at vertex + COLOR, //!< Color at vertex + TEXCOORD0, //!< Texture coord 0 of vertex + TEXCOORD1, //!< Texture coord 1 of vertex + TEXCOORD2, //!< Texture coord 2 of vertex + TEXCOORD3, //!< Texture coord 3 of vertex + BONE_INDEX, //!< Bone index of vertex + BONE_WEIGHT, //!< Bone weight of vertex + + DISPLACEMENT_TEXCOORD, //!< X Displacement map texture coord of vertex + DISPLACEMENT_FLAGS, //!< Displacement map flags of vertex + + NUM_SEMANTICS //!< Count of standard semantics, not a valid semantic + }; +}; + +namespace nvidia +{ + namespace apex + { + + PX_PUSH_PACK_DEFAULT + + /** + \brief Enumeration of possible formats of various buffer semantics + + N.B.: DO NOT CHANGE THE VALUES OF OLD FORMATS. + */ + struct RenderDataFormat + { + /** \brief the enum type */ + enum Enum + { + UNSPECIFIED = 0, //!< No format (semantic not used) + + //!< Integer formats + UBYTE1 = 1, //!< One unsigned 8-bit integer (uint8_t[1]) + UBYTE2 = 2, //!< Two unsigned 8-bit integers (uint8_t[2]) + UBYTE3 = 3, //!< Three unsigned 8-bit integers (uint8_t[3]) + UBYTE4 = 4, //!< Four unsigned 8-bit integers (uint8_t[4]) + + USHORT1 = 5, //!< One unsigned 16-bit integer (uint16_t[1]) + USHORT2 = 6, //!< Two unsigned 16-bit integers (uint16_t[2]) + USHORT3 = 7, //!< Three unsigned 16-bit integers (uint16_t[3]) + USHORT4 = 8, //!< Four unsigned 16-bit integers (uint16_t[4]) + + SHORT1 = 9, //!< One signed 16-bit integer (int16_t[1]) + SHORT2 = 10, //!< Two signed 16-bit integers (int16_t[2]) + SHORT3 = 11, //!< Three signed 16-bit integers (int16_t[3]) + SHORT4 = 12, //!< Four signed 16-bit integers (int16_t[4]) + + UINT1 = 13, //!< One unsigned integer (uint32_t[1]) + UINT2 = 14, //!< Two unsigned integers (uint32_t[2]) + UINT3 = 15, //!< Three unsigned integers (uint32_t[3]) + UINT4 = 16, //!< Four unsigned integers (uint32_t[4]) + + //!< Color formats + R8G8B8A8 = 17, //!< Four unsigned bytes (uint8_t[4]) representing red, green, blue, alpha + B8G8R8A8 = 18, //!< Four unsigned bytes (uint8_t[4]) representing blue, green, red, alpha + R32G32B32A32_FLOAT = 19, //!< Four floats (float[4]) representing red, green, blue, alpha + B32G32R32A32_FLOAT = 20, //!< Four floats (float[4]) representing blue, green, red, alpha + + //!< Normalized formats + BYTE_UNORM1 = 21, //!< One unsigned normalized value in the range [0,1], packed into 8 bits (uint8_t[1]) + BYTE_UNORM2 = 22, //!< Two unsigned normalized value in the range [0,1], each packed into 8 bits (uint8_t[2]) + BYTE_UNORM3 = 23, //!< Three unsigned normalized value in the range [0,1], each packed into bits (uint8_t[3]) + BYTE_UNORM4 = 24, //!< Four unsigned normalized value in the range [0,1], each packed into 8 bits (uint8_t[4]) + + SHORT_UNORM1 = 25, //!< One unsigned normalized value in the range [0,1], packed into 16 bits (uint16_t[1]) + SHORT_UNORM2 = 26, //!< Two unsigned normalized value in the range [0,1], each packed into 16 bits (uint16_t[2]) + SHORT_UNORM3 = 27, //!< Three unsigned normalized value in the range [0,1], each packed into 16 bits (uint16_t[3]) + SHORT_UNORM4 = 28, //!< Four unsigned normalized value in the range [0,1], each packed into 16 bits (uint16_t[4]) + + BYTE_SNORM1 = 29, //!< One signed normalized value in the range [-1,1], packed into 8 bits (uint8_t[1]) + BYTE_SNORM2 = 30, //!< Two signed normalized value in the range [-1,1], each packed into 8 bits (uint8_t[2]) + BYTE_SNORM3 = 31, //!< Three signed normalized value in the range [-1,1], each packed into bits (uint8_t[3]) + BYTE_SNORM4 = 32, //!< Four signed normalized value in the range [-1,1], each packed into 8 bits (uint8_t[4]) + + SHORT_SNORM1 = 33, //!< One signed normalized value in the range [-1,1], packed into 16 bits (uint16_t[1]) + SHORT_SNORM2 = 34, //!< Two signed normalized value in the range [-1,1], each packed into 16 bits (uint16_t[2]) + SHORT_SNORM3 = 35, //!< Three signed normalized value in the range [-1,1], each packed into 16 bits (uint16_t[3]) + SHORT_SNORM4 = 36, //!< Four signed normalized value in the range [-1,1], each packed into 16 bits (uint16_t[4]) + + //!< Float formats + HALF1 = 37, //!< One 16-bit floating point value + HALF2 = 38, //!< Two 16-bit floating point values + HALF3 = 39, //!< Three 16-bit floating point values + HALF4 = 40, //!< Four 16-bit floating point values + + FLOAT1 = 41, //!< One 32-bit floating point value + FLOAT2 = 42, //!< Two 32-bit floating point values + FLOAT3 = 43, //!< Three 32-bit floating point values + FLOAT4 = 44, //!< Four 32-bit floating point values + + FLOAT4x4 = 45, //!< A 4x4 matrix (see PxMat44) + FLOAT3x4 = 46, //!< A 3x4 matrix (see float[12]) + FLOAT3x3 = 47, //!< A 3x3 matrix (see PxMat33) + + FLOAT4_QUAT = 48, //!< A quaternion (see PxQuat) + BYTE_SNORM4_QUATXYZW = 49, //!< A normalized quaternion with signed byte elements, X,Y,Z,W format (uint8_t[4]) + SHORT_SNORM4_QUATXYZW = 50, //!< A normalized quaternion with signed short elements, X,Y,Z,W format (uint16_t[4]) + + NUM_FORMATS + }; + + /// Get byte size of format type + static PX_INLINE uint32_t getFormatDataSize(Enum format) + { + switch (format) + { + default: + PX_ALWAYS_ASSERT(); + case UNSPECIFIED: + return 0; + + case UBYTE1: + case BYTE_UNORM1: + case BYTE_SNORM1: + return sizeof(uint8_t); + case UBYTE2: + case BYTE_UNORM2: + case BYTE_SNORM2: + return sizeof(uint8_t) * 2; + case UBYTE3: + case BYTE_UNORM3: + case BYTE_SNORM3: + return sizeof(uint8_t) * 3; + case UBYTE4: + case BYTE_UNORM4: + case BYTE_SNORM4: + case BYTE_SNORM4_QUATXYZW: + return sizeof(uint8_t) * 4; + + case USHORT1: + case SHORT1: + case HALF1: + case SHORT_UNORM1: + case SHORT_SNORM1: + return sizeof(uint16_t); + case USHORT2: + case SHORT2: + case HALF2: + case SHORT_UNORM2: + case SHORT_SNORM2: + return sizeof(uint16_t) * 2; + case USHORT3: + case SHORT3: + case HALF3: + case SHORT_UNORM3: + case SHORT_SNORM3: + return sizeof(uint16_t) * 3; + case USHORT4: + case SHORT4: + case HALF4: + case SHORT_UNORM4: + case SHORT_SNORM4: + case SHORT_SNORM4_QUATXYZW: + return sizeof(uint16_t) * 4; + + case UINT1: + return sizeof(uint32_t); + case UINT2: + return sizeof(uint32_t) * 2; + case UINT3: + return sizeof(uint32_t) * 3; + case UINT4: + return sizeof(uint32_t) * 4; + + case R8G8B8A8: + case B8G8R8A8: + return sizeof(uint8_t) * 4; + + case R32G32B32A32_FLOAT: + case B32G32R32A32_FLOAT: + return sizeof(float) * 4; + + case FLOAT1: + return sizeof(float); + case FLOAT2: + return sizeof(float) * 2; + case FLOAT3: + return sizeof(float) * 3; + case FLOAT4: + return sizeof(float) * 4; + + case FLOAT4x4: + return sizeof(PxMat44); + + case FLOAT3x4: + return sizeof(float) * 12; + + case FLOAT3x3: + return sizeof(PxMat33); + + case FLOAT4_QUAT: + return sizeof(PxQuat); + } + } + }; + + PX_POP_PACK + + } +} // end namespace nvidia::apex + + + +#endif
\ No newline at end of file diff --git a/sdk/extensions/import/apexmodules/modules/common/include/autogen/ConvexHullParameters.h b/sdk/extensions/import/apexmodules/modules/common/include/autogen/ConvexHullParameters.h new file mode 100644 index 0000000..bbb81ff --- /dev/null +++ b/sdk/extensions/import/apexmodules/modules/common/include/autogen/ConvexHullParameters.h @@ -0,0 +1,276 @@ +// 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-2017 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_ConvexHullParameters_h +#define HEADER_ConvexHullParameters_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 apex +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace ConvexHullParametersNS +{ + +struct Plane_Type; + +struct VEC3_DynamicArray1D_Type +{ + physx::PxVec3* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct Plane_DynamicArray1D_Type +{ + Plane_Type* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct F32_DynamicArray1D_Type +{ + float* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct U32_DynamicArray1D_Type +{ + uint32_t* buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + +struct Plane_Type +{ + physx::PxVec3 normal; + float d; +}; + +struct ParametersStruct +{ + + VEC3_DynamicArray1D_Type vertices; + Plane_DynamicArray1D_Type uniquePlanes; + F32_DynamicArray1D_Type widths; + U32_DynamicArray1D_Type edges; + U32_DynamicArray1D_Type adjacentFaces; + physx::PxBounds3 bounds; + float volume; + uint32_t uniqueEdgeDirectionCount; + uint32_t planeCount; + +}; + +static const uint32_t checksum[] = { 0x8a50b89e, 0xda2f896b, 0x82da2553, 0x3b609a3d, }; + +} // namespace ConvexHullParametersNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class ConvexHullParameters : public NvParameterized::NvParameters, public ConvexHullParametersNS::ParametersStruct +{ +public: + ConvexHullParameters(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~ConvexHullParameters(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("ConvexHullParameters"); + } + + 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(ConvexHullParametersNS::checksum); + return ConvexHullParametersNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const ConvexHullParametersNS::ParametersStruct& parameters(void) const + { + ConvexHullParameters* tmpThis = const_cast<ConvexHullParameters*>(this); + return *(static_cast<ConvexHullParametersNS::ParametersStruct*>(tmpThis)); + } + + ConvexHullParametersNS::ParametersStruct& parameters(void) + { + return *(static_cast<ConvexHullParametersNS::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 ConvexHullParametersFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + ConvexHullParameters::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(ConvexHullParameters), ConvexHullParameters::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, ConvexHullParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ConvexHullParameters"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(ConvexHullParameters)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, ConvexHullParameters)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, ConvexHullParameters::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, ConvexHullParameters::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class ConvexHullParameters"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of ConvexHullParameters 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 (ConvexHullParameters*)bufObj; + } + + virtual const char* getClassName() + { + return (ConvexHullParameters::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (ConvexHullParameters::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (ConvexHullParameters::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (ConvexHullParameters::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace apex +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/sdk/extensions/import/apexmodules/modules/common/include/autogen/DebugColorParams.h b/sdk/extensions/import/apexmodules/modules/common/include/autogen/DebugColorParams.h new file mode 100644 index 0000000..e403530 --- /dev/null +++ b/sdk/extensions/import/apexmodules/modules/common/include/autogen/DebugColorParams.h @@ -0,0 +1,265 @@ +// 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-2017 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_DebugColorParams_h +#define HEADER_DebugColorParams_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 apex +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace DebugColorParamsNS +{ + + + +struct ParametersStruct +{ + + uint32_t Default; + uint32_t PoseArrows; + uint32_t MeshStatic; + uint32_t MeshDynamic; + uint32_t Shape; + uint32_t Text0; + uint32_t Text1; + uint32_t ForceArrowsLow; + uint32_t ForceArrowsNorm; + uint32_t ForceArrowsHigh; + uint32_t Color0; + uint32_t Color1; + uint32_t Color2; + uint32_t Color3; + uint32_t Color4; + uint32_t Color5; + uint32_t Red; + uint32_t Green; + uint32_t Blue; + uint32_t DarkRed; + uint32_t DarkGreen; + uint32_t DarkBlue; + uint32_t LightRed; + uint32_t LightGreen; + uint32_t LightBlue; + uint32_t Purple; + uint32_t DarkPurple; + uint32_t Yellow; + uint32_t Orange; + uint32_t Gold; + uint32_t Emerald; + uint32_t White; + uint32_t Black; + uint32_t Gray; + uint32_t LightGray; + uint32_t DarkGray; + +}; + +static const uint32_t checksum[] = { 0x21b30efd, 0xaea10022, 0x72a4df62, 0x8fab217f, }; + +} // namespace DebugColorParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class DebugColorParams : public NvParameterized::NvParameters, public DebugColorParamsNS::ParametersStruct +{ +public: + DebugColorParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~DebugColorParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("DebugColorParams"); + } + + 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(DebugColorParamsNS::checksum); + return DebugColorParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const DebugColorParamsNS::ParametersStruct& parameters(void) const + { + DebugColorParams* tmpThis = const_cast<DebugColorParams*>(this); + return *(static_cast<DebugColorParamsNS::ParametersStruct*>(tmpThis)); + } + + DebugColorParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<DebugColorParamsNS::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 DebugColorParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + DebugColorParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(DebugColorParams), DebugColorParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, DebugColorParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class DebugColorParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(DebugColorParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, DebugColorParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, DebugColorParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, DebugColorParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class DebugColorParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of DebugColorParams 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 (DebugColorParams*)bufObj; + } + + virtual const char* getClassName() + { + return (DebugColorParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (DebugColorParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (DebugColorParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (DebugColorParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace apex +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/sdk/extensions/import/apexmodules/modules/common/include/autogen/DebugRenderParams.h b/sdk/extensions/import/apexmodules/modules/common/include/autogen/DebugRenderParams.h new file mode 100644 index 0000000..78a1345 --- /dev/null +++ b/sdk/extensions/import/apexmodules/modules/common/include/autogen/DebugRenderParams.h @@ -0,0 +1,248 @@ +// 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-2017 NVIDIA Corporation. All rights reserved. + +// This file was generated by NvParameterized/scripts/GenParameterized.pl + + +#ifndef HEADER_DebugRenderParams_h +#define HEADER_DebugRenderParams_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 apex +{ + +#if PX_VC +#pragma warning(push) +#pragma warning(disable: 4324) // structure was padded due to __declspec(align()) +#endif + +namespace DebugRenderParamsNS +{ + + +struct REF_DynamicArray1D_Type +{ + NvParameterized::Interface** buf; + bool isAllocated; + int32_t elementSize; + int32_t arraySizes[1]; +}; + + +struct ParametersStruct +{ + + bool Enable; + float Scale; + float LodBenefits; + float RelativeLodBenefitsScreenPos; + float RelativeLodBenefitsThickness; + float LodDistanceScale; + float RenderNormals; + float RenderTangents; + float RenderBitangents; + bool Bounds; + REF_DynamicArray1D_Type moduleName; + +}; + +static const uint32_t checksum[] = { 0x0679a129, 0x4119501f, 0xde4ce2b2, 0xecb0049b, }; + +} // namespace DebugRenderParamsNS + +#ifndef NV_PARAMETERIZED_ONLY_LAYOUTS +class DebugRenderParams : public NvParameterized::NvParameters, public DebugRenderParamsNS::ParametersStruct +{ +public: + DebugRenderParams(NvParameterized::Traits* traits, void* buf = 0, int32_t* refCount = 0); + + virtual ~DebugRenderParams(); + + virtual void destroy(); + + static const char* staticClassName(void) + { + return("DebugRenderParams"); + } + + 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(DebugRenderParamsNS::checksum); + return DebugRenderParamsNS::checksum; + } + + static void freeParameterDefinitionTable(NvParameterized::Traits* traits); + + const uint32_t* checksum(uint32_t& bits) const + { + return staticChecksum(bits); + } + + const DebugRenderParamsNS::ParametersStruct& parameters(void) const + { + DebugRenderParams* tmpThis = const_cast<DebugRenderParams*>(this); + return *(static_cast<DebugRenderParamsNS::ParametersStruct*>(tmpThis)); + } + + DebugRenderParamsNS::ParametersStruct& parameters(void) + { + return *(static_cast<DebugRenderParamsNS::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 DebugRenderParamsFactory : public NvParameterized::Factory +{ + static const char* const vptr; + +public: + + virtual void freeParameterDefinitionTable(NvParameterized::Traits* traits) + { + DebugRenderParams::freeParameterDefinitionTable(traits); + } + + virtual NvParameterized::Interface* create(NvParameterized::Traits* paramTraits) + { + // placement new on this class using mParameterizedTraits + + void* newPtr = paramTraits->alloc(sizeof(DebugRenderParams), DebugRenderParams::ClassAlignment); + if (!NvParameterized::IsAligned(newPtr, DebugRenderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class DebugRenderParams"); + paramTraits->free(newPtr); + return 0; + } + + memset(newPtr, 0, sizeof(DebugRenderParams)); // always initialize memory allocated to zero for default values + return NV_PARAM_PLACEMENT_NEW(newPtr, DebugRenderParams)(paramTraits); + } + + virtual NvParameterized::Interface* finish(NvParameterized::Traits* paramTraits, void* bufObj, void* bufStart, int32_t* refCount) + { + if (!NvParameterized::IsAligned(bufObj, DebugRenderParams::ClassAlignment) + || !NvParameterized::IsAligned(bufStart, DebugRenderParams::ClassAlignment)) + { + NV_PARAM_TRAITS_WARNING(paramTraits, "Unaligned memory allocation for class DebugRenderParams"); + return 0; + } + + // Init NvParameters-part + // We used to call empty constructor of DebugRenderParams 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 (DebugRenderParams*)bufObj; + } + + virtual const char* getClassName() + { + return (DebugRenderParams::staticClassName()); + } + + virtual uint32_t getVersion() + { + return (DebugRenderParams::staticVersion()); + } + + virtual uint32_t getAlignment() + { + return (DebugRenderParams::ClassAlignment); + } + + virtual const uint32_t* getChecksum(uint32_t& bits) + { + return (DebugRenderParams::staticChecksum(bits)); + } +}; +#endif // NV_PARAMETERIZED_ONLY_LAYOUTS + +} // namespace apex +} // namespace nvidia + +#if PX_VC +#pragma warning(pop) +#endif + +#endif diff --git a/sdk/extensions/import/apexmodules/modules/common/include/autogen/ModuleCommonRegistration.h b/sdk/extensions/import/apexmodules/modules/common/include/autogen/ModuleCommonRegistration.h new file mode 100644 index 0000000..febd374 --- /dev/null +++ b/sdk/extensions/import/apexmodules/modules/common/include/autogen/ModuleCommonRegistration.h @@ -0,0 +1,120 @@ +/* + * 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_MODULECOMMONREGISTRATIONH_H +#define MODULE_MODULECOMMONREGISTRATIONH_H + +#include "PsAllocator.h" +#include "NvRegistrationsForTraitsBase.h" +#include "nvparameterized/NvParameterizedTraits.h" +#include "PxAssert.h" +#include <stdint.h> + +// INCLUDE GENERATED FACTORIES +#include "ConvexHullParameters.h" +#include "DebugColorParams.h" +#include "DebugRenderParams.h" + + +// INCLUDE GENERATED CONVERSION + + +namespace nvidia { +namespace apex { + + +class ModuleCommonRegistration : public NvParameterized::RegistrationsForTraitsBase +{ +public: + static void invokeRegistration(NvParameterized::Traits* parameterizedTraits) + { + if (parameterizedTraits) + { + ModuleCommonRegistration().registerAll(*parameterizedTraits); + } + } + + static void invokeUnregistration(NvParameterized::Traits* parameterizedTraits) + { + if (parameterizedTraits) + { + ModuleCommonRegistration().unregisterAll(*parameterizedTraits); + } + } + + void registerAvailableFactories(NvParameterized::Traits& parameterizedTraits) + { + ::NvParameterized::Factory* factoriesToRegister[] = { +// REGISTER GENERATED FACTORIES + new nvidia::apex::ConvexHullParametersFactory(), + new nvidia::apex::DebugColorParamsFactory(), + new nvidia::apex::DebugRenderParamsFactory(), + + }; + + 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::apex::ConvexHullParametersFactory(), + new nvidia::apex::DebugColorParamsFactory(), + new nvidia::apex::DebugRenderParamsFactory(), + + }; + + 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::apex + +#endif |