APEX Framework: UserRenderVertexBufferDesc.h Source File

NVIDIA APEX

UserRenderVertexBufferDesc.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef USER_RENDER_VERTEX_BUFFER_DESC_H
00013 #define USER_RENDER_VERTEX_BUFFER_DESC_H
00014 
00020 #include "ApexUsingNamespace.h"
00021 #include "UserRenderResourceManager.h"
00022 #include "RenderDataFormat.h"
00023 #include "ApexSDK.h"
00024 
00025 namespace physx
00026 {
00027     class PxCudaContextManager;
00028 };
00029 
00030 namespace nvidia
00031 {
00032 namespace apex
00033 {
00034 
00035 PX_PUSH_PACK_DEFAULT
00036 
00040 struct RenderVertexSemantic
00041 {
00045     enum Enum
00046     {
00047         CUSTOM = -1,            
00048 
00049         POSITION = 0,           
00050         NORMAL,                 
00051         TANGENT,                
00052         BINORMAL,               
00053         COLOR,                  
00054         TEXCOORD0,              
00055         TEXCOORD1,              
00056         TEXCOORD2,              
00057         TEXCOORD3,              
00058         BONE_INDEX,             
00059         BONE_WEIGHT,            
00060 
00061         DISPLACEMENT_TEXCOORD,  
00062         DISPLACEMENT_FLAGS,     
00063 
00064         NUM_SEMANTICS           
00065     };
00066 };
00067 
00071 struct TextureUVOrigin
00072 {
00076     enum Enum
00077     {
00078         ORIGIN_TOP_LEFT = 0,        
00079         ORIGIN_TOP_RIGHT = 1,       
00080         ORIGIN_BOTTOM_LEFT = 2,     
00081         ORIGIN_BOTTOM_RIGHT = 3,    
00082 
00083         ORIGIN_UNKNOWN = 0xFFFFFFFF 
00084     };
00085 };
00086 
00087 
00091 class UserRenderVertexBufferDesc
00092 {
00093 public:
00094     UserRenderVertexBufferDesc(void)
00095     {
00096         interopContext = 0;
00097         registerInCUDA = false;
00098         maxVerts = 0;
00099         hint     = RenderBufferHint::STATIC;
00100         for (uint32_t i = 0; i < RenderVertexSemantic::NUM_SEMANTICS; i++)
00101         {
00102             buffersRequest[i] = RenderDataFormat::UNSPECIFIED;
00103         }
00104         moduleIdentifier = 0;
00105         numCustomBuffers = 0;
00106         customBuffersIdents = NULL;
00107         customBuffersRequest = NULL;
00108         uvOrigin         = TextureUVOrigin::ORIGIN_TOP_LEFT;
00109         canBeShared      = true;
00110     }
00111 
00115     bool isValid(void) const
00116     {
00117         uint32_t numFailed = 0;
00118         if (maxVerts == 0)
00119         {
00120             numFailed++;
00121         }
00122         if (!customBuffersRequest)
00123         {
00124             uint32_t vertexSize = 0;
00125             for (uint32_t i = 0; i < RenderVertexSemantic::NUM_SEMANTICS; i++)
00126             {
00127                 vertexSize += RenderDataFormat::getFormatDataSize(buffersRequest[i]);
00128             }
00129             if (vertexSize == 0)
00130             {
00131                 numFailed++;
00132             }
00133         }
00134         return (numFailed == 0);
00135     }
00136 
00137 public:
00141     uint32_t                    maxVerts;
00142 
00146     RenderBufferHint::Enum      hint;
00147 
00153     RenderDataFormat::Enum      buffersRequest[RenderVertexSemantic::NUM_SEMANTICS];
00154 
00162     uint32_t                    numCustomBuffers;
00163 
00167     void**                      customBuffersIdents;
00168 
00172     RenderDataFormat::Enum*     customBuffersRequest;
00173 
00177     AuthObjTypeID               moduleIdentifier;
00178 
00182     TextureUVOrigin::Enum       uvOrigin;
00183 
00187     bool                        canBeShared;
00188     
00192     bool                        registerInCUDA;
00193 
00200     PxCudaContextManager*       interopContext;
00201 };
00202 
00203 PX_POP_PACK
00204 
00205 }
00206 } // end namespace nvidia::apex
00207 
00208 #endif // USER_RENDER_VERTEX_BUFFER_DESC_H

Generated on Fri Dec 15 2017 13:58:35
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.