UserRenderResourceDesc.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_RESOURCE_DESC_H 00013 #define USER_RENDER_RESOURCE_DESC_H 00014 00020 #include "UserRenderResourceManager.h" 00021 #include "foundation/PxAssert.h" 00022 00023 namespace nvidia 00024 { 00025 namespace apex 00026 { 00027 00028 PX_PUSH_PACK_DEFAULT 00029 00030 class Renderable; 00031 class UserOpaqueMesh; 00032 class UserRenderVertexBuffer; 00033 class UserRenderIndexBuffer; 00034 class UserRenderBoneBuffer; 00035 class UserRenderInstanceBuffer; 00036 class UserRenderSpriteBuffer; 00037 00041 class UserRenderResourceDesc 00042 { 00043 public: 00044 UserRenderResourceDesc(void) 00045 { 00046 firstVertex = 0; 00047 numVerts = 0; 00048 00049 indexBuffer = 0; 00050 firstIndex = 0; 00051 numIndices = 0; 00052 00053 boneBuffer = 0; 00054 firstBone = 0; 00055 numBones = 0; 00056 00057 instanceBuffer = 0; 00058 firstInstance = 0; 00059 numInstances = 0; 00060 00061 spriteBuffer = 0; 00062 firstSprite = 0; 00063 numSprites = 0; 00064 visibleSpriteCount = 0; 00065 00066 material = 0; 00067 submeshIndex = 0; 00068 00069 userRenderData = 0; 00070 00071 numVertexBuffers = 0; 00072 vertexBuffers = NULL; 00073 00074 cullMode = RenderCullMode::CLOCKWISE; 00075 primitives = RenderPrimitiveType::UNKNOWN; 00076 00077 opaqueMesh = NULL; 00078 } 00079 00083 bool isValid(void) const 00084 { 00085 uint32_t numFailed = 0; 00086 if (numVertexBuffers >= 255) 00087 { 00088 numFailed++; 00089 } 00090 if (numIndices && !indexBuffer) 00091 { 00092 numFailed++; 00093 } 00094 if (numBones && !boneBuffer) 00095 { 00096 numFailed++; 00097 } 00098 if (numInstances && !instanceBuffer) 00099 { 00100 numFailed++; 00101 } 00102 if (numSprites && !spriteBuffer) 00103 { 00104 numFailed++; 00105 } 00106 PX_ASSERT(numFailed == 0); 00107 return numFailed == 0; 00108 } 00109 00110 public: 00111 UserOpaqueMesh* opaqueMesh; 00112 UserRenderVertexBuffer** vertexBuffers; 00113 00114 uint32_t numVertexBuffers; 00115 00116 uint32_t firstVertex; 00117 uint32_t numVerts; 00118 00119 UserRenderIndexBuffer* indexBuffer; 00120 uint32_t firstIndex; 00121 uint32_t numIndices; 00122 00123 UserRenderBoneBuffer* boneBuffer; 00124 uint32_t firstBone; 00125 uint32_t numBones; 00126 00127 UserRenderInstanceBuffer* instanceBuffer; 00128 uint32_t firstInstance; 00129 uint32_t numInstances; 00130 00131 UserRenderSpriteBuffer* spriteBuffer; 00132 uint32_t firstSprite; 00133 uint32_t numSprites; 00134 uint32_t visibleSpriteCount; 00135 00136 UserRenderSurfaceBuffer** surfaceBuffers; 00137 uint32_t numSurfaceBuffers; 00138 uint32_t widthSurfaceBuffers; 00139 uint32_t heightSurfaceBuffers; 00140 00141 void* material; 00142 uint32_t submeshIndex; 00143 00145 void* userRenderData; 00146 00147 RenderCullMode::Enum cullMode; 00148 RenderPrimitiveType::Enum primitives; 00149 }; 00150 00151 PX_POP_PACK 00152 00153 } 00154 } // end namespace nvidia::apex 00155 00156 #endif
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.