From 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 Mon Sep 17 00:00:00 2001 From: git perforce import user Date: Tue, 25 Oct 2016 12:29:14 -0600 Subject: Initial commit: PhysX 3.4.0 Update @ 21294896 APEX 1.4.0 Update @ 21275617 [CL 21300167] --- APEX_1.4/include/UserRenderIndexBufferDesc.h | 111 +++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 APEX_1.4/include/UserRenderIndexBufferDesc.h (limited to 'APEX_1.4/include/UserRenderIndexBufferDesc.h') diff --git a/APEX_1.4/include/UserRenderIndexBufferDesc.h b/APEX_1.4/include/UserRenderIndexBufferDesc.h new file mode 100644 index 00000000..e8c1fd92 --- /dev/null +++ b/APEX_1.4/include/UserRenderIndexBufferDesc.h @@ -0,0 +1,111 @@ +/* + * 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 USER_RENDER_INDEX_BUFFER_DESC_H +#define USER_RENDER_INDEX_BUFFER_DESC_H + +/*! +\file +\brief class UserRenderIndexBufferDesc, structs RenderDataFormat and UserRenderIndexBufferDesc +*/ + +#include "RenderDataFormat.h" +#include "UserRenderResourceManager.h" + +namespace physx +{ + class PxCudaContextManager; +}; + +namespace nvidia +{ +namespace apex +{ + +PX_PUSH_PACK_DEFAULT + +#if !PX_PS4 + #pragma warning(push) + #pragma warning(disable:4121) +#endif //!PX_PS4 + +/** +\brief describes the semantics and layout of an index buffer +*/ +class UserRenderIndexBufferDesc +{ +public: + UserRenderIndexBufferDesc(void) + { + registerInCUDA = false; + interopContext = 0; + maxIndices = 0; + hint = RenderBufferHint::STATIC; + format = RenderDataFormat::UNSPECIFIED; + primitives = RenderPrimitiveType::TRIANGLES; + } + + /** + \brief Check if parameter's values are correct + */ + bool isValid(void) const + { + uint32_t numFailed = 0; + numFailed += (registerInCUDA && !interopContext) ? 1 : 0; + return (numFailed == 0); + } + +public: + + /** + \brief The maximum amount of indices this buffer will ever hold. + */ + uint32_t maxIndices; + + /** + \brief Hint on how often this buffer is updated + */ + RenderBufferHint::Enum hint; + + /** + \brief The format of this buffer (only one implied semantic) + */ + RenderDataFormat::Enum format; + + /** + \brief Rendering primitive type (triangle, line strip, etc) + */ + RenderPrimitiveType::Enum primitives; + + /** + \brief Declare if the resource must be registered in CUDA upon creation + */ + bool registerInCUDA; + + /** + \brief The CUDA context + + This context must be used to register and unregister the resource every time the + device is lost and recreated. + */ + PxCudaContextManager* interopContext; +}; + +#if !PX_PS4 + #pragma warning(pop) +#endif //!PX_PS4 + +PX_POP_PACK + +} +} // end namespace nvidia::apex + +#endif // USER_RENDER_INDEX_BUFFER_DESC_H -- cgit v1.2.3