| CgFx.h | | CgFx.h | |
| | | | |
| skipping to change at line 2253 | | skipping to change at line 2253 | |
| */ | | */ | |
| NVSG_API bool isLightParameter(CgFxParameter param) const; | | NVSG_API bool isLightParameter(CgFxParameter param) const; | |
| | | | |
| /*! \brief Returns wheteher the specified parameter represents a light po
sition. | | /*! \brief Returns wheteher the specified parameter represents a light po
sition. | |
| * \param param Parameter to query. | | * \param param Parameter to query. | |
| * \return | | * \return | |
| * The function returns \c true if the specified parameter represents a l
ight position. | | * The function returns \c true if the specified parameter represents a l
ight position. | |
| * \remarks | | * \remarks | |
| * \ref lightpositionparameters fall into the category of \ref autoconnec
tedeffectparameters. | | * \ref lightpositionparameters fall into the category of \ref autoconnec
tedeffectparameters. | |
| */ | | */ | |
|
| NVSG_API unsigned int isLightPositionParameter(CgFxParameter param) const
; | | NVSG_API bool isLightPositionParameter(CgFxParameter param) const; | |
| | | | |
| /*! \brief Returns wheteher the specified parameter represents a light di
rection. | | /*! \brief Returns wheteher the specified parameter represents a light di
rection. | |
| * \param param Parameter to query. | | * \param param Parameter to query. | |
| * \return | | * \return | |
| * The function returns \c true if the specified parameter represents a l
ight direction. | | * The function returns \c true if the specified parameter represents a l
ight direction. | |
| * \remarks | | * \remarks | |
| * \ref lightdirectionparameters fall into the category of \ref autoconne
ctedeffectparameters. | | * \ref lightdirectionparameters fall into the category of \ref autoconne
ctedeffectparameters. | |
| */ | | */ | |
|
| NVSG_API unsigned int isLightDirectionParameter(CgFxParameter param) cons
t; | | NVSG_API bool isLightDirectionParameter(CgFxParameter param) const; | |
| | | | |
| /*! \brief Returns wheteher the specified parameter represents a light ty
pe. | | /*! \brief Returns wheteher the specified parameter represents a light ty
pe. | |
| * \param param Parameter to query. | | * \param param Parameter to query. | |
| * \return | | * \return | |
| * The function returns \c true if the specified parameter represents a l
ight type. | | * The function returns \c true if the specified parameter represents a l
ight type. | |
| * \remarks | | * \remarks | |
| * \ref lighttypeparameters fall into the category of \ref autoconnectede
ffectparameters. | | * \ref lighttypeparameters fall into the category of \ref autoconnectede
ffectparameters. | |
| */ | | */ | |
|
| NVSG_API unsigned int isLightTypeParameter(CgFxParameter param) const; | | NVSG_API bool isLightTypeParameter(CgFxParameter param) const; | |
| | | | |
| /*! \brief Returns whether the specified parameter specifies an array of
light parameters. | | /*! \brief Returns whether the specified parameter specifies an array of
light parameters. | |
| * \param param Parameter to query. | | * \param param Parameter to query. | |
| * \return | | * \return | |
| * The function returns \c true if the specified parameter specifies an
array of | | * The function returns \c true if the specified parameter specifies an
array of | |
| * \ref lightparameters. Otherwise, the function returns \c false. | | * \ref lightparameters. Otherwise, the function returns \c false. | |
| * \remarks | | * \remarks | |
| * \ref lightparameters fall into the category of \ref autoconnectedeffe
ctparameters. | | * \ref lightparameters fall into the category of \ref autoconnectedeffe
ctparameters. | |
| */ | | */ | |
| NVSG_API bool isLightArrayParameter(CgFxParameter param) const; | | NVSG_API bool isLightArrayParameter(CgFxParameter param) const; | |
| | | | |
|
| | | /*! \brief Returns whether the specified parameter specifies a dynamic ar | |
| | | ray of light parameters. | |
| | | * \param param Parameter to query. | |
| | | * \return | |
| | | * The function returns \c true if the specified parameter specifies a d | |
| | | ynamic array of | |
| | | * \ref lightparameters. Otherwise, the function returns \c false. | |
| | | * \remarks | |
| | | * \ref lightparameters fall into the category of \ref autoconnectedeffe | |
| | | ctparameters. | |
| | | */ | |
| | | NVSG_API bool isDynamicLightArrayParameter(CgFxParameter param) const; | |
| | | | |
| /*! \brief Returns whether the specified parameter represents a \ref mate
rialparameter. | | /*! \brief Returns whether the specified parameter represents a \ref mate
rialparameter. | |
| * \param | | * \param | |
| * param Parameter to query. | | * param Parameter to query. | |
| * \return | | * \return | |
| * The function returns \c true if \a param is a material parameter. | | * The function returns \c true if \a param is a material parameter. | |
| * Otherwise, the function returns \c false. | | * Otherwise, the function returns \c false. | |
| * \remarks | | * \remarks | |
| * A \ref materialparameter falls into the category of \ref autoconnecte
deffectparameters. | | * A \ref materialparameter falls into the category of \ref autoconnecte
deffectparameters. | |
| */ | | */ | |
| NVSG_API bool isMaterialParameter(CgFxParameter param) const; | | NVSG_API bool isMaterialParameter(CgFxParameter param) const; | |
| | | | |
| skipping to change at line 2512 | | skipping to change at line 2522 | |
| /*! \brief Returns a light parameter by name. | | /*! \brief Returns a light parameter by name. | |
| * \param | | * \param | |
| * name Name string used to look up the light parameter. | | * name Name string used to look up the light parameter. | |
| * \return | | * \return | |
| * The function returns a valid handle to the \ref lightparameters "light
parameter" with the | | * The function returns a valid handle to the \ref lightparameters "light
parameter" with the | |
| * specified name, if found. Otherwise, the function returns NULL, to ind
icate that a light | | * specified name, if found. Otherwise, the function returns NULL, to ind
icate that a light | |
| * parameter with that name does not exist. | | * parameter with that name does not exist. | |
| */ | | */ | |
| NVSG_API CgFxParameter getLightByName(const std::string& name) const; | | NVSG_API CgFxParameter getLightByName(const std::string& name) const; | |
| | | | |
|
| | | /*! \brief Returns whether this effect contains a dynamically sized light | |
| | | array | |
| | | * \return \c true, if the effect contains a dynamically sized light arra | |
| | | y, \c false otherwise. | |
| | | * \remarks An effect can either contain a dynamically sized light array | |
| | | or a number of normal lights and light arrays. | |
| | | */ | |
| | | NVSG_API bool hasDynamicNumberOfLights() const; | |
| | | | |
| | | /*! \brief Set the desired number of lights of a dynamically sized light | |
| | | array | |
| | | * \param num The number of lights the effect should have | |
| | | * \remarks An effect can either contain a dynamically sized light array | |
| | | or a number of normal lights and light arrays. | |
| | | * If the \c num is equal to the current number of lights, the function h | |
| | | as no effect. | |
| | | */ | |
| | | NVSG_API void setDynamicNumberOfLights(unsigned int num); | |
| | | | |
| | | /*! \brief Get the current number of lights | |
| | | * \return The current number of lights, if the effect contains a dynamic | |
| | | array of lights. | |
| | | */ | |
| | | NVSG_API unsigned int getDynamicNumberOfLights() const; | |
| | | | |
| /*! \brief Returns the effects \ref materialparameter if available. | | /*! \brief Returns the effects \ref materialparameter if available. | |
| * \return | | * \return | |
| * The function returns a valid handle to the material parameter, if ava
ilable. | | * The function returns a valid handle to the material parameter, if ava
ilable. | |
| * Otherwise, the function returns NULL, to indicate that a material par
ameter is not available | | * Otherwise, the function returns NULL, to indicate that a material par
ameter is not available | |
| * for this effect. | | * for this effect. | |
| * \remarks | | * \remarks | |
| * A \ref materialparameter falls into the category of \ref autoconnecte
deffectparameters | | * A \ref materialparameter falls into the category of \ref autoconnecte
deffectparameters | |
| * \sa nvsg::Material, CgFxEffect::isMaterialParameter | | * \sa nvsg::Material, CgFxEffect::isMaterialParameter | |
| */ | | */ | |
| NVSG_API CgFxParameter getMaterial() const; | | NVSG_API CgFxParameter getMaterial() const; | |
| | | | |
| /*! \brief Returns the effect's \ref sceneparameter | | /*! \brief Returns the effect's \ref sceneparameter | |
| * \return | | * \return | |
| * The function returns a valid handle to the NVSGScene parameter, if av
ailable. | | * The function returns a valid handle to the NVSGScene parameter, if av
ailable. | |
| * Otherwise, the function returns NULL, to indicate that a scene parame
ter is not available | | * Otherwise, the function returns NULL, to indicate that a scene parame
ter is not available | |
| * for this effect. Note that this is NOT the nvsg::Scene, but the | | * for this effect. Note that this is NOT the nvsg::Scene, but the | |
| * NVSGScene data structure that may be defined in the effect! | | * NVSGScene data structure that may be defined in the effect! | |
|
| * \remarks | | | |
| * A \ref materialparameter falls into the category of \ref autoconnecte | | | |
| deffectparameters | | | |
| * \sa nvsg::Scene, CgFxEffect::isSceneParameter | | * \sa nvsg::Scene, CgFxEffect::isSceneParameter | |
| */ | | */ | |
| NVSG_API CgFxParameter getScene() const; | | NVSG_API CgFxParameter getScene() const; | |
| | | | |
| /*! \brief Returns a numeric-type parameter value as 32-bit float values. | | /*! \brief Returns a numeric-type parameter value as 32-bit float values. | |
| * \param | | * \param | |
| * param Handle to the parameter to retrieve the value from. | | * param Handle to the parameter to retrieve the value from. | |
| * \param | | * \param | |
| * value Pointer to the buffer that receives the float values. | | * value Pointer to the buffer that receives the float values. | |
| * \return | | * \return | |
| | | | |
| skipping to change at line 4987 | | skipping to change at line 5013 | |
| { | | { | |
| SharedParams(); | | SharedParams(); | |
| ~SharedParams(); | | ~SharedParams(); | |
| | | | |
| CgFxParameter m_scene; // NVSGScene | | CgFxParameter m_scene; // NVSGScene | |
| | | | |
| // NVSG transforms known by semantic | | // NVSG transforms known by semantic | |
| std::vector<CgFxParameter> m_transforms; | | std::vector<CgFxParameter> m_transforms; | |
| | | | |
| std::vector<CgFxParameter> m_lights; // NVSGLights | | std::vector<CgFxParameter> m_lights; // NVSGLights | |
|
| | | CgFxParameter m_dynamicLightArray; // dynamic array of NVSGLights in
CgFxEffect | |
| CgFxParameter m_material; // NVSGMaterial | | CgFxParameter m_material; // NVSGMaterial | |
| | | | |
| // MetaSL light params | | // MetaSL light params | |
| std::vector<CgFxParameter> m_lightPositions; | | std::vector<CgFxParameter> m_lightPositions; | |
| std::vector<CgFxParameter> m_lightDirections; | | std::vector<CgFxParameter> m_lightDirections; | |
| std::vector<CgFxParameter> m_lightTypes; | | std::vector<CgFxParameter> m_lightTypes; | |
| | | | |
| struct StateLabel { | | struct StateLabel { | |
| StateLabel() : m_first(~0), m_second(~0) {} | | StateLabel() : m_first(~0), m_second(~0) {} | |
| size_t m_first; | | size_t m_first; | |
| | | | |
End of changes. 7 change blocks. |
| 6 lines changed or deleted | | 42 lines changed or added | |
|
| CgmFx.h | | CgmFx.h | |
| | | | |
| skipping to change at line 66 | | skipping to change at line 66 | |
| #define cgsGetLastListing cgGetLastListing | | #define cgsGetLastListing cgGetLastListing | |
| #define cgsIsProgram cgIsProgram | | #define cgsIsProgram cgIsProgram | |
| #define cgsCompileProgram cgCompileProgram | | #define cgsCompileProgram cgCompileProgram | |
| #define cgsIsProgramCompiled cgIsProgramCompiled | | #define cgsIsProgramCompiled cgIsProgramCompiled | |
| #define cgsGetProgramString cgGetProgramString | | #define cgsGetProgramString cgGetProgramString | |
| #define cgsGetProgramProfile cgGetProgramProfile | | #define cgsGetProgramProfile cgGetProgramProfile | |
| #define cgsGetProgramInput cgGetProgramInput | | #define cgsGetProgramInput cgGetProgramInput | |
| #define cgsGetProgramOutput cgGetProgramOutput | | #define cgsGetProgramOutput cgGetProgramOutput | |
| #define cgsGetArrayType cgGetArrayType | | #define cgsGetArrayType cgGetArrayType | |
| #define cgsGetArraySize cgGetArraySize | | #define cgsGetArraySize cgGetArraySize | |
|
| | | #define cgsSetArraySize cgSetArraySize | |
| #define cgsIsParameter cgIsParameter | | #define cgsIsParameter cgIsParameter | |
| #define cgsGetParameterName cgGetParameterName | | #define cgsGetParameterName cgGetParameterName | |
| #define cgsGetParameterType cgGetParameterType | | #define cgsGetParameterType cgGetParameterType | |
| #define cgsGetParameterClass cgGetParameterClass | | #define cgsGetParameterClass cgGetParameterClass | |
| #define cgsGetParameterNamedType cgGetParameterNamedType | | #define cgsGetParameterNamedType cgGetParameterNamedType | |
| #define cgsGetParameterSemantic cgGetParameterSemantic | | #define cgsGetParameterSemantic cgGetParameterSemantic | |
| #define cgsGetParameterDirection cgGetParameterDirection | | #define cgsGetParameterDirection cgGetParameterDirection | |
| #define cgsIsParameterReferenced cgIsParameterReferenced | | #define cgsIsParameterReferenced cgIsParameterReferenced | |
| #define cgsIsParameterUsed cgIsParameterUsed | | #define cgsIsParameterUsed cgIsParameterUsed | |
| #define cgsGetParameterValues cgGetParameterValues | | #define cgsGetParameterValues cgGetParameterValues | |
| #define cgsGetParameterValuefc cgGetParameterValuefc | | #define cgsGetParameterValuefc cgGetParameterValuefc | |
| #define cgsGetParameterValuefr cgGetParameterValuefr | | #define cgsGetParameterValuefr cgGetParameterValuefr | |
| #define cgsGetParameterValueic cgGetParameterValueic | | #define cgsGetParameterValueic cgGetParameterValueic | |
| #define cgsGetStringParameterValue cgGetStringParameterValue | | #define cgsGetStringParameterValue cgGetStringParameterValue | |
| #define cgsSetParameterValuefc cgSetParameterValuefc | | #define cgsSetParameterValuefc cgSetParameterValuefc | |
| #define cgsSetParameterValueic cgSetParameterValueic | | #define cgsSetParameterValueic cgSetParameterValueic | |
|
| | | #define cgsGetArrayParameter cgGetArrayParameter | |
| | | #define cgsDestroyParameter cgDestroyParameter | |
| | | #define cgsConnectParameter cgConnectParameter | |
| | | #define cgsDisconnectParameter cgDisconnectParameter | |
| | | #define cgsGetNamedUserType cgGetNamedUserType | |
| #define cgsSetStringParameterValue cgSetStringParameterValue | | #define cgsSetStringParameterValue cgSetStringParameterValue | |
| #define cgsSetMatrixParameterfc cgSetMatrixParameterfc | | #define cgsSetMatrixParameterfc cgSetMatrixParameterfc | |
| #define cgsGetTechniqueName cgGetTechniqueName | | #define cgsGetTechniqueName cgGetTechniqueName | |
| #define cgsIsTechnique cgIsTechnique | | #define cgsIsTechnique cgIsTechnique | |
| #define cgsValidateTechnique cgValidateTechnique | | #define cgsValidateTechnique cgValidateTechnique | |
| #define cgsIsTechniqueValidated cgIsTechniqueValidated | | #define cgsIsTechniqueValidated cgIsTechniqueValidated | |
| #define cgsIsPass cgIsPass | | #define cgsIsPass cgIsPass | |
| #define cgsGetPassName cgGetPassName | | #define cgsGetPassName cgGetPassName | |
| #define cgsSetPassState cgSetPassState | | #define cgsSetPassState cgSetPassState | |
| #define cgsResetPassState cgResetPassState | | #define cgsResetPassState cgResetPassState | |
| | | | |
| skipping to change at line 159 | | skipping to change at line 165 | |
| #define cgmGetFirstPassAnnotation cgGetFirstPassAnnotation | | #define cgmGetFirstPassAnnotation cgGetFirstPassAnnotation | |
| #define cgmGetFirstParameterAnnotation cgGetFirstParameterAnnotation | | #define cgmGetFirstParameterAnnotation cgGetFirstParameterAnnotation | |
| #define cgmGetNextAnnotation cgGetNextAnnotation | | #define cgmGetNextAnnotation cgGetNextAnnotation | |
| #define cgmCreateSamplerState cgCreateSamplerState | | #define cgmCreateSamplerState cgCreateSamplerState | |
| #define cgmSetFloatStateAssignment cgSetFloatStateAssignment | | #define cgmSetFloatStateAssignment cgSetFloatStateAssignment | |
| #define cgmSetIntStateAssignment cgSetIntStateAssignment | | #define cgmSetIntStateAssignment cgSetIntStateAssignment | |
| #define cgmSetBoolStateAssignment cgSetBoolStateAssignment | | #define cgmSetBoolStateAssignment cgSetBoolStateAssignment | |
| #define cgmSetFloatArrayStateAssignment cgSetFloatArrayStateAssignment | | #define cgmSetFloatArrayStateAssignment cgSetFloatArrayStateAssignment | |
| #define cgmSetIntArrayStateAssignment cgSetIntArrayStateAssignment | | #define cgmSetIntArrayStateAssignment cgSetIntArrayStateAssignment | |
| #define cgmSetBoolArrayStateAssignment cgSetBoolArrayStateAssignment | | #define cgmSetBoolArrayStateAssignment cgSetBoolArrayStateAssignment | |
|
| | | #define cgmCreateParameter cgCreateParameter | |
| | | | |
| #else // #ifdef NVSG_DISABLE_CG_MULTIPLEX | | #else // #ifdef NVSG_DISABLE_CG_MULTIPLEX | |
| | | | |
| // | | // | |
| // Types | | // Types | |
| // | | // | |
| typedef nvutil::RCVector<CGcontext> CGMcontextVec; | | typedef nvutil::RCVector<CGcontext> CGMcontextVec; | |
| typedef nvutil::SmartPtr<CGMcontextVec> CGMcontext; | | typedef nvutil::SmartPtr<CGMcontextVec> CGMcontext; | |
| typedef nvutil::RCVector<CGeffect> CGMeffectVec; | | typedef nvutil::RCVector<CGeffect> CGMeffectVec; | |
| typedef nvutil::SmartPtr<CGMeffectVec> CGMeffect; | | typedef nvutil::SmartPtr<CGMeffectVec> CGMeffect; | |
| | | | |
| skipping to change at line 270 | | skipping to change at line 277 | |
| void cgsCompileProgram(CGMprogram program); | | void cgsCompileProgram(CGMprogram program); | |
| CGbool cgsIsProgramCompiled(CGMprogram program); | | CGbool cgsIsProgramCompiled(CGMprogram program); | |
| const char * cgsGetProgramString(CGMprogram prog, CGenum pname); | | const char * cgsGetProgramString(CGMprogram prog, CGenum pname); | |
| CGprofile cgsGetProgramProfile(CGMprogram prog); | | CGprofile cgsGetProgramProfile(CGMprogram prog); | |
| CGenum cgsGetProgramInput(CGMprogram program); | | CGenum cgsGetProgramInput(CGMprogram program); | |
| CGenum cgsGetProgramOutput(CGMprogram program); | | CGenum cgsGetProgramOutput(CGMprogram program); | |
| | | | |
| // Parameter functions | | // Parameter functions | |
| CGtype cgsGetArrayType(CGMparameter param); | | CGtype cgsGetArrayType(CGMparameter param); | |
| int cgsGetArraySize(CGMparameter param, int dimension); | | int cgsGetArraySize(CGMparameter param, int dimension); | |
|
| | | void cgsSetArraySize(CGMparameter param, int size); | |
| CGbool cgsIsParameter(CGMparameter param); | | CGbool cgsIsParameter(CGMparameter param); | |
| const char * cgsGetParameterName(CGMparameter param); | | const char * cgsGetParameterName(CGMparameter param); | |
| CGtype cgsGetParameterType(CGMparameter param); | | CGtype cgsGetParameterType(CGMparameter param); | |
| CGparameterclass cgsGetParameterClass(CGMparameter param); | | CGparameterclass cgsGetParameterClass(CGMparameter param); | |
| CGtype cgsGetParameterNamedType(CGMparameter param); | | CGtype cgsGetParameterNamedType(CGMparameter param); | |
| const char * cgsGetParameterSemantic(CGMparameter param); | | const char * cgsGetParameterSemantic(CGMparameter param); | |
| CGenum cgsGetParameterDirection(CGMparameter param); | | CGenum cgsGetParameterDirection(CGMparameter param); | |
| CGbool cgsIsParameterReferenced(CGMparameter param); | | CGbool cgsIsParameterReferenced(CGMparameter param); | |
| CGbool cgsIsParameterUsed(CGMparameter param, CGMeffect); | | CGbool cgsIsParameterUsed(CGMparameter param, CGMeffect); | |
| const double * cgsGetParameterValues(CGMparameter param, CGenum value_type,
int *nvalues); | | const double * cgsGetParameterValues(CGMparameter param, CGenum value_type,
int *nvalues); | |
| int cgsGetParameterValuefc(CGMparameter param, int n, float *vals); | | int cgsGetParameterValuefc(CGMparameter param, int n, float *vals); | |
| int cgsGetParameterValuefr(CGMparameter param, int n, float *vals); | | int cgsGetParameterValuefr(CGMparameter param, int n, float *vals); | |
| int cgsGetParameterValueic(CGMparameter param, int n, int *vals); | | int cgsGetParameterValueic(CGMparameter param, int n, int *vals); | |
| const char * cgsGetStringParameterValue(CGMparameter param); | | const char * cgsGetStringParameterValue(CGMparameter param); | |
| void cgsSetParameterValuefc(CGMparameter param, int n, const float *vals); | | void cgsSetParameterValuefc(CGMparameter param, int n, const float *vals); | |
| void cgsSetParameterValueic(CGMparameter param, int n, const int *vals); | | void cgsSetParameterValueic(CGMparameter param, int n, const int *vals); | |
| void cgsSetStringParameterValue(CGMparameter param, const char *str); | | void cgsSetStringParameterValue(CGMparameter param, const char *str); | |
| void cgsSetMatrixParameterfc(CGMparameter param, const float *matrix); | | void cgsSetMatrixParameterfc(CGMparameter param, const float *matrix); | |
| | | | |
|
| | | CGparameter cgsGetArrayParameter( CGMparameter aparam, int index ); | |
| | | void cgsDestroyParameter(CGparameter param); | |
| | | void cgsConnectParameter(CGparameter from, CGparameter to); | |
| | | void cgsDisconnectParameter(CGparameter param); | |
| | | | |
| // Type Functions | | // Type Functions | |
|
| | | CGtype cgsGetNamedUserType(CGMeffect effect, const char *name); | |
| // Resource Functions | | // Resource Functions | |
| // Enum Functions | | // Enum Functions | |
| // Profile Functions | | // Profile Functions | |
| // Error Functions | | // Error Functions | |
| // Misc Functions | | // Misc Functions | |
| | | | |
| // CgFX Functions | | // CgFX Functions | |
| const char * cgsGetTechniqueName(CGMtechnique); | | const char * cgsGetTechniqueName(CGMtechnique); | |
| CGbool cgsIsTechnique(CGMtechnique); | | CGbool cgsIsTechnique(CGMtechnique); | |
| CGbool cgsValidateTechnique(CGMtechnique); | | CGbool cgsValidateTechnique(CGMtechnique); | |
| | | | |
| skipping to change at line 356 | | skipping to change at line 370 | |
| // Parameter functions | | // Parameter functions | |
| CGMparameter cgmGetNextParameter(CGMparameter current); | | CGMparameter cgmGetNextParameter(CGMparameter current); | |
| CGMparameter cgmGetFirstLeafParameter(CGMprogram prog, CGenum name_space); | | CGMparameter cgmGetFirstLeafParameter(CGMprogram prog, CGenum name_space); | |
| CGMparameter cgmGetNextLeafParameter(CGMparameter current); | | CGMparameter cgmGetNextLeafParameter(CGMparameter current); | |
| CGMparameter cgmGetFirstStructParameter(CGMparameter param); | | CGMparameter cgmGetFirstStructParameter(CGMparameter param); | |
| CGMparameter cgmGetArrayParameter(CGMparameter aparam, int index); | | CGMparameter cgmGetArrayParameter(CGMparameter aparam, int index); | |
| void cgmSetParameterValuefc(CGMparameter param, int n, const float *vals); | | void cgmSetParameterValuefc(CGMparameter param, int n, const float *vals); | |
| void cgmSetParameterValueic(CGMparameter param, int n, const int *vals); | | void cgmSetParameterValueic(CGMparameter param, int n, const int *vals); | |
| void cgmSetStringParameterValue(CGMparameter param, const char *str); | | void cgmSetStringParameterValue(CGMparameter param, const char *str); | |
| | | | |
|
| | | CGMparameter cgmCreateParameter(CGMcontext context, CGtype type); | |
| | | void cgmDestroyParameter(CGMparameter param); | |
| | | | |
| // Type Functions | | // Type Functions | |
| // Resource Functions | | // Resource Functions | |
| // Enum Functions | | // Enum Functions | |
| // Profile Functions | | // Profile Functions | |
| // Error Functions | | // Error Functions | |
| // Misc Functions | | // Misc Functions | |
| | | | |
| // CgFX Functions | | // CgFX Functions | |
| CGMeffect cgmCreateEffect(CGMcontext, const char *code, const char **args); | | CGMeffect cgmCreateEffect(CGMcontext, const char *code, const char **args); | |
| CGMeffect cgmCreateEffectFromFile(CGMcontext, const char *filename, const c
har **args); | | CGMeffect cgmCreateEffectFromFile(CGMcontext, const char *filename, const c
har **args); | |
| | | | |
End of changes. 7 change blocks. |
| 0 lines changed or deleted | | 17 lines changed or added | |
|
| Compositor.h | | Compositor.h | |
| | | | |
| skipping to change at line 104 | | skipping to change at line 104 | |
| In most cases the destination Node cannot do meaningful composition work un
til at least | | In most cases the destination Node cannot do meaningful composition work un
til at least | |
| one source Node has completed its portion of the drawing task. In this cas
e, one | | one source Node has completed its portion of the drawing task. In this cas
e, one | |
| image transfer can often be avoided by rendering one fraction of the overal
l | | image transfer can often be avoided by rendering one fraction of the overal
l | |
| drawing task directly into the context associated with the destination Node
. | | drawing task directly into the context associated with the destination Node
. | |
| The Compositor will then be able to combine the images obtained from the so
urce Nodes | | The Compositor will then be able to combine the images obtained from the so
urce Nodes | |
| with this already-waiting image. For this reason, the destination Node mus
t be | | with this already-waiting image. For this reason, the destination Node mus
t be | |
| included when calling setSortOrder() (unless specifying "arbitrary order"). | | included when calling setSortOrder() (unless specifying "arbitrary order"). | |
| | | | |
| */ | | */ | |
| | | | |
|
| #ifndef NVS_COMPOSITOR_H | | #ifndef CPX_COMPOSITOR_H | |
| #define NVS_COMPOSITOR_H | | #define CPX_COMPOSITOR_H | |
| | | | |
|
| #include "nvscale.h" | | #include "complex.h" | |
| | | | |
|
| namespace nvs | | namespace cpx | |
| { | | { | |
| /*! | | /*! | |
| * \brief Node is the interface to the compositor network for a | | * \brief Node is the interface to the compositor network for a | |
| * GL-context/thread. | | * GL-context/thread. | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| * \remarks | | * \remarks | |
| * The Node acts either as an image producer (source Node) or an image | | * The Node acts either as an image producer (source Node) or an image | |
| * consumer (destination Node). The role of a Node is defined by the C
ompositor | | * consumer (destination Node). The role of a Node is defined by the C
ompositor | |
| * at creation time and cannot be changed during the lifetime of the ob
ject | | * at creation time and cannot be changed during the lifetime of the ob
ject | |
| * (see Compositor::getNode). | | * (see Compositor::getNode). | |
| * A Node is tightly associated with the GL context which is current wh
en | | * A Node is tightly associated with the GL context which is current wh
en | |
| * its initialize() method is called. After initialize(), the associat
ed GL | | * its initialize() method is called. After initialize(), the associat
ed GL | |
| * context for a particular Node must ALWAYS be current whenever calls
are | | * context for a particular Node must ALWAYS be current whenever calls
are | |
| * made to that Node's methods. | | * made to that Node's methods. | |
| */ | | */ | |
| class Node | | class Node | |
| { | | { | |
| private: | | private: | |
| Node(const Node &rhs); | | Node(const Node &rhs); | |
| Node &operator=(const Node &rhs); | | Node &operator=(const Node &rhs); | |
| | | | |
| protected: | | protected: | |
| Node() {} | | Node() {} | |
|
| virtual NVS_API ~Node() {} | | virtual CPX_API ~Node() {} | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
| * \brief Initialize the GL-part of a Node on a given current conte
xt. | | * \brief Initialize the GL-part of a Node on a given current conte
xt. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' on success;\n | | * 'CPX_R_SUCCESS' on success;\n | |
| * 'NVS_SYNCHRONIZATION_ERROR' if the node is locked by the Composi | | * 'CPX_R_SYNCHRONIZATION_ERROR' if the node is locked by the Compo | |
| tor | | sitor | |
| * due to a configuration call from another thread;\n | | * due to a configuration call from another thread;\n | |
|
| * 'NVS_INVALID_PIXELFORMAT' if the pixelformat of the current draw
able | | * 'CPX_R_INVALID_PIXELFORMAT' if the pixelformat of the current dr
awable | |
| * is not suitable for compositing;\n | | * is not suitable for compositing;\n | |
|
| * 'NVS_MISSING_EXTENSION' if the Compositor cannot load required G
L | | * 'CPX_R_MISSING_EXTENSION' if the Compositor cannot load required
GL | |
| * extensions;\n | | * extensions;\n | |
|
| * 'NVS_PIXELFORMAT_MISMATCH' if the nodes use drawables of differe
nt | | * 'CPX_R_PIXELFORMAT_MISMATCH' if the nodes use drawables of diffe
rent | |
| * formats;\n | | * formats;\n | |
|
| * 'NVS_INVALID_FBO' if the FBO is of an incorrect format;\n | | * 'CPX_R_INVALID_FBO' if the FBO is of an incorrect format;\n | |
| * 'NVS_GL_ERROR' in case of GL errors.\n | | * 'CPX_R_GL_ERROR' in case of GL errors.\n | |
| * \remarks | | * \remarks | |
| * Depending on Compositor and system configuration, this may (or m
ay | | * Depending on Compositor and system configuration, this may (or m
ay | |
| * not) be a blocking method. In the blocking case, this method wi
ll | | * not) be a blocking method. In the blocking case, this method wi
ll | |
| * not return until all other Nodes have also entered initialize().
For | | * not return until all other Nodes have also entered initialize().
For | |
| * this reason, to avoid deadlock, serial Node initialization must
be | | * this reason, to avoid deadlock, serial Node initialization must
be | |
| * avoided since it causes one Node's entry to initialize() to depe
nd | | * avoided since it causes one Node's entry to initialize() to depe
nd | |
| * circularly on another's exit. Only call Node::initialize() from
a | | * circularly on another's exit. Only call Node::initialize() from
a | |
| * different asynchronous thread for each GPU. | | * different asynchronous thread for each GPU. | |
| */ | | */ | |
|
| virtual NVS_API Result initialize(void) = 0; | | virtual CPX_API Result initialize(void) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Delete GL resources associated with the Node. | | * \brief Delete GL resources associated with the Node. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' on success;\n | | * 'CPX_R_SUCCESS' on success;\n | |
| * 'NVS_SYNCHRONIZATION_ERROR' if the Node is locked by the Composi | | * 'CPX_R_CONTEXT_MISMATCH' if the context bound by initialize() is | |
| tor | | not current;\n | |
| | | * 'CPX_R_SYNCHRONIZATION_ERROR' if the Node is locked by the Compo | |
| | | sitor | |
| * due to a configuration call from another thread;\n | | * due to a configuration call from another thread;\n | |
|
| * 'NVS_GL_ERROR' in case of GL errors.\n | | * 'CPX_R_GL_ERROR' in case of GL errors.\n | |
| */ | | */ | |
|
| virtual NVS_API Result terminate(void) = 0; | | virtual CPX_API Result terminate(void) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Perform the actual compositing step. | | * \brief Perform the actual compositing step. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' on success;\n | | * 'CPX_R_SUCCESS' on success;\n | |
| * 'NVS_SYNCHRONIZATION_ERROR' if the Node is locked by the Composi | | * 'CPX_R_CONTEXT_MISMATCH' if the context bound by initialize() is | |
| tor | | not current;\n | |
| | | * 'CPX_R_SYNCHRONIZATION_ERROR' if the Node is locked by the Compo | |
| | | sitor | |
| * due to a configuration call from another thread;\n | | * due to a configuration call from another thread;\n | |
|
| * 'NVS_RESIZE_FAILED' if the Compositor failed to resize the inter
nal | | * 'CPX_R_RESIZE_FAILED' if the Compositor failed to resize the int
ernal | |
| * buffers involved in compositing;\n | | * buffers involved in compositing;\n | |
|
| * 'NVS_GL_ERROR' in case of GL errors.\n | | * 'CPX_R_GL_ERROR' in case of GL errors.\n | |
| * | | * | |
| * \remarks | | * \remarks | |
| * To execute a complete compositing step this method needs to be c
alled | | * To execute a complete compositing step this method needs to be c
alled | |
| * on all Node instances belonging to the governing Compositor inst
ance. | | * on all Node instances belonging to the governing Compositor inst
ance. | |
| * \remarks | | * \remarks | |
| * If the Node is in the role of an image producer, it will make th
e | | * If the Node is in the role of an image producer, it will make th
e | |
| * image data in its buffer available to the consumer Node, and may | | * image data in its buffer available to the consumer Node, and may | |
| * block until the consumer signals completion before returning. | | * block until the consumer signals completion before returning. | |
| * \remarks | | * \remarks | |
| * If the Node is in the consumer role, it will wait for the produc
ers | | * If the Node is in the consumer role, it will wait for the produc
ers | |
| | | | |
| skipping to change at line 212 | | skipping to change at line 214 | |
| * - No Node may depend on the return of another Node from composit
e() | | * - No Node may depend on the return of another Node from composit
e() | |
| * in order to initiate its own composite() call. | | * in order to initiate its own composite() call. | |
| * | | * | |
| * \b Guarantees\b : (NOT barrier-like) | | * \b Guarantees\b : (NOT barrier-like) | |
| * - As soon as composite() returns on any Node, that Node is free
(and | | * - As soon as composite() returns on any Node, that Node is free
(and | |
| * encouraged) to begin other work or start on the next frame. | | * encouraged) to begin other work or start on the next frame. | |
| * - When composite() returns on the consumer Node (only), all othe
r | | * - When composite() returns on the consumer Node (only), all othe
r | |
| * Nodes have at least begun their own composite() calls, and som
e may | | * Nodes have at least begun their own composite() calls, and som
e may | |
| * have completed them and moved on. | | * have completed them and moved on. | |
| */ | | */ | |
|
| virtual NVS_API Result composite(void)=0; | | virtual CPX_API Result composite(void)=0; | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| * \brief Helper class to specify a rectangle. | | * \brief Helper class to specify a rectangle. | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| */ | | */ | |
| class Rect | | class Rect | |
| { | | { | |
| public: | | public: | |
| /*! | | /*! | |
| * \brief Construct an invalid, but legal Rect | | * \brief Construct an invalid, but legal Rect | |
| * \remarks | | * \remarks | |
| * A valid Rect must have non-negative extent, but this particular | | * A valid Rect must have non-negative extent, but this particular | |
| * invalid Rect is legal for use in some cases. This is the ONLY | | * invalid Rect is legal for use in some cases. This is the ONLY | |
| * legal but invalid Rect. | | * legal but invalid Rect. | |
| */ | | */ | |
|
| NVS_API Rect(void) | | CPX_API Rect(void) | |
| : x(-1), y(-1), w(-1), h(-1) | | : x(-1), y(-1), w(-1), h(-1) | |
| {} | | {} | |
| | | | |
| /*! | | /*! | |
| * \brief Construct a Rect with the given extent, centered at the o
rigin. | | * \brief Construct a Rect with the given extent, centered at the o
rigin. | |
| */ | | */ | |
|
| NVS_API Rect(int _w, int _h) | | CPX_API Rect(int _w, int _h) | |
| : x(0), y(0), w(_w), h(_h) | | : x(0), y(0), w(_w), h(_h) | |
| {} | | {} | |
| | | | |
| /*! | | /*! | |
| * \brief Construct a Rect with explicit control over position and
extent. | | * \brief Construct a Rect with explicit control over position and
extent. | |
| */ | | */ | |
|
| NVS_API Rect(int _x, int _y, int _w, int _h) | | CPX_API Rect(int _x, int _y, int _w, int _h) | |
| : x(_x), y(_y), w(_w), h(_h) | | : x(_x), y(_y), w(_w), h(_h) | |
| {} | | {} | |
| | | | |
| /*! | | /*! | |
| * \brief Test if the receiver is legal to use. | | * \brief Test if the receiver is legal to use. | |
| * \return | | * \return | |
| * 'true' if the receiver is valid or the special invalid Rect, | | * 'true' if the receiver is valid or the special invalid Rect, | |
| * 'false' otherwise. | | * 'false' otherwise. | |
| */ | | */ | |
|
| NVS_API bool isLegal(void) const; | | CPX_API bool isLegal(void) const; | |
| | | | |
| /*! | | /*! | |
| * \brief Test if the receiver is valid. | | * \brief Test if the receiver is valid. | |
| * \return | | * \return | |
| * 'true' if the receiver has positive extent, 'false' otherwise. | | * 'true' if the receiver has positive extent, 'false' otherwise. | |
| */ | | */ | |
| // In debug builds, this asserts at least isLegal(), whether valid
or not. | | // In debug builds, this asserts at least isLegal(), whether valid
or not. | |
|
| NVS_API bool isValid(void) const; | | CPX_API bool isValid(void) const; | |
| | | | |
| public: | | public: | |
| int x; //!< left coordinate of the lower-left poin
t | | int x; //!< left coordinate of the lower-left poin
t | |
| int y; //!< bottom coordinate of the lower-left po
int | | int y; //!< bottom coordinate of the lower-left po
int | |
| int w; //!< extent to the right | | int w; //!< extent to the right | |
| int h; //!< extent upwards | | int h; //!< extent upwards | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| * \brief The class used to configure and manage Nodes. | | * \brief The class used to configure and manage Nodes. | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| * \remarks | | * \remarks | |
| * The actual composition event is triggered through the Nodes received
from | | * The actual composition event is triggered through the Nodes received
from | |
| * this class, but it is configured via setLayout and setSortOrder here
. | | * this class, but it is configured via setLayout and setSortOrder here
. | |
| * The details of the composition operation are determined by the | | * The details of the composition operation are determined by the | |
| * CompositionTechnique for which the Compositor was created by the Fac
tory | | * CompositionTechnique for which the Compositor was created by the Fac
tory | |
|
| * (ex: NVS_CT_DEPTH). A Compositor instance is not bound to any parti
cular | | * (ex: CPX_CT_DEPTH). A Compositor instance is not bound to any parti
cular | |
| * thread or GL context. However, the client must assure that it is ne
ver | | * thread or GL context. However, the client must assure that it is ne
ver | |
| * accessed concurrently by multiple threads, or while any thread is ca
lling | | * accessed concurrently by multiple threads, or while any thread is ca
lling | |
| * a method on any of its constituent Nodes. In many cases, concurrent | | * a method on any of its constituent Nodes. In many cases, concurrent | |
| * access can be detected, but the result is function failure with the | | * access can be detected, but the result is function failure with the | |
|
| * NVS_SYNCHRONIZATION_ERROR Result code. As each such return represen
ts a | | * CPX_R_SYNCHRONIZATION_ERROR Result code. As each such return repres
ents a | |
| * non-deterministic failure, care should be taken to ensure that | | * non-deterministic failure, care should be taken to ensure that | |
|
| * NVS_SYNCHRONIZATION_ERROR results NEVER crop up. | | * CPX_R_SYNCHRONIZATION_ERROR results NEVER crop up. | |
| */ | | */ | |
| class Compositor | | class Compositor | |
| { | | { | |
| private: | | private: | |
| Compositor(const Compositor &rhs); | | Compositor(const Compositor &rhs); | |
| Compositor &operator=(const Compositor &rhs); | | Compositor &operator=(const Compositor &rhs); | |
| | | | |
| protected: | | protected: | |
| friend class FactoryImpl; | | friend class FactoryImpl; | |
| Compositor() {} | | Compositor() {} | |
| | | | |
| skipping to change at line 311 | | skipping to change at line 313 | |
| * \param idx | | * \param idx | |
| * Index of the Node to get. The Node with idx==0 is the destinatio
n | | * Index of the Node to get. The Node with idx==0 is the destinatio
n | |
| * Node; other Nodes are source Nodes (see Node for more descriptio
n). | | * Node; other Nodes are source Nodes (see Node for more descriptio
n). | |
| * \return | | * \return | |
| * Pointer to the Node instance, or NULL if idx is invalid. | | * Pointer to the Node instance, or NULL if idx is invalid. | |
| * \remarks | | * \remarks | |
| * The lifetime of Nodes is bound to the lifetime of the | | * The lifetime of Nodes is bound to the lifetime of the | |
| * Compositor, i.e. Nodes are created and destroyed with the | | * Compositor, i.e. Nodes are created and destroyed with the | |
| * Compositor, invalidating all pointers obtained through this meth
od. | | * Compositor, invalidating all pointers obtained through this meth
od. | |
| */ | | */ | |
|
| virtual NVS_API Node* getNode(int idx)=0; | | virtual CPX_API Node* getNode(int idx)=0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get the number of Nodes in the Compositor network. | | * \brief Get the number of Nodes in the Compositor network. | |
| * \return | | * \return | |
| * Number of Nodes in the Compositor network. | | * Number of Nodes in the Compositor network. | |
| */ | | */ | |
|
| virtual NVS_API int getNumNodes(void)=0; | | virtual CPX_API int getNumNodes(void)=0; | |
| | | | |
| /*! | | /*! | |
| * \brief Specifiy how source tiles are mapped to destination tiles
. | | * \brief Specifiy how source tiles are mapped to destination tiles
. | |
| * \param srcNodeIndex | | * \param srcNodeIndex | |
| * The source Node index from which the rectangle of source image d
ata | | * The source Node index from which the rectangle of source image d
ata | |
|
| * is read. If srcNodeIndex is set to NVS_ALL_NODES the layout is
applied to | | * is read. If srcNodeIndex is set to CPX_ALL_NODES the layout is
applied to | |
| * all source nodes; otherwise note that the Node with index 0 is n
ot a source | | * all source nodes; otherwise note that the Node with index 0 is n
ot a source | |
| * Node, and setLayout may not be called on it directly. | | * Node, and setLayout may not be called on it directly. | |
| * \param srcRect | | * \param srcRect | |
| * The rectangle from which source image data is read. Relative to
the | | * The rectangle from which source image data is read. Relative to
the | |
| * current viewport on the source Node. | | * current viewport on the source Node. | |
| * \param dstRect | | * \param dstRect | |
| * The rectangle into which source image data is composited in the | | * The rectangle into which source image data is composited in the | |
| * destination buffer. Relative to the viewport on the destination | | * destination buffer. Relative to the viewport on the destination | |
| * Node. By default, dstRect is assumed to be the same as srcRect,
but | | * Node. By default, dstRect is assumed to be the same as srcRect,
but | |
| * note that this can produce unexpected results if the correspondi
ng | | * note that this can produce unexpected results if the correspondi
ng | |
| * viewports are NOT the same. | | * viewports are NOT the same. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' on success, | | * 'CPX_R_SUCCESS' on success, | |
| * 'NVS_SYNCHRONIZATION_ERROR' if one of the Nodes is active, | | * 'CPX_R_SYNCHRONIZATION_ERROR' if one of the Nodes is active, | |
| * 'NVS_INVALID_OBJECT' if srcNodeIndex does not name a Node (or AL | | * 'CPX_R_INVALID_OBJECT' if srcNodeIndex does not name a Node (or | |
| L_NODES), | | ALL_NODES), | |
| * 'NVS_INVALID_VALUE' if the srcRect or dstRect is invalid. | | * 'CPX_R_INVALID_VALUE' if the srcRect or dstRect is invalid. | |
| * \remarks | | * \remarks | |
| * The method will only succeed if all Compositor Nodes are outside
the | | * The method will only succeed if all Compositor Nodes are outside
the | |
| * composite call. This functions creates/resizes all Compositor | | * composite call. This functions creates/resizes all Compositor | |
| * internal buffers. Therefore this function must be called before | | * internal buffers. Therefore this function must be called before | |
| * the composite is triggered. | | * the composite is triggered. | |
| */ | | */ | |
|
| virtual NVS_API Result setLayout(int srcNodeIndex, const Rect& srcR
ect, | | virtual CPX_API Result setLayout(int srcNodeIndex, const Rect& srcR
ect, | |
| const Rect& dstRect=Rect())=0; | | const Rect& dstRect=Rect())=0; | |
| | | | |
| /*! | | /*! | |
| * \brief Set the compositing order. | | * \brief Set the compositing order. | |
| * \param len | | * \param len | |
| * Specifies the number of elements pointed to by list; must equal | | * Specifies the number of elements pointed to by list; must equal | |
| * getNumNodes(), OR 0 to indicate "arbitrary order". | | * getNumNodes(), OR 0 to indicate "arbitrary order". | |
| * \param list | | * \param list | |
| * Specifies nNde indices in the order in which their buffers shoul
d be | | * Specifies nNde indices in the order in which their buffers shoul
d be | |
| * composited. Each node index should appear exactly once, but the | | * composited. Each node index should appear exactly once, but the | |
| | | | |
| skipping to change at line 369 | | skipping to change at line 371 | |
| * if len is 0, to indicate "arbitrary order". | | * if len is 0, to indicate "arbitrary order". | |
| * \remarks | | * \remarks | |
| * Composition sort order can only be changed if none of the Nodes
is | | * Composition sort order can only be changed if none of the Nodes
is | |
| * inside a composite() call. Most compositing techniques are | | * inside a composite() call. Most compositing techniques are | |
| * order-independent, and should not override the default (which is | | * order-independent, and should not override the default (which is | |
| * arbitrary-order). Default arbitrary order can be restored by pa
ssing | | * arbitrary-order). Default arbitrary order can be restored by pa
ssing | |
| * 0 for len and NULL for list. Alpha compositing, however, must | | * 0 for len and NULL for list. Alpha compositing, however, must | |
| * composite Nodes back-to-front according to the depth (in eye spa
ce) | | * composite Nodes back-to-front according to the depth (in eye spa
ce) | |
| * of their respective portions of the dataset. | | * of their respective portions of the dataset. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if successful; | | * 'CPX_R_SUCCESS' if successful; | |
| * 'NVS_SYNCHRONIZATION_ERROR' if one of the Nodes is active; | | * 'CPX_R_SYNCHRONIZATION_ERROR' if one of the Nodes is active; | |
| * 'NVS_INVALID_PARAM' if len is not 0 or getNumNodes(); | | * 'CPX_R_INVALID_PARAM' if len is not 0 or getNumNodes(); | |
| * 'NVS_INVALID_PARAM' if list is NULL and len is not 0 or vice-ver | | * 'CPX_R_INVALID_PARAM' if list is NULL and len is not 0 or vice-v | |
| sa; | | ersa; | |
| * 'NVS_INVALID_OBJECT' if not all (and only) Node indices appear i | | * 'CPX_R_INVALID_OBJECT' if not all (and only) Node indices appear | |
| n list. | | in list. | |
| * 'NVS_INVALID_VALUE' if the CompositionTechnique in use requires | | * 'CPX_R_INVALID_VALUE' if the CompositionTechnique in use require | |
| an | | s an | |
| * explicit sort order, but "arbitrary order" is requested. | | * explicit sort order, but "arbitrary order" is requested. | |
| */ | | */ | |
|
| virtual NVS_API Result setSortOrder(int len, int* list)=0; | | virtual CPX_API Result setSortOrder(int len, int* list)=0; | |
| }; | | }; | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
End of changes. 35 change blocks. |
| 55 lines changed or deleted | | 59 lines changed or added | |
|
| Distributor.h | | Distributor.h | |
| | | | |
| skipping to change at line 20 | | skipping to change at line 20 | |
| // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE | | // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE | |
| // POSSIBILITY OF SUCH DAMAGES | | // POSSIBILITY OF SUCH DAMAGES | |
| | | | |
| /*! | | /*! | |
| * \file | | * \file | |
| * \brief | | * \brief | |
| */ | | */ | |
| | | | |
| #pragma once | | #pragma once | |
| | | | |
|
| #ifndef NVS_DISTRIBUTOR_H | | #ifndef CPX_DISTRIBUTOR_H | |
| #define NVS_DISTRIBUTOR_H | | #define CPX_DISTRIBUTOR_H | |
| | | | |
|
| #include "nvscale.h" | | #include "complex.h" | |
| | | | |
|
| namespace nvs | | namespace cpx | |
| { | | { | |
| /*! | | /*! | |
| * \brief | | * \brief | |
| * Distributor is an abstract base class that specifies the common | | * Distributor is an abstract base class that specifies the common | |
| * interface used by all concrete Distributor subclasses. | | * interface used by all concrete Distributor subclasses. | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| * \remarks | | * \remarks | |
| * A Distributor handles the task of deciding which scene objects are | | * A Distributor handles the task of deciding which scene objects are | |
| * rendered by which Nodes in a distributed rendering environment. Cli
ents | | * rendered by which Nodes in a distributed rendering environment. Cli
ents | |
|
| * usually create an nvs::Distributable for each of the objects which m
ay be | | * usually create an cpx::Distributable for each of the objects which m
ay be | |
| * distributed in their scene, then specify whatever attributes for eac
h | | * distributed in their scene, then specify whatever attributes for eac
h | |
| * (weight, bounding box, etc) are required by the Distributor in order
to | | * (weight, bounding box, etc) are required by the Distributor in order
to | |
| * apply its associated DistributionTechnique to them. Once the list o
f | | * apply its associated DistributionTechnique to them. Once the list o
f | |
| * Distributables has been built, computeDistribution() must be invoked
to | | * Distributables has been built, computeDistribution() must be invoked
to | |
| * assign the Distributable objects to rendering Nodes. During renderi
ng | | * assign the Distributable objects to rendering Nodes. During renderi
ng | |
| * traversal, the decision to prune or not to prune a scene object on a | | * traversal, the decision to prune or not to prune a scene object on a | |
| * specific Node can then be made by consulting the Distributor, or | | * specific Node can then be made by consulting the Distributor, or | |
| * callbacks may be registered to receive notice of pruning changes dur
ing | | * callbacks may be registered to receive notice of pruning changes dur
ing | |
| * computeDistribution(). | | * computeDistribution(). | |
| * | | * | |
| * \remarks | | * \remarks | |
|
| * NVScale currently supports two distribution techniques, greedy and s
patial. | | * CompleX currently supports two distribution techniques, greedy and s
patial. | |
| * \remarks | | * \remarks | |
|
| * Greedy (NVS_DT_GREEDY) distribution minimizes the 'weight' on the mo
st-loaded Node. | | * Greedy (CPX_DT_GREEDY) distribution minimizes the 'weight' on the mo
st-loaded Node. | |
| * 'weight' is a non-negative integer representative of the GPU resourc
es | | * 'weight' is a non-negative integer representative of the GPU resourc
es | |
| * (memory, processor time, etc) required to render a particular scene | | * (memory, processor time, etc) required to render a particular scene | |
|
| * object. Greedy distribution is designed to work with depth composit
ion (NVS_CT_DEPTH) | | * object. Greedy distribution is designed to work with depth composit
ion (CPX_CT_DEPTH) | |
| * of an opaque scene. Scenes with a small set of translucent objects
may | | * of an opaque scene. Scenes with a small set of translucent objects
may | |
| * be rendered by deferring those objects to a "glass pass" after | | * be rendered by deferring those objects to a "glass pass" after | |
| * composition, but translucent objects should be drawn on whatever Nod
e | | * composition, but translucent objects should be drawn on whatever Nod
e | |
| * hosts the composition destination context and not presented to a | | * hosts the composition destination context and not presented to a | |
| * Distributor. The greedy distribution algorithm simply assigns each | | * Distributor. The greedy distribution algorithm simply assigns each | |
| * Distributable to the Node least loaded by preceding Distributables. | | * Distributable to the Node least loaded by preceding Distributables. | |
| * \remarks | | * \remarks | |
|
| * Spatial (NVS_DT_SPATIAL) distribution minimizes loading while ensuri
ng strict | | * Spatial (CPX_DT_SPATIAL) distribution minimizes loading while ensuri
ng strict | |
| * back-to-front or front-to-back sortability of sub-images. Spatial | | * back-to-front or front-to-back sortability of sub-images. Spatial | |
|
| * distribution is designed to work with alpha composition (NVS_CT_ALPH
A) of scenes | | * distribution is designed to work with alpha composition (CPX_CT_ALPH
A) of scenes | |
| * containing many stationary translucent objects. In addition to | | * containing many stationary translucent objects. In addition to | |
| * specifying the scene bounding box, clients must also specify a a 'we
ight' | | * specifying the scene bounding box, clients must also specify a a 'we
ight' | |
| * for each of the scene objects to be distributed. 'weight' is a | | * for each of the scene objects to be distributed. 'weight' is a | |
| * non-negative integer representative of the GPU resources (memory, | | * non-negative integer representative of the GPU resources (memory, | |
| * processor time, etc) required to render the scene object. The under
lying | | * processor time, etc) required to render the scene object. The under
lying | |
| * algorithm analyzes the scene and determines the best way to partitio
n it | | * algorithm analyzes the scene and determines the best way to partitio
n it | |
| * (using clip planes) with each subvolume created by the partition ass
igned | | * (using clip planes) with each subvolume created by the partition ass
igned | |
| * to one Node. All scene objects that fall into a specific subvolume
are | | * to one Node. All scene objects that fall into a specific subvolume
are | |
| * rendered by that Node. Since there may be objects that fall into mo
re | | * rendered by that Node. Since there may be objects that fall into mo
re | |
| * than one subvolume, it is the client's responsibility to setup clip | | * than one subvolume, it is the client's responsibility to setup clip | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 114 | |
| * When a Distributor object is destroyed (ie with | | * When a Distributor object is destroyed (ie with | |
| * destroyDistributor()), all of its Distributables which have not | | * destroyDistributor()), all of its Distributables which have not | |
| * already been explicitly destroyed (by calling destroyDistributab
le()) | | * already been explicitly destroyed (by calling destroyDistributab
le()) | |
| * are destroyed automatically. | | * are destroyed automatically. | |
| * \remarks | | * \remarks | |
| * The main purpose of a Distributable is that it may be "pruned" o
n | | * The main purpose of a Distributable is that it may be "pruned" o
n | |
| * behalf of some GPUs in order to effect distribution. The sgobj | | * behalf of some GPUs in order to effect distribution. The sgobj | |
| * corresponding to a Distributable which has been "pruned" on a ce
rtain | | * corresponding to a Distributable which has been "pruned" on a ce
rtain | |
| * GPU need not be drawn on that GPU-- compositing will gather it f
rom | | * GPU need not be drawn on that GPU-- compositing will gather it f
rom | |
| * some other GPU whereon its Distributable is not pruned. Use | | * some other GPU whereon its Distributable is not pruned. Use | |
|
| * getPruneState() or set an NVS_DA_PRUNE_CALLBACK to find out abou
t | | * getPruneState() or set an CPX_DA_PRUNE_CALLBACK to find out abou
t | |
| * pruning changes. Use computeDistribution() to update pruning | | * pruning changes. Use computeDistribution() to update pruning | |
| * decisions to account for changes to Distributable, Node, or Netw
ork | | * decisions to account for changes to Distributable, Node, or Netw
ork | |
| * attributes. Unless or until computeDistribution() decides other
wise, | | * attributes. Unless or until computeDistribution() decides other
wise, | |
|
| * Distributables have state NVS_PS_DONTPRUNE for all GPUs. | | * Distributables have state CPX_PS_DONTPRUNE for all GPUs. | |
| */ | | */ | |
|
| NVS_API virtual Distributable getDistributable(void *sgobj) = 0; | | CPX_API virtual Distributable getDistributable(void *sgobj) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Destroy a Distributable obtained through getDistributable
(). | | * \brief Destroy a Distributable obtained through getDistributable
(). | |
| * \param drible Opaque handle obtained using getDistributable(). | | * \param drible Opaque handle obtained using getDistributable(). | |
| * \return | | * \return | |
|
| * NVS_INVALID_OBJECT if drible is not valid;\n | | * CPX_R_INVALID_OBJECT if drible is not valid;\n | |
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
| * After a Distributable handle has been destroyed, it may no longe
r be | | * After a Distributable handle has been destroyed, it may no longe
r be | |
| * used. Subsequent calls to getDistributable() with the sgobj | | * used. Subsequent calls to getDistributable() with the sgobj | |
| * originally used to obtain the destroyed handle will return a new
, | | * originally used to obtain the destroyed handle will return a new
, | |
| * unrelated Distributable. | | * unrelated Distributable. | |
| */ | | */ | |
|
| NVS_API virtual Result destroyDistributable(Distributable drible) =
0; | | CPX_API virtual Result destroyDistributable(Distributable drible) =
0; | |
| | | | |
| /*! | | /*! | |
| * \brief Set attributes for the specified Distributable. | | * \brief Set attributes for the specified Distributable. | |
| * \param drible Opaque handle obtained using getDistributable(). | | * \param drible Opaque handle obtained using getDistributable(). | |
| * \param pname The symbolic name of the attribute. | | * \param pname The symbolic name of the attribute. | |
| * \param pvalue | | * \param pvalue | |
| * The value of the attribute: a pointer to some number of bytes wi
th | | * The value of the attribute: a pointer to some number of bytes wi
th | |
| * format and length determined by pname. Passed data is copied, a
nd | | * format and length determined by pname. Passed data is copied, a
nd | |
| * need not persist at pvalue after return. Results are undefined
if | | * need not persist at pvalue after return. Results are undefined
if | |
| * pvalue does not point to a buffer of the correct size and format
. | | * pvalue does not point to a buffer of the correct size and format
. | |
| * Passing pvalue as NULL returns the value stored to default, repl
acing | | * Passing pvalue as NULL returns the value stored to default, repl
acing | |
| * anything previously stored for the corresponding attribute. For | | * anything previously stored for the corresponding attribute. For | |
| * attributes which can represent invalid values, setting any value | | * attributes which can represent invalid values, setting any value | |
| * which is neither the default, nor actually valid, resets that | | * which is neither the default, nor actually valid, resets that | |
|
| * attribute to the default value and returns NVS_INVALID_VALUE. V
alues | | * attribute to the default value and returns CPX_R_INVALID_VALUE.
Values | |
| * that are passed as single precision floating point numbers will | | * that are passed as single precision floating point numbers will | |
| * automatically be converted to double precision. | | * automatically be converted to double precision. | |
| * \return | | * \return | |
|
| * NVS_INVALID_OBJECT if drible is invalid;\n | | * CPX_R_INVALID_OBJECT if drible is invalid;\n | |
| * NVS_INVALID_ENUM if pname is not an accepted value;\n | | * CPX_R_INVALID_ENUM if pname is not an accepted value;\n | |
| * NVS_INVALID_VALUE if pvalue is invalid;\n | | * CPX_R_INVALID_VALUE if pvalue is invalid;\n | |
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_DA_WEIGHT, then pvalue must be a pointer to sing
le | | * If pname is CPX_DA_WEIGHT, then pvalue must be a pointer to sing
le | |
| * size_t (size_t*). Weight is an opaque, non-negative integer | | * size_t (size_t*). Weight is an opaque, non-negative integer | |
| * representing the GPU resources (memory, processor time, etc) req
uired | | * representing the GPU resources (memory, processor time, etc) req
uired | |
| * to render the scene object associated with the Distributable. | | * to render the scene object associated with the Distributable. | |
| * Clients should determine exactly how weight is calculated so as
to | | * Clients should determine exactly how weight is calculated so as
to | |
| * best reflect the chief rendering bottlenecks encountered by thei
r | | * best reflect the chief rendering bottlenecks encountered by thei
r | |
| * application. Unless set otherwise, weight defaults to 0. | | * application. Unless set otherwise, weight defaults to 0. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_DA_BOX_EXTENTS_[FLOAT|DOUBLE], then pvalue must
be a | | * If pname is CPX_DA_BOX_EXTENTS_[FLOAT|DOUBLE], then pvalue must
be a | |
| * pointer to six consecutive single|double precision values defini
ng | | * pointer to six consecutive single|double precision values defini
ng | |
| * the minimal and maximal extents of the Distributable's bounding
box | | * the minimal and maximal extents of the Distributable's bounding
box | |
| * in modeling coordinates. The first three numbers are interprete
d as | | * in modeling coordinates. The first three numbers are interprete
d as | |
| * the x, y and z coordinates of the minimal extent and the other t
hree | | * the x, y and z coordinates of the minimal extent and the other t
hree | |
| * are interpreted as the maximal extent. A Distributable's box mu
st be | | * are interpreted as the maximal extent. A Distributable's box mu
st be | |
|
| * specified when using spatial distribution (NVS_DT_SPATIAL, the D | | * specified when using spatial distribution (CPX_DT_SPATIAL, the D | |
| istributionTechnique | | istributionTechnique | |
| * used with alpha composition: NVS_CT_ALPHA). Unless set otherwis | | * used with alpha composition: CPX_CT_ALPHA). Unless set otherwis | |
| e, default is the | | e, default is the | |
| * "null box", which contains no points. Any OTHER box with at lea
st | | * "null box", which contains no points. Any OTHER box with at lea
st | |
| * one negative dimension (minimum[dim] greater than maximum[dim])
is | | * one negative dimension (minimum[dim] greater than maximum[dim])
is | |
| * invalid. | | * invalid. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_DA_MODEL_TO_WORLD_TRANSFORM_[FLOAT|DOUBLE], then | | * If pname is CPX_DA_MODEL_TO_WORLD_TRANSFORM_[FLOAT|DOUBLE], then | |
| * pvalue must point to 16 consecutive single|double precision valu
es | | * pvalue must point to 16 consecutive single|double precision valu
es | |
| * that are used as the elements of a 4x4 column-major (same as Ope
nGL) | | * that are used as the elements of a 4x4 column-major (same as Ope
nGL) | |
| * matrix defining the transform from the associated scene graph | | * matrix defining the transform from the associated scene graph | |
| * object's modeling coordinates to world coordinates. If this | | * object's modeling coordinates to world coordinates. If this | |
| * attribute is set, the bounding box of the distributable will be | | * attribute is set, the bounding box of the distributable will be | |
| * transformed by it before consideration during Node assignment. | | * transformed by it before consideration during Node assignment. | |
| * Unless set otherwise, default is the identity matrix. | | * Unless set otherwise, default is the identity matrix. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_DA_PRUNE_CALLBACK, then pvalue must be a pointer | | * If pname is CPX_DA_PRUNE_CALLBACK, then pvalue must be a pointer | |
| to | | to | |
| * an object of type nvs::PruneCallback. Clients may use this to | | * an object of type cpx::PruneCallback. Clients may use this to | |
| * receive notification of pruning changes when they occur during | | * receive notification of pruning changes when they occur during | |
| * computeDistribution(), instead of calling getPruneState(). Unle
ss | | * computeDistribution(), instead of calling getPruneState(). Unle
ss | |
| * set, default is NULL, indicating no callback will be made. See | | * set, default is NULL, indicating no callback will be made. See | |
| * warning about taking the address of function pointers! | | * warning about taking the address of function pointers! | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_DA_PRUNE_CALLBACK_USER_DATA, then pvalue is a po
inter | | * If pname is CPX_DA_PRUNE_CALLBACK_USER_DATA, then pvalue is a po
inter | |
| * to an opaque application data pointer (ie a void**). The opaque | | * to an opaque application data pointer (ie a void**). The opaque | |
| * application pointer will be saved and passed as-is when invoking
the | | * application pointer will be saved and passed as-is when invoking
the | |
| * prune callback function (if one is registered). The user data o
bject | | * prune callback function (if one is registered). The user data o
bject | |
| * it points to will not be touched or copied. If this attribute i
s not | | * it points to will not be touched or copied. If this attribute i
s not | |
| * set, the default will be NULL, and any registered prune callback
will | | * set, the default will be NULL, and any registered prune callback
will | |
| * simply be called with NULL userdata. | | * simply be called with NULL userdata. | |
| * \warning | | * \warning | |
|
| * nvs::PruneCallback is a function pointer type, which makes creat
ing | | * cpx::PruneCallback is a function pointer type, which makes creat
ing | |
| * pointers to it hard. If myCB() defines a function matching the | | * pointers to it hard. If myCB() defines a function matching the | |
| * callback signature, then BOTH the expressions "myCB" and "&myCB"
have | | * callback signature, then BOTH the expressions "myCB" and "&myCB"
have | |
|
| * type nvs::PruneCallback, and NEITHER has type nvs::PruneCallback
*. | | * type cpx::PruneCallback, and NEITHER has type cpx::PruneCallback
*. | |
| * Therefor, to set myCB as the callback, it is necessary to first | | * Therefor, to set myCB as the callback, it is necessary to first | |
|
| * assign it to a temporary object of type nvs::PruneCallback ('pfn
') | | * assign it to a temporary object of type cpx::PruneCallback ('pfn
') | |
| * then pass the address of that object ('&pfn') to | | * then pass the address of that object ('&pfn') to | |
| * setDistributableAttribute(). | | * setDistributableAttribute(). | |
| */ | | */ | |
|
| NVS_API virtual Result setDistributableAttribute(Distributable drib
le, | | CPX_API virtual Result setDistributableAttribute(Distributable drib
le, | |
| DistributableAttri
bute pname, | | DistributableAttri
bute pname, | |
| const void *pvalue
) = 0; | | const void *pvalue
) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get attributes for the specified Distributable. | | * \brief Get attributes for the specified Distributable. | |
| * \param drible Opaque handle obtained using getDistributable(). | | * \param drible Opaque handle obtained using getDistributable(). | |
| * \param pname The symbolic name of the attribute. | | * \param pname The symbolic name of the attribute. | |
| * \param pvalue | | * \param pvalue | |
| * The value of the attribute: a pointer to some number of bytes wi
th | | * The value of the attribute: a pointer to some number of bytes wi
th | |
| * format and length determined by pname. Data is copied into memo
ry | | * format and length determined by pname. Data is copied into memo
ry | |
| * pointed to by pvalue. Results are undefined if pvalue does not
point | | * pointed to by pvalue. Results are undefined if pvalue does not
point | |
| * to a buffer of the correct size and format. | | * to a buffer of the correct size and format. | |
| * \return | | * \return | |
|
| * NVS_INVALID_OBJECT if drible is invalid;\n | | * CPX_R_INVALID_OBJECT if drible is invalid;\n | |
| * NVS_INVALID_ENUM if pname is not an accepted value;\n | | * CPX_R_INVALID_ENUM if pname is not an accepted value;\n | |
| * NVS_INVALID_PARAM if pvalue is NULL;\n | | * CPX_R_INVALID_PARAM if pvalue is NULL;\n | |
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
| * Sizing for the buffer pointed to by pvalue is a function of whic
h | | * Sizing for the buffer pointed to by pvalue is a function of whic
h | |
| * attribute pname selects. Both size and semantics are as defined
for | | * attribute pname selects. Both size and semantics are as defined
for | |
| * setDistributableAttribute(). Getting an attribute as float(s) w
hich | | * setDistributableAttribute(). Getting an attribute as float(s) w
hich | |
| * was set as double(s) results in the double values clamped to the | | * was set as double(s) results in the double values clamped to the | |
| * floating point range. Getting an attribute as double(s) which w
as | | * floating point range. Getting an attribute as double(s) which w
as | |
| * set as float(s) returns the float value except if it is +/-FLT_M
AX, | | * set as float(s) returns the float value except if it is +/-FLT_M
AX, | |
| * in which case it is mapped to +/-DBL_MAX on return. | | * in which case it is mapped to +/-DBL_MAX on return. | |
| */ | | */ | |
|
| NVS_API virtual Result getDistributableAttribute(Distributable drib
le, | | CPX_API virtual Result getDistributableAttribute(Distributable drib
le, | |
| DistributableAttri
bute pname, | | DistributableAttri
bute pname, | |
| void *pvalue) = 0; | | void *pvalue) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Set per-Node attributes | | * \brief Set per-Node attributes | |
| * \param nodeidx Index of the Node for which the value is set. | | * \param nodeidx Index of the Node for which the value is set. | |
| * \param pname The symbolic name of the attribute. | | * \param pname The symbolic name of the attribute. | |
| * \param pvalue | | * \param pvalue | |
| * The value of the attribute: a pointer to some number of bytes wi
th | | * The value of the attribute: a pointer to some number of bytes wi
th | |
| * format and length determined by pname. Passed data is copied, a
nd | | * format and length determined by pname. Passed data is copied, a
nd | |
| * need not persist at pvalue after return. Results are undefined
if | | * need not persist at pvalue after return. Results are undefined
if | |
| * pvalue does not point to a buffer of the correct size and format
. | | * pvalue does not point to a buffer of the correct size and format
. | |
| * Passing pvalue as NULL returns the value stored to default, repl
acing | | * Passing pvalue as NULL returns the value stored to default, repl
acing | |
| * anything previously stored for the corresponding attribute. For | | * anything previously stored for the corresponding attribute. For | |
| * attributes which can represent invalid values, setting any value | | * attributes which can represent invalid values, setting any value | |
| * which is neither the default, nor actually valid, resets that | | * which is neither the default, nor actually valid, resets that | |
|
| * attribute to the default value and returns NVS_INVALID_VALUE. V
alues | | * attribute to the default value and returns CPX_R_INVALID_VALUE.
Values | |
| * that are passed as single precision floating point numbers will | | * that are passed as single precision floating point numbers will | |
| * automatically be converted to double precision. | | * automatically be converted to double precision. | |
| * \return | | * \return | |
|
| * NVS_INVALID_OBJECT if nodeid is invalid;\n | | * CPX_R_INVALID_OBJECT if nodeid is invalid;\n | |
| * NVS_INVALID_ENUM if pname is not an accepted value;\n | | * CPX_R_INVALID_ENUM if pname is not an accepted value;\n | |
| * NVS_INVALID_OPERATION if the parameter named by pname is read-on | | * CPX_R_INVALID_OPERATION if the parameter named by pname is read- | |
| ly | | only | |
| * and may not be set;\n | | * and may not be set;\n | |
|
| * NVS_INVALID_VALUE if pvalue is invalid;\n | | * CPX_R_INVALID_VALUE if pvalue is invalid;\n | |
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_LOAD_FACTOR_[FLOAT|DOUBLE] then pvalue must b
e a | | * If pname is CPX_NA_LOAD_FACTOR_[FLOAT|DOUBLE] then pvalue must b
e a | |
| * pointer to a single|double precision value. Load Factor is an | | * pointer to a single|double precision value. Load Factor is an | |
| * opaque, non-negative floating point value representing the exten
t to | | * opaque, non-negative floating point value representing the exten
t to | |
| * which the Node may be loaded. Accepted values are either 0.0 or
a | | * which the Node may be loaded. Accepted values are either 0.0 or
a | |
| * floating point number in the range [0.001, 1000.0] with the defa
ult | | * floating point number in the range [0.001, 1000.0] with the defa
ult | |
| * value being 1.0. | | * value being 1.0. | |
| */ | | */ | |
|
| NVS_API virtual Result setNodeAttribute(int nodeidx, | | CPX_API virtual Result setNodeAttribute(int nodeidx, | |
| NodeAttribute pname, | | NodeAttribute pname, | |
| const void *pvalue) = 0; | | const void *pvalue) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief | | * \brief | |
| * Query the distributor for per-Node attributes. | | * Query the distributor for per-Node attributes. | |
| * \param nodeidx Index of the Node for which the value is queried. | | * \param nodeidx Index of the Node for which the value is queried. | |
| * \param pname The symbolic name of the attribute. | | * \param pname The symbolic name of the attribute. | |
| * \param pvalue Returns the value or values of the specified attri
bute. | | * \param pvalue Returns the value or values of the specified attri
bute. | |
| * \return | | * \return | |
|
| * NVS_INVALID_ENUM if pname is not an accepted value;\n | | * CPX_R_INVALID_ENUM if pname is not an accepted value;\n | |
| * NVS_INVALID_OBJECT if nodeid is invalid;\n | | * CPX_R_INVALID_OBJECT if nodeid is invalid;\n | |
| * NVS_INVALID_PARAM if pvalue is NULL;\n | | * CPX_R_INVALID_PARAM if pvalue is NULL;\n | |
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_COUNT_ASSIGNED, then pvalue must point to a s
ingle | | * If pname is CPX_NA_COUNT_ASSIGNED, then pvalue must point to a s
ingle | |
| * integer which will receive the number of Distributables assigned
to | | * integer which will receive the number of Distributables assigned
to | |
| * the specified Node. It is important to note that some Distribut
ables | | * the specified Node. It is important to note that some Distribut
ables | |
| * may be assigned to more than one Node. This attribute is comput
ed in | | * may be assigned to more than one Node. This attribute is comput
ed in | |
| * computeDistribution(). | | * computeDistribution(). | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_WEIGHT_ASSIGNED, then pvalue must point to a | | * If pname is CPX_NA_WEIGHT_ASSIGNED, then pvalue must point to a | |
| * single integer which will receive the sum of the weights of | | * single integer which will receive the sum of the weights of | |
| * Distributables assigned to the specified Node. It is important
to | | * Distributables assigned to the specified Node. It is important
to | |
| * note that some Distributables may be assigned to more than one N
ode. | | * note that some Distributables may be assigned to more than one N
ode. | |
| * This attribute is computed in computeDistribution(). | | * This attribute is computed in computeDistribution(). | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_COMPOSITION_INDEX, then pvalue must point to
a | | * If pname is CPX_NA_COMPOSITION_INDEX, then pvalue must point to
a | |
| * single integer which will receive the index of the specified nod
e in | | * single integer which will receive the index of the specified nod
e in | |
| * the image composition order. For some DistributionTechniques, t
he | | * the image composition order. For some DistributionTechniques, t
he | |
| * Compositor must combine sub-images in a specific order. For exa
mple, | | * Compositor must combine sub-images in a specific order. For exa
mple, | |
|
| * In spatial distribution (NVS_DT_SPATIAL), the compositor must co
mbine sub-images | | * In spatial distribution (CPX_DT_SPATIAL), the compositor must co
mbine sub-images | |
| * back-to-front (or front-to-back) based on the position of the | | * back-to-front (or front-to-back) based on the position of the | |
| * partitions in eye space. The composition order in this case is | | * partitions in eye space. The composition order in this case is | |
| * determined by the world-to-view transform which can be set by ca
lling | | * determined by the world-to-view transform which can be set by ca
lling | |
|
| * setNetworkAttribute(). In greedy distribution (NVS_DT_GREEDY),
composition order is | | * setNetworkAttribute(). In greedy distribution (CPX_DT_GREEDY),
composition order is | |
| * independent of the world-to-view transformation. This attribute | | * independent of the world-to-view transformation. This attribute | |
| * would typically be queried in a loop (varying the Node index fro
m 0 | | * would typically be queried in a loop (varying the Node index fro
m 0 | |
| * to numNodes-1) to build the overall composition order. The | | * to numNodes-1) to build the overall composition order. The | |
| * Compositor is then informed of this composition order through th
e | | * Compositor is then informed of this composition order through th
e | |
| * setSortOrder() method. This attribute is computed in | | * setSortOrder() method. This attribute is computed in | |
| * computeDistribution() and when the world-to-view transformation
is | | * computeDistribution() and when the world-to-view transformation
is | |
| * modified (through setNetworkAttribute()). Note that the overall | | * modified (through setNetworkAttribute()). Note that the overall | |
| * composition order can be queried directly by calling | | * composition order can be queried directly by calling | |
| * getNetworkAttribute(). | | * getNetworkAttribute(). | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_LOAD_FACTOR_[FLOAT|DOUBLE], then pvalue must
point | | * If pname is CPX_NA_LOAD_FACTOR_[FLOAT|DOUBLE], then pvalue must
point | |
| * to a single|double precision floating point number that will rec
eive | | * to a single|double precision floating point number that will rec
eive | |
| * an opaque, non-negative value representing the extent to which t
he | | * an opaque, non-negative value representing the extent to which t
he | |
| * Node may be loaded. The Returned value will either be 0.0 or a | | * Node may be loaded. The Returned value will either be 0.0 or a | |
| * floating point number in the range [0.001, 1000.0]. | | * floating point number in the range [0.001, 1000.0]. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_NUM_PARTITIONS, then pvalue must point to a s
ingle | | * If pname is CPX_NA_NUM_PARTITIONS, then pvalue must point to a s
ingle | |
| * integer which will be set to the number of clip planes which mus
t be | | * integer which will be set to the number of clip planes which mus
t be | |
| * specified before rendering on the Node in question (for example,
via | | * specified before rendering on the Node in question (for example,
via | |
| * glClipPlane()). This attribute is computed in computeDistributi
on() | | * glClipPlane()). This attribute is computed in computeDistributi
on() | |
| * and will be zero if no clip planes are required. | | * and will be zero if no clip planes are required. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NA_PARTITION_PLANEn, with n in [0, numPlanes) an | | * If pname is CPX_NA_PARTITION_PLANEn, with n in [0, numPlanes) an | |
| d | | d | |
| * numPlanes gotten with NVS_NA_NUM_PARTITIONS, then pvalue must po | | * numPlanes gotten with CPX_NA_NUM_PARTITIONS, then pvalue must po | |
| int | | int | |
| * to 4 consecutive double precision values which will be set to th
e | | * to 4 consecutive double precision values which will be set to th
e | |
| * coefficients of the plane equation for the nth clip plane, expre
ssed | | * coefficients of the plane equation for the nth clip plane, expre
ssed | |
| * in the world coordinate system (the same system to which | | * in the world coordinate system (the same system to which | |
|
| * NVS_DA_BOX_EXTENTS bounding boxes are transformed by the | | * CPX_DA_BOX_EXTENTS bounding boxes are transformed by the | |
| * NVS_DA_MODEL_TO_WORLD_TRANSFORM). | | * CPX_DA_MODEL_TO_WORLD_TRANSFORM). | |
| * NVS_INVALID_OPERATION is generated if pname is not an accepted v | | * CPX_R_INVALID_OPERATION is generated if pname is not an accepted | |
| alue for | | value for | |
| * the specified Node (each Node may require a different number of
clip | | * the specified Node (each Node may require a different number of
clip | |
|
| * planes, queryable with NVS_NA_NUM_PARTITIONS). This attribute i
s | | * planes, queryable with CPX_NA_NUM_PARTITIONS). This attribute i
s | |
| * computed in computeDistribution() when spatial distribution is | | * computed in computeDistribution() when spatial distribution is | |
| * employed. | | * employed. | |
| */ | | */ | |
|
| NVS_API virtual Result getNodeAttribute(int nodeidx, | | CPX_API virtual Result getNodeAttribute(int nodeidx, | |
| NodeAttribute pname, | | NodeAttribute pname, | |
| void *pvalue) = 0; | | void *pvalue) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get the prune state of the specified Distributable. | | * \brief Get the prune state of the specified Distributable. | |
| * \param nodeidx Index of the Node for which the value is queried. | | * \param nodeidx Index of the Node for which the value is queried. | |
| * \param drible Opaque handle obtained using getDistributable(). | | * \param drible Opaque handle obtained using getDistributable(). | |
| * \return | | * \return | |
|
| * NVS_PS_NEW_PRUNE -> Not pruned before, but must be now.\n | | * CPX_PS_NEW_PRUNE -> Not pruned before, but must be now.\n | |
| * NVS_PS_NEW_DONTPRUNE -> Pruned before, but must not be now.\n | | * CPX_PS_NEW_DONTPRUNE -> Pruned before, but must not be now.\n | |
| * NVS_PS_PRUNE -> Pruned before, pruned now (nothing changed).\n | | * CPX_PS_PRUNE -> Pruned before, pruned now (nothing changed).\n | |
| * NVS_PS_DONTPRUNE -> Not pruned before, not pruned now (nothing | | * CPX_PS_DONTPRUNE -> Not pruned before, not pruned now (nothing | |
| * changed), or if nodeidx or drible is not valid.\n | | * changed), or if nodeidx or drible is not valid.\n | |
| * \remarks | | * \remarks | |
|
| * Typically, if NVS_DA_PRUNE_CALLBACK is not being used, this func
tion | | * Typically, if CPX_DA_PRUNE_CALLBACK is not being used, this func
tion | |
| * should be called with the corresponding Distributable as each | | * should be called with the corresponding Distributable as each | |
| * distributable object is encountered while traversing the scene o
n | | * distributable object is encountered while traversing the scene o
n | |
| * behalf of each Node. If the result is PRUNE, then traversal of
that | | * behalf of each Node. If the result is PRUNE, then traversal of
that | |
| * node and its subtree may be skipped, provided traversal of the | | * node and its subtree may be skipped, provided traversal of the | |
| * subtree has no side effects (unreversed GL state changes include
d). | | * subtree has no side effects (unreversed GL state changes include
d). | |
| * If the result is DONTPRUNE, then the portion of the image for wh
ich | | * If the result is DONTPRUNE, then the portion of the image for wh
ich | |
| * the specified Node is responsible depends on that object, and it | | * the specified Node is responsible depends on that object, and it | |
| * should not be skipped. The NEW values simply indicate a transit
ion | | * should not be skipped. The NEW values simply indicate a transit
ion | |
| * from one state to the other has occurred so that GL resources ma
y be | | * from one state to the other has occurred so that GL resources ma
y be | |
| * allocated or cleaned up. NEW-ness lasts from the | | * allocated or cleaned up. NEW-ness lasts from the | |
| * computeDistribution() call that detected the change, until the n
ext | | * computeDistribution() call that detected the change, until the n
ext | |
| * one, unless the pruned state changes again. | | * one, unless the pruned state changes again. | |
| */ | | */ | |
|
| NVS_API virtual PruneState getPruneState(int nodeidx, | | CPX_API virtual PruneState getPruneState(int nodeidx, | |
| Distributable drible) = 0; | | Distributable drible) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Set attributes for the whole Distributor network. | | * \brief Set attributes for the whole Distributor network. | |
| * \param pname The symbolic name of the attribute. | | * \param pname The symbolic name of the attribute. | |
| * \param pvalue | | * \param pvalue | |
| * The value of the attribute: a pointer to some number of bytes wi
th | | * The value of the attribute: a pointer to some number of bytes wi
th | |
| * format and length determined by pname. Passed data is copied, a
nd | | * format and length determined by pname. Passed data is copied, a
nd | |
| * need not persist at pvalue after return. Results are undefined
if | | * need not persist at pvalue after return. Results are undefined
if | |
| * pvalue does not point to a buffer of the correct size and format
. | | * pvalue does not point to a buffer of the correct size and format
. | |
| * Passing pvalue as NULL returns the value stored to default, repl
acing | | * Passing pvalue as NULL returns the value stored to default, repl
acing | |
| * anything previously stored for the corresponding attribute. For | | * anything previously stored for the corresponding attribute. For | |
| * attributes which can represent invalid values, setting any value | | * attributes which can represent invalid values, setting any value | |
| * which is neither the default, nor actually valid, resets that | | * which is neither the default, nor actually valid, resets that | |
|
| * attribute to the default value and returns NVS_INVALID_VALUE. V
alues | | * attribute to the default value and returns CPX_R_INVALID_VALUE.
Values | |
| * that are passed as single precision floating point numbers will | | * that are passed as single precision floating point numbers will | |
| * automatically be converted to double precision. | | * automatically be converted to double precision. | |
| * \return | | * \return | |
|
| * NVS_INVALID_ENUM if pname is not an accepted value;\n | | * CPX_R_INVALID_ENUM if pname is not an accepted value;\n | |
| * NVS_INVALID_OPERATION if the parameter named by pname is read-on | | * CPX_R_INVALID_OPERATION if the parameter named by pname is read- | |
| ly | | only | |
| * and may not be set;\n | | * and may not be set;\n | |
|
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NWA_WORLD_TO_VIEW_TRANSFORM_[FLOAT|DOUBLE], then | | * If pname is CPX_NWA_WORLD_TO_VIEW_TRANSFORM_[FLOAT|DOUBLE], then | |
| * pvalue must point to 16 consecutive single|double precision valu
es | | * pvalue must point to 16 consecutive single|double precision valu
es | |
| * that are used as the elements of a 4x4 column-major matrix (same
as | | * that are used as the elements of a 4x4 column-major matrix (same
as | |
| * OpenGL) that transforms vertices from world coordinates to eye | | * OpenGL) that transforms vertices from world coordinates to eye | |
| * coordinates. This attribute influences the order in which the | | * coordinates. This attribute influences the order in which the | |
| * Compositor should combine sub-images. Unless set otherwise, def
ault | | * Compositor should combine sub-images. Unless set otherwise, def
ault | |
| * is the identity matrix. | | * is the identity matrix. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NWA_COMPOSITION_ORDER, then NVS_INVALID_OPERATIO | | * If pname is CPX_NWA_COMPOSITION_ORDER, then CPX_R_INVALID_OPERAT | |
| N is | | ION is | |
| * returned; NVS_NWA_COMPOSITION_ORDER is read-only. | | * returned; CPX_NWA_COMPOSITION_ORDER is read-only. | |
| * \sa | | * \sa | |
| * getNetworkAttribute | | * getNetworkAttribute | |
| */ | | */ | |
|
| NVS_API virtual Result setNetworkAttribute(NetworkAttribute pname, | | CPX_API virtual Result setNetworkAttribute(NetworkAttribute pname, | |
| const void *pvalue) = 0; | | const void *pvalue) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Query Distributor network attributes. | | * \brief Query Distributor network attributes. | |
| * \param pname The symbolic name of the attribute. | | * \param pname The symbolic name of the attribute. | |
| * \param pvalue | | * \param pvalue | |
| * A pointer to some number of bytes with format and length determi
ned | | * A pointer to some number of bytes with format and length determi
ned | |
| * by pname. Data is copied into memory pointed to by pvalue. Res
ults | | * by pname. Data is copied into memory pointed to by pvalue. Res
ults | |
| * are undefined if pvalue does not point to a buffer of the correc
t | | * are undefined if pvalue does not point to a buffer of the correc
t | |
| * size and format. | | * size and format. | |
| * \return | | * \return | |
|
| * NVS_INVALID_PARAM if pvalue is NULL;\n | | * CPX_R_INVALID_PARAM if pvalue is NULL;\n | |
| * NVS_INVALID_ENUM if pname is not an accepted value;\n | | * CPX_R_INVALID_ENUM if pname is not an accepted value;\n | |
| * NVS_SUCCESS otherwise.\n | | * CPX_R_SUCCESS otherwise.\n | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NWA_WORLD_TO_VIEW_TRANSFORM_[FLOAT|DOUBLE], then | | * If pname is CPX_NWA_WORLD_TO_VIEW_TRANSFORM_[FLOAT|DOUBLE], then | |
| * pvalue must point to 16 consecutive single|double precision valu
es | | * pvalue must point to 16 consecutive single|double precision valu
es | |
| * that will receive the elements of the user provided 4x4 column-m
ajor | | * that will receive the elements of the user provided 4x4 column-m
ajor | |
| * matrix (OpenGL style) that transforms vertices from world coordi
nates | | * matrix (OpenGL style) that transforms vertices from world coordi
nates | |
| * to eye coordinates. Unless set otherwise, default is the identi
ty | | * to eye coordinates. Unless set otherwise, default is the identi
ty | |
| * matrix. | | * matrix. | |
| * \remarks | | * \remarks | |
|
| * If pname is NVS_NWA_COMPOSITION_ORDER, then pvalue must point to | | * If pname is CPX_NWA_COMPOSITION_ORDER, then pvalue must point to | |
| * 'NumNodes' consecutive integers that will receive the order in w
hich | | * 'NumNodes' consecutive integers that will receive the order in w
hich | |
| * the Compositor should combine sub-images. NumNodes is the same | | * the Compositor should combine sub-images. NumNodes is the same | |
| * number of nodes that was specified during Distributor constructi
on. | | * number of nodes that was specified during Distributor constructi
on. | |
| * The returned composition order should be passed to the Composito
r | | * The returned composition order should be passed to the Composito
r | |
|
| * through setSortOrder(). NVS_NWA_COMPOSITION_ORDER is a read-onl
y | | * through setSortOrder(). CPX_NWA_COMPOSITION_ORDER is a read-onl
y | |
| * attribute calculated as a result of DistributionTechnique, | | * attribute calculated as a result of DistributionTechnique, | |
|
| * computeDistribution() and NVS_NWA_WORLD_TO_VIEW_TRANSFORM_*. Un
less | | * computeDistribution() and CPX_NWA_WORLD_TO_VIEW_TRANSFORM_*. Un
less | |
| * computed otherwise, default is the "arbitrary order" flag values
. | | * computed otherwise, default is the "arbitrary order" flag values
. | |
| * \sa | | * \sa | |
| * setNetworkAttribute | | * setNetworkAttribute | |
| */ | | */ | |
|
| NVS_API virtual Result getNetworkAttribute(NetworkAttribute pname, | | CPX_API virtual Result getNetworkAttribute(NetworkAttribute pname, | |
| void *pvalue) = 0; | | void *pvalue) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief | | * \brief | |
| * Process the list of Distributables and assign Nodes responsible
for | | * Process the list of Distributables and assign Nodes responsible
for | |
| * rendering each of them. | | * rendering each of them. | |
| * \remarks | | * \remarks | |
| * Attributes which depend on the distribution, such as | | * Attributes which depend on the distribution, such as | |
|
| * NVS_NWA_COMPOSITION_ORDER, NVS_NA_NUM_PARTITIONS, etc. will be | | * CPX_NWA_COMPOSITION_ORDER, CPX_NA_NUM_PARTITIONS, etc. will be | |
| * updated to reflect the latest state by this call. | | * updated to reflect the latest state by this call. | |
| * \remarks | | * \remarks | |
| * Pruning callbacks will be triggered by this call if any | | * Pruning callbacks will be triggered by this call if any | |
| * Distributables to which they have been attached undergo changes
in | | * Distributables to which they have been attached undergo changes
in | |
|
| * prune state (ie getPruneState() would return NVS_PS_NEW_*). | | * prune state (ie getPruneState() would return CPX_PS_NEW_*). | |
| * \remarks | | * \remarks | |
| * Distributables for which attributes required by the effective | | * Distributables for which attributes required by the effective | |
| * DistributionTechnique have never been set will not be pruned on
any | | * DistributionTechnique have never been set will not be pruned on
any | |
| * Node. | | * Node. | |
| * \remarks | | * \remarks | |
| * Distributables prune states (as queriable via getPruneState()) w
ill | | * Distributables prune states (as queriable via getPruneState()) w
ill | |
| * undergo the following transitions:\n | | * undergo the following transitions:\n | |
|
| * NVS_PS_NEW_DONTPRUNE, NVS_PS_DONTPRUNE --not-pruned-> NVS_PS_DON | | * CPX_PS_NEW_DONTPRUNE, CPX_PS_DONTPRUNE --not-pruned-> CPX_PS_DON | |
| TPRUNE\n | | TPRUNE\n | |
| * NVS_PS_NEW_DONTPRUNE, NVS_PS_DONTPRUNE --pruned-> NVS_PS_NEW | | * CPX_PS_NEW_DONTPRUNE, CPX_PS_DONTPRUNE --pruned-> CPX_PS_NEW | |
| _PRUNE\n | | _PRUNE\n | |
| * NVS_PS_NEW_PRUNE, NVS_PS_PRUNE --pruned-> NVS_PS_PRU | | * CPX_PS_NEW_PRUNE, CPX_PS_PRUNE --pruned-> CPX_PS_PRU | |
| NE\n | | NE\n | |
| * NVS_PS_NEW_PRUNE, NVS_PS_PRUNE --not-pruned-> NVS_PS_NEW | | * CPX_PS_NEW_PRUNE, CPX_PS_PRUNE --not-pruned-> CPX_PS_NEW | |
| _DONTPRUNE\n | | _DONTPRUNE\n | |
| * \return | | * \return | |
|
| * NVS_SUCCESS iff everything went well. | | * CPX_R_SUCCESS iff everything went well. | |
| */ | | */ | |
|
| NVS_API virtual Result computeDistribution() = 0; | | CPX_API virtual Result computeDistribution() = 0; | |
| }; | | }; | |
| | | | |
|
| } // namespace nvs | | } // namespace cpx | |
| | | | |
|
| #endif // NVS_DISTRIBUTOR_H | | #endif // CPX_DISTRIBUTOR_H | |
| | | | |
End of changes. 68 change blocks. |
| 109 lines changed or deleted | | 109 lines changed or added | |
|
| Factory.h | | Factory.h | |
| | | | |
| skipping to change at line 21 | | skipping to change at line 21 | |
| // POSSIBILITY OF SUCH DAMAGES | | // POSSIBILITY OF SUCH DAMAGES | |
| | | | |
| /*! | | /*! | |
| * \file | | * \file | |
| * \brief | | * \brief | |
| */ | | */ | |
| | | | |
| #ifndef _FACTORY_H | | #ifndef _FACTORY_H | |
| #define _FACTORY_H | | #define _FACTORY_H | |
| | | | |
|
| #include "nvscale.h" | | #include "complex.h" | |
| | | | |
|
| namespace nvs | | namespace cpx | |
| { | | { | |
| class Compositor; | | class Compositor; | |
| class RenderArea; | | class RenderArea; | |
| class Distributor; | | class Distributor; | |
| | | | |
| /*! | | /*! | |
| * \brief The Factory is a singleton which creates instances of the | | * \brief The Factory is a singleton which creates instances of the | |
|
| * various component types included in the NVScale library. | | * various component types included in the CompleX library. | |
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| */ | | */ | |
| class Factory | | class Factory | |
| { | | { | |
| private: | | private: | |
| friend class FactoryImpl; | | friend class FactoryImpl; | |
| friend class FactoryInternal; | | friend class FactoryInternal; | |
| Factory(void); | | Factory(void); | |
| Factory(const Factory &rhs); | | Factory(const Factory &rhs); | |
| Factory &operator=(const Factory &rhs); | | Factory &operator=(const Factory &rhs); | |
| | | | |
| protected: | | protected: | |
| virtual ~Factory() {} | | virtual ~Factory() {} | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
| * \brief Get a pointer to the global Factory instance. | | * \brief Get a pointer to the global Factory instance. | |
| */ | | */ | |
|
| static NVS_API Factory* getInstance(void); | | static CPX_API Factory* getInstance(void); | |
| | | | |
| /*! | | /*! | |
| * \brief Create a Compositor employing the requested technique. | | * \brief Create a Compositor employing the requested technique. | |
| * \param out | | * \param out | |
| * The output parameter that will receive the Compositor instance. | | * The output parameter that will receive the Compositor instance. | |
| * On successful return, instance will control a network of numNode
s | | * On successful return, instance will control a network of numNode
s | |
| * Nodes, using CompositionTechnique tech. | | * Nodes, using CompositionTechnique tech. | |
| * \param tech | | * \param tech | |
| * The technique to be employed by the created Compositor. | | * The technique to be employed by the created Compositor. | |
| * Must be one of the techniques enumerated in CompositionTechnique
:\n | | * Must be one of the techniques enumerated in CompositionTechnique
:\n | |
|
| * 'NVS_CT_DEPTH' for composition based on depth buffer values;\n | | * 'CPX_CT_DEPTH' for composition based on depth buffer values;\n | |
| * 'NVS_CT_ALPHA' for composition based on alpha channel values;\n | | * 'CPX_CT_ALPHA' for composition based on alpha channel values;\n | |
| * 'NVS_CT_SCREEN' for composition based solely on order and layout | | * 'CPX_CT_SCREEN' for composition based solely on order and layout | |
| settings;\n | | settings;\n | |
| * 'NVS_CT_SKIP' to go through the motions of composition, but not | | * 'CPX_CT_SKIP' to go through the motions of composition, but not | |
| move any data.\n | | move any data.\n | |
| * \param numNodes | | * \param numNodes | |
| * Number of Nodes in the compositor network including all source N
odes | | * Number of Nodes in the compositor network including all source N
odes | |
| * and the destination Node. Must be at least 2. | | * and the destination Node. Must be at least 2. | |
| * \return | | * \return | |
|
| * 'NVS_INVALID_ENUM' if tech is NVS_CT_INVALID or not an accepted | | * 'CPX_R_INVALID_ENUM' if tech is CPX_CT_INVALID or not an accepte | |
| value;\n | | d value;\n | |
| * 'NVS_INVALID_PARAM' if out is NULL;\n | | * 'CPX_R_INVALID_PARAM' if out is NULL;\n | |
| * 'NVS_INVALID_PARAM' if numNodes is not at least 2;\n | | * 'CPX_R_INVALID_PARAM' if numNodes is not at least 2;\n | |
| * 'NVS_GENERIC_FAILURE' if the Compositor could not be created;\n | | * 'CPX_R_GENERIC_FAILURE' if the Compositor could not be created;\ | |
| * 'NVS_SUCCESS' otherwise.\n | | n | |
| | | * 'CPX_R_SUCCESS' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result createCompositor(Compositor **out, | | virtual CPX_API Result createCompositor(Compositor **out, | |
| CompositionTechnique tech, | | CompositionTechnique tech, | |
| int numNodes) = 0; | | int numNodes) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Destroy a compositor previously created by the factory. | | * \brief Destroy a compositor previously created by the factory. | |
| * \param compositor The Compositor object to destroy. | | * \param compositor The Compositor object to destroy. | |
| * \return | | * \return | |
|
| * 'NVS_INVALID_OBJECT' if compositor is NULL;\n | | * 'CPX_R_INVALID_OBJECT' if compositor is NULL;\n | |
| * 'NVS_SUCCESS' otherwise.\n | | * 'CPX_R_SUCCESS' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result destroyCompositor(Compositor *compositor) =
0; | | virtual CPX_API Result destroyCompositor(Compositor *compositor) =
0; | |
| | | | |
| /*! | | /*! | |
| * \brief Create a Distributor employing the specified technique. | | * \brief Create a Distributor employing the specified technique. | |
| * \param out | | * \param out | |
| * The output parameter that will receive the Distributor instance. | | * The output parameter that will receive the Distributor instance. | |
| * \param tech | | * \param tech | |
| * The technique to be employed by the created Distributor. | | * The technique to be employed by the created Distributor. | |
| * Must be one of the techniques enumerated in DistributionTechniqu
e:\n | | * Must be one of the techniques enumerated in DistributionTechniqu
e:\n | |
|
| * 'NVS_DT_GREEDY' for simple weight-minimization (suitable for dep | | * 'CPX_DT_GREEDY' for simple weight-minimization (suitable for dep | |
| th composition);\n | | th composition);\n | |
| * 'NVS_DT_SPATIAL' for spatially partitioned distribution (for alp | | * 'CPX_DT_SPATIAL' for spatially partitioned distribution (for alp | |
| ha composition).\n | | ha composition).\n | |
| * \param numNodes | | * \param numNodes | |
| * The number of Nodes that will render a portion of the scene. Th
is is | | * The number of Nodes that will render a portion of the scene. Th
is is | |
| * usually the number of Nodes in the compositor network. | | * usually the number of Nodes in the compositor network. | |
| * \return | | * \return | |
|
| * 'NVS_INVALID_ENUM' if tech is NVS_DT_INVALID or not an accepted | | * 'CPX_R_INVALID_ENUM' if tech is CPX_DT_INVALID or not an accepte | |
| value;\n | | d value;\n | |
| * 'NVS_INVALID_PARAM' if out is NULL;\n | | * 'CPX_R_INVALID_PARAM' if out is NULL;\n | |
| * 'NVS_INVALID_PARAM' if numNodes is not at least 2;\n | | * 'CPX_R_INVALID_PARAM' if numNodes is not at least 2;\n | |
| * 'NVS_GENERIC_FAILURE' if the Distributor could not be created;\n | | * 'CPX_R_GENERIC_FAILURE' if the Distributor could not be created; | |
| * 'NVS_SUCCESS' otherwise.\n | | \n | |
| | | * 'CPX_R_SUCCESS' otherwise.\n | |
| * \remarks | | * \remarks | |
| * A Distributor handles the task of deciding which scene objects a
re | | * A Distributor handles the task of deciding which scene objects a
re | |
| * rendered on which Nodes in a distributed rendering environment.
Using | | * rendered on which Nodes in a distributed rendering environment.
Using | |
| * a Distributor is not required for composition to work, but any | | * a Distributor is not required for composition to work, but any | |
| * alternative manual distribution technique must produce results w
hich | | * alternative manual distribution technique must produce results w
hich | |
| * are compatible with the desired CompositionTechnique. Alpha | | * are compatible with the desired CompositionTechnique. Alpha | |
|
| * composition (NVS_CT_ALPHA) requires strict depth-sortability of | | * composition (CPX_CT_ALPHA) requires strict depth-sortability of | |
| the portions | | the portions | |
| * rendered on each Node. Depth composition (NVS_CT_DEPTH) require | | * rendered on each Node. Depth composition (CPX_CT_DEPTH) require | |
| s that translucent | | s that translucent | |
| * objects be rendered after image composition on the Node that hos
ts | | * objects be rendered after image composition on the Node that hos
ts | |
| * the composited image. | | * the composited image. | |
| * \remarks | | * \remarks | |
| * When using depth or alpha composition, the recommended Distribut
or | | * When using depth or alpha composition, the recommended Distribut
or | |
| * can be created by passing the result of | | * can be created by passing the result of | |
| * getRecommendedDistributionTechnique() to this method. | | * getRecommendedDistributionTechnique() to this method. | |
| * \sa getRecommendedDistributionTechnique() | | * \sa getRecommendedDistributionTechnique() | |
| */ | | */ | |
|
| virtual NVS_API Result createDistributor(Distributor **out, | | virtual CPX_API Result createDistributor(Distributor **out, | |
| DistributionTechnique tech
, | | DistributionTechnique tech
, | |
| int numNodes) = 0; | | int numNodes) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Destroy a distributor previously created by the factory. | | * \brief Destroy a distributor previously created by the factory. | |
| * \param distributor The Distributor object to destroy. | | * \param distributor The Distributor object to destroy. | |
| * \return | | * \return | |
|
| * 'NVS_INVALID_OBJECT' if distributor is NULL;\n | | * 'CPX_R_INVALID_OBJECT' if distributor is NULL;\n | |
| * 'NVS_SUCCESS' otherwise.\n | | * 'CPX_R_SUCCESS' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result destroyDistributor(Distributor *distributor)
= 0; | | virtual CPX_API Result destroyDistributor(Distributor *distributor)
= 0; | |
| | | | |
| /*! | | /*! | |
| * \brief | | * \brief | |
| * Get the recommended distribution technique for the specified | | * Get the recommended distribution technique for the specified | |
| * CompositionTechnique. | | * CompositionTechnique. | |
| * \param tech | | * \param tech | |
| * One of the techniques enumerated in CompositionTechnique. | | * One of the techniques enumerated in CompositionTechnique. | |
| * \return | | * \return | |
|
| * NVS_DT_INVALID if tech does not name a CompositionTechnique | | * CPX_DT_INVALID if tech does not name a CompositionTechnique | |
| * for which recommendations are available, otherwise the recommend
ed | | * for which recommendations are available, otherwise the recommend
ed | |
| * DistributionTechnique. | | * DistributionTechnique. | |
| * \remarks | | * \remarks | |
| * A Distributor handles the task of deciding which scene objects a
re | | * A Distributor handles the task of deciding which scene objects a
re | |
| * rendered on which Nodes in a distributed rendering environment.
Using | | * rendered on which Nodes in a distributed rendering environment.
Using | |
| * a Distributor is not required for composition to work, but any | | * a Distributor is not required for composition to work, but any | |
| * alternative manual distribution technique must produce results w
ith | | * alternative manual distribution technique must produce results w
ith | |
| * similarly compatible characteristics. Alpha composition require
s | | * similarly compatible characteristics. Alpha composition require
s | |
| * strict depth-sortability of portions rendered on each Node. Dep
th | | * strict depth-sortability of portions rendered on each Node. Dep
th | |
| * composition requires that translucent objects be rendered after
image | | * composition requires that translucent objects be rendered after
image | |
| * composition on the Node that hosts the composited image. | | * composition on the Node that hosts the composited image. | |
| * \remarks | | * \remarks | |
| * The returned DistributorType can be used to instantiate a Distri
butor | | * The returned DistributorType can be used to instantiate a Distri
butor | |
| * object by calling createDistributor(). It is an error to create
a | | * object by calling createDistributor(). It is an error to create
a | |
|
| * Distributor of type NVS_DT_INVALID. | | * Distributor of type CPX_DT_INVALID. | |
| * \sa createDistributor | | * \sa createDistributor | |
| */ | | */ | |
|
| virtual NVS_API DistributionTechnique | | virtual CPX_API DistributionTechnique | |
| getRecommendedDistributionTechnique(CompositionTechnique tech) = 0; | | getRecommendedDistributionTechnique(CompositionTechnique tech) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Create a RenderArea, as-yet unaffiliated with a specific
GPU. | | * \brief Create a RenderArea, as-yet unaffiliated with a specific
GPU. | |
| * \param out | | * \param out | |
| * The output parameter that will receive the RenderArea instance. | | * The output parameter that will receive the RenderArea instance. | |
| * \remarks | | * \remarks | |
| * The RenderArea must be initialized and then resized before it ca
n be | | * The RenderArea must be initialized and then resized before it ca
n be | |
| * used. | | * used. | |
| * \return | | * \return | |
|
| * 'NVS_INVALID_PARAM' if out is NULL;\n | | * 'CPX_R_INVALID_PARAM' if out is NULL;\n | |
| * 'NVS_SUCCESS' otherwise.\n | | * 'CPX_R_SUCCESS' otherwise.\n | |
| * \sa RenderArea::initialize | | * \sa RenderArea::initialize | |
| * \sa RenderArea::resize | | * \sa RenderArea::resize | |
| */ | | */ | |
|
| virtual NVS_API Result createRenderArea(RenderArea **out) = 0; | | virtual CPX_API Result createRenderArea(RenderArea **out) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Destroy a RenderArea obtained with createRenderArea() | | * \brief Destroy a RenderArea obtained with createRenderArea() | |
| * \param ra The RenderArea to destroy. | | * \param ra The RenderArea to destroy. | |
| * \return | | * \return | |
|
| * 'NVS_INVALID_OBJECT' if ra is NULL;\n | | * 'CPX_R_INVALID_OBJECT' if ra is NULL;\n | |
| * 'NVS_SUCCESS' otherwise.\n | | * 'CPX_R_SUCCESS' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result destroyRenderArea(RenderArea *ra) = 0; | | virtual CPX_API Result destroyRenderArea(RenderArea *ra) = 0; | |
| }; | | }; | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
End of changes. 22 change blocks. |
| 48 lines changed or deleted | | 50 lines changed or added | |
|
| Object.h | | Object.h | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 151 | |
| * Object, until an object code is encountered a handler function is reg
istered for. */ | | * Object, until an object code is encountered a handler function is reg
istered for. */ | |
| class Object : public nvutil::HandledObject, public DALHostHolder
// an object can host DAL data | | class Object : public nvutil::HandledObject, public DALHostHolder
// an object can host DAL data | |
| { | | { | |
| public: | | public: | |
| | | | |
| enum | | enum | |
| { | | { | |
| /*! \brief Flags the Object as always visible | | /*! \brief Flags the Object as always visible | |
| * \remarks A visible-flagged Object will not be considered by the | | * \remarks A visible-flagged Object will not be considered by the | |
| * frameworks cull step. By default, this hint is not set. */ | | * frameworks cull step. By default, this hint is not set. */ | |
|
| NVSG_HINT_ALWAYS_VISIBLE = BIT0, // always visible | | NVSG_HINT_ALWAYS_VISIBLE = BIT0, // always visi
ble | |
| | | | |
| /*! \brief Flags the Object as always invisible | | /*! \brief Flags the Object as always invisible | |
| * \remarks An invisible-flagged Object will not be processed by the | | * \remarks An invisible-flagged Object will not be processed by the | |
| * render framework. By default, this hint is not set. */ | | * render framework. By default, this hint is not set. */ | |
|
| NVSG_HINT_ALWAYS_INVISIBLE = BIT1, // never visible | | NVSG_HINT_ALWAYS_INVISIBLE = BIT1, // never visib
le | |
| NVSG_HINT_VISIBILITY_MASK = NVSG_HINT_ALWAYS_VISIBLE | NVSG_HINT_ALWA
YS_INVISIBLE, | | NVSG_HINT_VISIBILITY_MASK = NVSG_HINT_ALWAYS_VISIBLE | NVSG_HINT_ALWA
YS_INVISIBLE, | |
| | | | |
| /* \brief Flags the Object not to cast shadows | | /* \brief Flags the Object not to cast shadows | |
| * \remarks Shadow algorithms can consider this hint for optimized | | * \remarks Shadow algorithms can consider this hint for optimized | |
| * strategy. */ | | * strategy. */ | |
|
| NVSG_HINT_NO_SHADOW_CASTER = BIT2, | | NVSG_HINT_NO_SHADOW_CASTER = BIT2, | |
| | | | |
| /* \brief Flags the Object not to receive shadows | | /* \brief Flags the Object not to receive shadows | |
| * \remarks Shadow algorithms can consider this hint for optimized | | * \remarks Shadow algorithms can consider this hint for optimized | |
| * strategy. */ | | * strategy. */ | |
|
| NVSG_HINT_NO_SHADOW_RECEIVER = BIT3, | | NVSG_HINT_NO_SHADOW_RECEIVER = BIT3, | |
| | | | |
| /* \brief Flags the Object as overlay Object | | /* \brief Flags the Object as overlay Object | |
| * \remarks An overlay Object will always be rendered on top of other | | * \remarks An overlay Object will always be rendered on top of other | |
| * non-overlay Objects independent of the Objects z-depth. By default
, | | * non-overlay Objects independent of the Objects z-depth. By default
, | |
| * this hint is not set. */ | | * this hint is not set. */ | |
|
| NVSG_HINT_OVERLAY = BIT4, | | NVSG_HINT_OVERLAY = BIT4, | |
| | | | |
| /*! \brief Flags the Object as frequently altering | | /*! \brief Flags the Object as frequently altering | |
| * \remarks The processing framework considers dynamic-flagged object
s | | * \remarks The processing framework considers dynamic-flagged object
s | |
| * different from ordinary non-dynamic Objects to yield optimized ren
der | | * different from ordinary non-dynamic Objects to yield optimized ren
der | |
| * performance. By default, an Object is not flagged dynamic. */ | | * performance. By default, an Object is not flagged dynamic. */ | |
|
| NVSG_HINT_DYNAMIC = BIT5, | | NVSG_HINT_DYNAMIC = BIT5, | |
| | | | |
| /*! \brief Flags the Object as not being considered for clipping | | /*! \brief Flags the Object as not being considered for clipping | |
| * \remarks During rendering, active clip planes have no effect on Ob
jects | | * \remarks During rendering, active clip planes have no effect on Ob
jects | |
| * that have the NVSG_HINT_DONT_CLIP bit set. This hint only applies
to | | * that have the NVSG_HINT_DONT_CLIP bit set. This hint only applies
to | |
| * Node-derived Objects. */ | | * Node-derived Objects. */ | |
|
| NVSG_HINT_DONT_CLIP = BIT6, | | NVSG_HINT_DONT_CLIP = BIT6, | |
| | | | |
|
| NVSG_HINT_LAST_HINT = NVSG_HINT_DONT_CLIP, | | /* \brief Advises the ray tracing framework to use high quality AS b | |
| | | uilder | |
| | | * \remarks The flag advises the ray tracing engine to use high qual | |
| | | ity AS builder for | |
| | | * this particular object. Higher quality acceleration structures po | |
| | | tentially take longer | |
| | | * to be built and probably require more memory, but often support c | |
| | | onsiderably faster ray | |
| | | * tracing than lower quality acceleration structures. */ | |
| | | NVSG_HINT_HIGH_QUALITY_ACCELERATION_BUILDER = BIT7, | |
| | | | |
| | | NVSG_HINT_LAST_HINT = NVSG_HINT_HIGH_QUALITY_ | |
| | | ACCELERATION_BUILDER, | |
| | | | |
| /*! \brief All possible hints */ | | /*! \brief All possible hints */ | |
|
| NVSG_HINT_ALL_HINTS = (NVSG_HINT_LAST_HINT << 1)
- 1 | | NVSG_HINT_ALL_HINTS = (NVSG_HINT_LAST_HINT <<
1) - 1 | |
| }; | | }; | |
| | | | |
| enum | | enum | |
| { | | { | |
| NVSG_INCARNATION = BIT0, | | NVSG_INCARNATION = BIT0, | |
| NVSG_INCARNATION_VALID = NVSG_INCARNATION, // alias | | NVSG_INCARNATION_VALID = NVSG_INCARNATION, // alias | |
| NVSG_TREE_INCARNATION = BIT1, | | NVSG_TREE_INCARNATION = BIT1, | |
| NVSG_TREE_INCARNATION_VALID = NVSG_TREE_INCARNATION, //
alias | | NVSG_TREE_INCARNATION_VALID = NVSG_TREE_INCARNATION, //
alias | |
| NVSG_SWITCH_INCARNATION = BIT2, | | NVSG_SWITCH_INCARNATION = BIT2, | |
| NVSG_SWITCH_INCARNATION_VALID = NVSG_SWITCH_INCARNATION, //
alias | | NVSG_SWITCH_INCARNATION_VALID = NVSG_SWITCH_INCARNATION, //
alias | |
| | | | |
| skipping to change at line 418 | | skipping to change at line 425 | |
| NVSG_API const void* getUserData() const; | | NVSG_API const void* getUserData() const; | |
| | | | |
| /*! \brief Retrieves Object hints | | /*! \brief Retrieves Object hints | |
| * \param mask | | * \param mask | |
| * Specifies a bit mask to indicate the Object hints to retrieve. | | * Specifies a bit mask to indicate the Object hints to retrieve. | |
| * \return | | * \return | |
| * The function returns the Object's hint bits filtered by the input ma
sk. | | * The function returns the Object's hint bits filtered by the input ma
sk. | |
| * \remarks | | * \remarks | |
| * An object can be given hints indicating a certain Object properties. | | * An object can be given hints indicating a certain Object properties. | |
| * Currently supported Object hints are NVSG_HINT_DYNAMIC, NVSG_HINT_AL
WAYS_VISIBLE, | | * Currently supported Object hints are NVSG_HINT_DYNAMIC, NVSG_HINT_AL
WAYS_VISIBLE, | |
|
| * NVSG_HINT_ALWAYS_INVISIBLE, NVSG_HINT_OVERLAY, NVSG_HINT_SHADOW_CAST | | * NVSG_HINT_ALWAYS_INVISIBLE, NVSG_HINT_OVERLAY, NVSG_HINT_SHADOW_CAST | |
| ER, and | | ER, | |
| * NVSG_HINT_SHADOW_RECEIVER. | | * NVSG_HINT_SHADOW_RECEIVER, and NVSG_HINT_HIGH_QUALITY_ACCELERATION_B | |
| | | UILDER. | |
| * \sa setHints, addHints, removeHints */ | | * \sa setHints, addHints, removeHints */ | |
| NVSG_API unsigned int getHints( unsigned int mask = ~0 ) const; | | NVSG_API unsigned int getHints( unsigned int mask = ~0 ) const; | |
| | | | |
| /*! \brief Assigns indicated hints to the Object | | /*! \brief Assigns indicated hints to the Object | |
| * \param hints | | * \param hints | |
| * Specifies the hints to assign to the Object. Allowed bits are | | * Specifies the hints to assign to the Object. Allowed bits are | |
| * NVSG_HINT_DYNAMIC, NVSG_HINT_ALWAYS_VISIBLE, NVSG_HINT_ALWAYS_INVISI
BLE, | | * NVSG_HINT_DYNAMIC, NVSG_HINT_ALWAYS_VISIBLE, NVSG_HINT_ALWAYS_INVISI
BLE, | |
| * NVSG_HINT_OVERLAY, NVSG_HINT_SHADOW_CASTER, NVSG_HINT_SHADOW_RECEIVE
R, | | * NVSG_HINT_OVERLAY, NVSG_HINT_SHADOW_CASTER, NVSG_HINT_SHADOW_RECEIVE
R, | |
|
| * or any combination of these. | | * NVSG_HINT_HIGH_QUALITY_ACCELERATION_BUILDER or any combination of th
ese. | |
| * \remarks | | * \remarks | |
| * The function assigns the indicated hints to the Object. Previously a
ssigned | | * The function assigns the indicated hints to the Object. Previously a
ssigned | |
| * hints will be overriden. If you intend to keep previosly assigned hi
nts, | | * hints will be overriden. If you intend to keep previosly assigned hi
nts, | |
| * you should use addHints instead. | | * you should use addHints instead. | |
| * \sa getHints, addHints, removeHints */ | | * \sa getHints, addHints, removeHints */ | |
| NVSG_API void setHints( unsigned int hints ); | | NVSG_API void setHints( unsigned int hints ); | |
| | | | |
| /*! \brief Adds indicated hints to the Object | | /*! \brief Adds indicated hints to the Object | |
| * \param hints | | * \param hints | |
| * Specifies the hints to add to the Object. Allowed bits are | | * Specifies the hints to add to the Object. Allowed bits are | |
| | | | |
End of changes. 11 change blocks. |
| 13 lines changed or deleted | | 26 lines changed or added | |
|
| RTFx.h | | RTFx.h | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 58 | |
| /*! \brief Assigns contents from a source RTFx object. | | /*! \brief Assigns contents from a source RTFx object. | |
| * \param | | * \param | |
| * rhs Source RTFx object | | * rhs Source RTFx object | |
| * \return | | * \return | |
| * The assignment operator returns a reference to this RTFx object. | | * The assignment operator returns a reference to this RTFx object. | |
| * \remarks | | * \remarks | |
| * The assignment operator releases old contents before re-assigning t
he new contents. | | * The assignment operator releases old contents before re-assigning t
he new contents. | |
| */ | | */ | |
| NVSG_API RTFxBase& operator=(const RTFxBase& rhs); | | NVSG_API RTFxBase& operator=(const RTFxBase& rhs); | |
| | | | |
|
| /*! \brief Returns whether this object shares its embedded data with ot | | | |
| her RTFx objects. | | | |
| * \return | | | |
| * The function returns \c true if the object shares its embedded data | | | |
| with another RTFx object. | | | |
| * Otherwise, the function returns \c false. | | | |
| * \remarks | | | |
| * This function is useful only if you need to deal with shared data. | | | |
| * \n\n | | | |
| * A certain RTFx object shares its data with another RTFx object if i | | | |
| t was either instantiated | | | |
| * as a copy of the other object (RTFxHandle::clone), or if it was ass | | | |
| igned to by the other object | | | |
| * using the RTFx::operator= assignment operator. | | | |
| * \n\n | | | |
| * If you need to write code that, for instance, saves a RTFx object t | | | |
| o a file, you | | | |
| * can use this function if you want your code to handle shared data. | | | |
| In this context, | | | |
| * RTFx::getDataID would be also very helpful to identify the shared d | | | |
| ata. | | | |
| */ | | | |
| NVSG_API virtual bool isDataShared() const; | | | |
| | | | |
| /*! \brief Returns the unique data identifier for this object. | | | |
| * \return | | | |
| * The function returns a 64-bit value which uniquely identifies the e | | | |
| mbedded data. | | | |
| * \remarks | | | |
| * This function helps to identify shared RTFx objects. Two RTFx objec | | | |
| ts that share their data | | | |
| * do have the same data ID. Use RTFx::isDataShared to determine wheth | | | |
| er a certain RTFx object | | | |
| * shares its data with other RTFx objects. | | | |
| * \sa RTFxHandle::clone, RTFx::operator=() | | | |
| */ | | | |
| NVSG_API virtual DataID getDataID() const; | | | |
| | | | |
| /*! \brief Overrides Object::isEquivalent. | | /*! \brief Overrides Object::isEquivalent. | |
| * \param | | * \param | |
| * object Pointer to the const Object to test for equivalence with thi
s RTFx object. | | * object Pointer to the const Object to test for equivalence with thi
s RTFx object. | |
| * \param | | * \param | |
| * ignoreNames Object names will be ignored while testing if this is \
c true. | | * ignoreNames Object names will be ignored while testing if this is \
c true. | |
| * \param | | * \param | |
| * deepCompare The function performs a deep-compare instead of a shall
ow compare if this is \c true. | | * deepCompare The function performs a deep-compare instead of a shall
ow compare if this is \c true. | |
| * \return | | * \return | |
| * The function returns \c true if the Object pointed to by \a object
is detected to be equivalent | | * The function returns \c true if the Object pointed to by \a object
is detected to be equivalent | |
| * to this RTFx object. | | * to this RTFx object. | |
| * \remarks | | * \remarks | |
| * The test will consider the optional control parameters ignoreNames
and deepCompare. | | * The test will consider the optional control parameters ignoreNames
and deepCompare. | |
| * If you omit these two, the function ignores the object names and pe
rforms a shallow | | * If you omit these two, the function ignores the object names and pe
rforms a shallow | |
| * compare only. | | * compare only. | |
| * \sa Object::isEquivalent | | * \sa Object::isEquivalent | |
| */ | | */ | |
| NVSG_API virtual bool isSameAs(const RTFxBase *object, bool ignoreNames
, bool deepCompare) const; | | NVSG_API virtual bool isSameAs(const RTFxBase *object, bool ignoreNames
, bool deepCompare) const; | |
| | | | |
|
| /*! \brief Get a count of textures in this RTFx. | | /*! \brief Interface to get the RTFxProgram of this object. | |
| * \return Integer count of textures declared in this RTFx. | | * \return A pointer to the RTFxProgram of this object. | |
| * \remarks Returns a count of textures that have been defined in this | | * \remarks All classes deriving from RTFxBase have to provide this fu | |
| RTFx. | | nction. As ownership handling | |
| * \sa RTFx::getTexture */ | | * of an RTFxProgram needs an Object, the RTFxProgram can't be a part | |
| NVSG_API unsigned int getNumberOfTextures() const; | | of the RTFxBase. That is, all | |
| | | * concrete classes deriving from RTFxBase should also derive from Obj | |
| /*! \brief Get a handle to the texture by index. | | ect (or a class derived from | |
| * \return RTFxTexture handle, or NULL if index was invalid. | | * Object). */ | |
| * \param index The index of the texture to query. | | NVSG_API virtual nvsg::RTFxProgramHandle * getProgram() const = 0; | |
| * \remarks Returns the texture at the given index. | | | |
| * \note The behavior is undefined, if \a index is larger or equal to | | | |
| the number of textures in | | | |
| * this RTFx. | | | |
| * \sa getNumberOfTextures */ | | | |
| NVSG_API TextureAttributeItemHandle * getTexture( unsigned int index ) | | | |
| const; | | | |
| | | | |
| /*! \brief Get a count of parameters in this RTFx. | | /*! \brief Get a count of parameters in this RTFx. | |
| * \return | | * \return | |
| * Integer parameter count. | | * Integer parameter count. | |
| * \remarks | | * \remarks | |
| * Returns the number of parameters in this RTFx. Parameters may have
been defined programmatically or | | * Returns the number of parameters in this RTFx. Parameters may have
been defined programmatically or | |
| * in the RTFx file itself. | | * in the RTFx file itself. | |
| */ | | */ | |
| NVSG_API virtual unsigned int getNumberOfParameters() const; | | NVSG_API virtual unsigned int getNumberOfParameters() const; | |
| | | | |
| | | | |
| skipping to change at line 153 | | skipping to change at line 118 | |
| * \param name The name of the parameter to get the index of. | | * \param name The name of the parameter to get the index of. | |
| * \return The index of the parameter named by \a name in this set of
parameters, or ~0, if the | | * \return The index of the parameter named by \a name in this set of
parameters, or ~0, if the | |
| * parameter is not part of this set of parameters. | | * parameter is not part of this set of parameters. | |
| * \sa getNumberOfParameters, containsParameter */ | | * \sa getNumberOfParameters, containsParameter */ | |
| NVSG_API unsigned int getParameterIndex( const std::string & name ) con
st; | | NVSG_API unsigned int getParameterIndex( const std::string & name ) con
st; | |
| | | | |
| /*! \brief Add a parameter to the RTFxBase. | | /*! \brief Add a parameter to the RTFxBase. | |
| * \param name Name of the parameter to add. | | * \param name Name of the parameter to add. | |
| * \param type Type of the parameter to add. | | * \param type Type of the parameter to add. | |
| * \param count Number of elements of type \a type in the parameter to
add | | * \param count Number of elements of type \a type in the parameter to
add | |
|
| | | * \param size Memory footprint size in bytes (sizeof(structure)*count
) if the type is PT_USER_DATA. Otherwise, ignored. | |
| * \param semantic The semantic to assign to the variable (see note). | | * \param semantic The semantic to assign to the variable (see note). | |
| * \param annotations The annotations to add to this variable (see not
e). | | * \param annotations The annotations to add to this variable (see not
e). | |
| * \return The index of the newly added parameter. | | * \return The index of the newly added parameter. | |
| * \remarks An RTFxBase manages the values of parameters used in an as
sociated RTFxProgram. | | * \remarks An RTFxBase manages the values of parameters used in an as
sociated RTFxProgram. | |
| * \note The behavior is undefined if there is a variable in the assoc
iated RTFxProgram with | | * \note The behavior is undefined if there is a variable in the assoc
iated RTFxProgram with | |
| * the same name, but of a different type or count. | | * the same name, but of a different type or count. | |
| * \note Semantics and Annotations assigned this way are NOT stored to
any NVSG output files. Only the | | * \note Semantics and Annotations assigned this way are NOT stored to
any NVSG output files. Only the | |
| * semantics and annotations that appear in the RTFx file itself will
be stored to disk. | | * semantics and annotations that appear in the RTFx file itself will
be stored to disk. | |
| * \sa getNumberOfParameters, removeParameter, setParameterValue */ | | * \sa getNumberOfParameters, removeParameter, setParameterValue */ | |
| NVSG_API unsigned int addParameter( const std::string & name, unsigned
char type, unsigned int count, | | NVSG_API unsigned int addParameter( const std::string & name, unsigned
char type, unsigned int count, | |
|
| | | unsigned int size = 0, | |
| const std::string & semantic = std:
:string(), | | const std::string & semantic = std:
:string(), | |
| const std::vector< RTFxParameter::A
nnotation > & annotations = std::vector< RTFxParameter::Annotation >() ); | | const std::vector< RTFxParameter::A
nnotation > & annotations = std::vector< RTFxParameter::Annotation >() ); | |
| | | | |
| /*! \brief Remove a parameter from the RTFxBase. | | /*! \brief Remove a parameter from the RTFxBase. | |
| * \param index The index of the parameter to remove. | | * \param index The index of the parameter to remove. | |
| * \note The behavior is undefined if \a index is larger or equal to t
he number of parameters | | * \note The behavior is undefined if \a index is larger or equal to t
he number of parameters | |
| * in this RTFxBase. | | * in this RTFxBase. | |
| * \sa getNumberOfParameters, addParameter, getParameter */ | | * \sa getNumberOfParameters, addParameter, getParameter */ | |
| NVSG_API void removeParameter( unsigned int index ); | | NVSG_API void removeParameter( unsigned int index ); | |
| | | | |
| /*! \brief Sets a parameter's value using floats. | | /*! \brief Sets a parameter's value using floats. | |
| * \param index The index of the parameter to set. | | * \param index The index of the parameter to set. | |
| * \param f A pointer to a constant array of floating-point data, that
is at least the size of | | * \param f A pointer to a constant array of floating-point data, that
is at least the size of | |
| * the parameter specified by \a index. | | * the parameter specified by \a index. | |
| * \remarks Sets a parameter's value using floating point values. Note
that no conversions are | | * \remarks Sets a parameter's value using floating point values. Note
that no conversions are | |
| * performed. | | * performed. | |
| * \note The behavior is undefined if index is larger than or equal to
the number of parameters | | * \note The behavior is undefined if index is larger than or equal to
the number of parameters | |
| * in this RTFx, or if the specified parameter is not a floating-point
parameter. | | * in this RTFx, or if the specified parameter is not a floating-point
parameter. | |
| * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | | * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, const floa
t* f); | | NVSG_API void setParameterValue( unsigned int index, const float* f); | |
| | | | |
| /*! \brief Sets a parameter's value using signed integers. | | /*! \brief Sets a parameter's value using signed integers. | |
| * \param index The index of the parameter to set. | | * \param index The index of the parameter to set. | |
| * \param i A pointer to a constant array of signed integer data, that
is at least the size of | | * \param i A pointer to a constant array of signed integer data, that
is at least the size of | |
| * the parameter specified by \a index. | | * the parameter specified by \a index. | |
| * \remarks Sets a parameter's value using signed integer values. Note
that no conversions are | | * \remarks Sets a parameter's value using signed integer values. Note
that no conversions are | |
| * performed. | | * performed. | |
| * \note The behavior is undefined if index is larger than or equal to
the number of parameters | | * \note The behavior is undefined if index is larger than or equal to
the number of parameters | |
| * in this RTFx, or if the specified parameter is not a signed integer
parameter. | | * in this RTFx, or if the specified parameter is not a signed integer
parameter. | |
| * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | | * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, const int
* i ); | | NVSG_API void setParameterValue( unsigned int index, const int * i ); | |
| | | | |
| /*! \brief Sets a parameter's value using unsigned integers. | | /*! \brief Sets a parameter's value using unsigned integers. | |
| * \param index The index of the parameter to set. | | * \param index The index of the parameter to set. | |
| * \param ui A pointer to a constant array of unsigned integer data, t
hat is at least the size of | | * \param ui A pointer to a constant array of unsigned integer data, t
hat is at least the size of | |
| * the parameter specified by \a index. | | * the parameter specified by \a index. | |
| * \remarks Sets a parameter's value using unsigned integer values. No
te that no conversions are | | * \remarks Sets a parameter's value using unsigned integer values. No
te that no conversions are | |
| * performed. | | * performed. | |
| * \note The behavior is undefined if index is larger than or equal to
the number of parameters | | * \note The behavior is undefined if index is larger than or equal to
the number of parameters | |
| * in this RTFx, or if the specified parameter is not an unsigned inte
ger parameter. | | * in this RTFx, or if the specified parameter is not an unsigned inte
ger parameter. | |
| * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | | * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, const unsi | | NVSG_API void setParameterValue( unsigned int index, const unsigned int | |
| gned int * ui ); | | * ui ); | |
| | | | |
| | | /*! \brief Sets a parameter's value using untyped pointer. | |
| | | * \param index The index of the parameter to set. | |
| | | * \param v A pointer to untyped memory, that is at least the size of | |
| | | the parameter specified by \a index. | |
| | | * \note The behavior is undefined if index is larger than or equal to | |
| | | the number of parameters | |
| | | * in this RTFx. | |
| | | * \sa getNumberOfParameters, RTFxProgram::getVariableType */ | |
| | | NVSG_API void setParameterValue( unsigned int index, const void * v ); | |
| | | | |
| /*! \brief set buffer value */ | | /*! \brief set buffer value */ | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, nvsg::RTBu
fferAttributeHandle * buffer ); | | NVSG_API void setParameterValue( unsigned int index, nvsg::RTBufferAttr
ibuteHandle * buffer ); | |
| | | | |
| /*! \brief set texture value */ | | /*! \brief set texture value */ | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, nvsg::Text | | NVSG_API void setParameterValue( unsigned int index, nvsg::TextureAttri | |
| ureAttributeItemHandle * tex ); | | buteItemHandle * tex ); | |
| | | | |
| protected: | | | |
| friend class nvtraverser::RTTraverser; | | | |
| | | | |
| protected: | | protected: | |
|
| virtual void resetToDefaults(); | | NVSG_API virtual void onParameterValueChanged() = 0; | |
| | | NVSG_API virtual void resetToDefaults(); | |
| NVSG_API virtual void setProgram( nvsg::RTFxProgramHandle * program ) =
0; | | NVSG_API virtual void setProgram( nvsg::RTFxProgramHandle * program ) =
0; | |
|
| NVSG_API virtual nvsg::RTFxProgramHandle * getProgram() const = 0; | | | |
| NVSG_API void initFromProgram( RTFxProgramHandle * prgHdl ); | | NVSG_API void initFromProgram( RTFxProgramHandle * prgHdl ); | |
| | | | |
| private: | | private: | |
| nvsg::TextureAttributeItemHandle * loadTexture( const std::string & fil
eName, const std::vector<std::string> & searchPaths ); | | nvsg::TextureAttributeItemHandle * loadTexture( const std::string & fil
eName, const std::vector<std::string> & searchPaths ); | |
| | | | |
| private: | | private: | |
|
| std::vector<RTFxParameter> m_parameters; | | std::vector<RTFxParameter> m_parameters; | |
| std::vector<TextureAttributeItemHandle *> m_textures; | | | |
| }; | | }; | |
| | | | |
| class RTFx : public StateAttribute, public RTFxBase | | class RTFx : public StateAttribute, public RTFxBase | |
| { | | { | |
| public: | | public: | |
| NVSG_API RTFx(); | | NVSG_API RTFx(); | |
| NVSG_API RTFx(const RTFx & rhs); | | NVSG_API RTFx(const RTFx & rhs); | |
| NVSG_API RTFx(const StateAttribute & rhs); | | NVSG_API RTFx(const StateAttribute & rhs); | |
| NVSG_API virtual ~RTFx(); | | NVSG_API virtual ~RTFx(); | |
| NVSG_API RTFx& operator=(const RTFx& rhs); | | NVSG_API RTFx& operator=(const RTFx& rhs); | |
| NVSG_API virtual bool isEquivalent(const Object *object, bool ignoreN
ames, bool deepCompare) const; | | NVSG_API virtual bool isEquivalent(const Object *object, bool ignoreN
ames, bool deepCompare) const; | |
| NVSG_API virtual bool isDataShared() const; | | NVSG_API virtual bool isDataShared() const; | |
| NVSG_API virtual DataID getDataID() const; | | NVSG_API virtual DataID getDataID() const; | |
| | | | |
| NVSG_API virtual void resetToDefaults(); | | NVSG_API virtual void resetToDefaults(); | |
| NVSG_API virtual void setProgram( nvsg::RTFxProgramHandle * program )
; | | NVSG_API virtual void setProgram( nvsg::RTFxProgramHandle * program )
; | |
| NVSG_API virtual nvsg::RTFxProgramHandle * getProgram() const; | | NVSG_API virtual nvsg::RTFxProgramHandle * getProgram() const; | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, const fl | | NVSG_API virtual void onParameterValueChanged(); | |
| oat * f ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, const in | | | |
| t * i ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, const un | | | |
| signed int * i ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, nvsg::RT | | | |
| BufferAttributeHandle * buffer ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, nvsg::Te | | | |
| xtureAttributeItemHandle * tex ); | | | |
| | | | |
| private: | | private: | |
|
| | | // Can't have m_program in RTFxBase due to ownership handling, that n
eeds to be done in from inside an Object | |
| nvsg::RTFxProgramHandle * m_program; | | nvsg::RTFxProgramHandle * m_program; | |
| }; | | }; | |
| | | | |
| class RTFxSceneAttribute : public SceneAttribute, public RTFxBase | | class RTFxSceneAttribute : public SceneAttribute, public RTFxBase | |
| { | | { | |
| public: | | public: | |
| NVSG_API RTFxSceneAttribute(); | | NVSG_API RTFxSceneAttribute(); | |
| NVSG_API RTFxSceneAttribute(const RTFxSceneAttribute & rhs); | | NVSG_API RTFxSceneAttribute(const RTFxSceneAttribute & rhs); | |
| NVSG_API RTFxSceneAttribute(const SceneAttribute & rhs); | | NVSG_API RTFxSceneAttribute(const SceneAttribute & rhs); | |
| NVSG_API virtual ~RTFxSceneAttribute(); | | NVSG_API virtual ~RTFxSceneAttribute(); | |
| NVSG_API RTFxSceneAttribute& operator=(const RTFxSceneAttribute& rhs)
; | | NVSG_API RTFxSceneAttribute& operator=(const RTFxSceneAttribute& rhs)
; | |
| NVSG_API virtual bool isEquivalent(const Object *object, bool ignoreN
ames, bool deepCompare) const; | | NVSG_API virtual bool isEquivalent(const Object *object, bool ignoreN
ames, bool deepCompare) const; | |
| NVSG_API virtual bool isDataShared() const; | | NVSG_API virtual bool isDataShared() const; | |
| NVSG_API virtual DataID getDataID() const; | | NVSG_API virtual DataID getDataID() const; | |
| | | | |
| NVSG_API virtual void resetToDefaults(); | | NVSG_API virtual void resetToDefaults(); | |
| NVSG_API virtual void setProgram( nvsg::RTFxProgramHandle * program )
; | | NVSG_API virtual void setProgram( nvsg::RTFxProgramHandle * program )
; | |
| NVSG_API virtual nvsg::RTFxProgramHandle * getProgram() const; | | NVSG_API virtual nvsg::RTFxProgramHandle * getProgram() const; | |
|
| NVSG_API virtual void setParameterValue( unsigned int index, const fl | | NVSG_API virtual void onParameterValueChanged(); | |
| oat * f ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, const in | | | |
| t * i ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, const un | | | |
| signed int * i ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, nvsg::RT | | | |
| BufferAttributeHandle * buffer ); | | | |
| NVSG_API virtual void setParameterValue( unsigned int index, nvsg::Te | | | |
| xtureAttributeItemHandle * tex ); | | | |
| | | | |
| private: | | private: | |
|
| | | // Can't have m_program in RTFxBase due to ownership handling, that n
eeds to be done in from inside an Object | |
| nvsg::RTFxProgramHandle * m_program; | | nvsg::RTFxProgramHandle * m_program; | |
| }; | | }; | |
| } // namespace nvsg | | } // namespace nvsg | |
| | | | |
End of changes. 16 change blocks. |
| 90 lines changed or deleted | | 36 lines changed or added | |
|
| RTFxProgram.h | | RTFxProgram.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| friend class RTFxProgram; | | friend class RTFxProgram; | |
| friend class RTFxBase; | | friend class RTFxBase; | |
| | | | |
| public: | | public: | |
| // enum value for parameter types besides the standard scalar values | | // enum value for parameter types besides the standard scalar values | |
| // note - must be named, or can't be used in checked_cast<> | | // note - must be named, or can't be used in checked_cast<> | |
| enum AdditionalTypes | | enum AdditionalTypes | |
| { | | { | |
| PT_BUFFER = 0x80, | | PT_BUFFER = 0x80, | |
| PT_OBJECT, | | PT_OBJECT, | |
|
| PT_TEXTURE_SAMPLER | | PT_TEXTURE_SAMPLER, | |
| | | PT_USER_DATA | |
| }; | | }; | |
| | | | |
| struct Annotation | | struct Annotation | |
| { | | { | |
| std::string type; | | std::string type; | |
| std::string name; | | std::string name; | |
| std::string value; | | std::string value; | |
| NVSG_API bool operator==( const Annotation & rhs ) const; | | NVSG_API bool operator==( const Annotation & rhs ) const; | |
| }; | | }; | |
| | | | |
| public: | | public: | |
| NVSG_API RTFxParameter(); | | NVSG_API RTFxParameter(); | |
|
| NVSG_API RTFxParameter( const std::string & name, unsigned char type, | | /*! \brief Constructs a new parameter. | |
| unsigned char count ); | | * \param name The parameter's name. | |
| | | * \param type The parameter's type. For a 'float3' type this would | |
| | | be NVSG_FLOAT. | |
| | | * \param count The number of elements in the parameter or array. F | |
| | | or float3 this would be 3. | |
| | | * \param size The parameter's size in bytes. For a PT_USER_DATA pa | |
| | | rameter, this would be | |
| | | * sizeof( structure ) * count. For other parameter types, it is ig | |
| | | nored since the size can be | |
| | | * determined from the data type and count. | |
| | | */ | |
| | | NVSG_API RTFxParameter( const std::string & name, unsigned char type, | |
| | | unsigned char count, unsigned int size ); | |
| NVSG_API RTFxParameter( const RTFxParameter & rhs ); | | NVSG_API RTFxParameter( const RTFxParameter & rhs ); | |
| NVSG_API ~RTFxParameter(); | | NVSG_API ~RTFxParameter(); | |
| | | | |
|
| | | NVSG_API RTFxParameter & operator=( const RTFxParameter & rhs ); | |
| NVSG_API bool operator==( const RTFxParameter & rhs ) const; | | NVSG_API bool operator==( const RTFxParameter & rhs ) const; | |
| | | | |
| NVSG_API const std::string & getName() const; | | NVSG_API const std::string & getName() const; | |
|
| | | /*! \brief Returns the data type */ | |
| NVSG_API unsigned char getType() const; | | NVSG_API unsigned char getType() const; | |
|
| NVSG_API unsigned char getCount() const; | | /*! \brief Returns the number of elements in the array. | |
| | | * \note Since the RTFx parser only has access to the PTX declaring | |
| | | the parameter's total size in bytes, is not | |
| | | * possible to independently determine the count and size of the dat | |
| | | a structure for PT_USER_DATA types. | |
| | | * Therefore, all PT_USER_DATA typed parameters will have a count of | |
| | | 1. */ | |
| | | NVSG_API unsigned char getCount() const; | |
| | | /*! \brief Returns the total size of the data structure (sizeof(type) | |
| | | *count). | |
| | | * \note Since the RTFx parser only has access to the PTX declaring | |
| | | the parameter's total size in bytes, is not | |
| | | * possible to independently determine the count and size of the dat | |
| | | a structure for PT_USER_DATA types. | |
| | | * Therefore, all PT_USER_DATA typed parameters will have a size equ | |
| | | al to the entire data structure array. */ | |
| | | NVSG_API unsigned int getSize() const; | |
| | | | |
| | | /*! \brief Gets a parameter's value using a void *. | |
| | | * \param v A pointer to untyped memory, that is at least the size o | |
| | | f the parameter. | |
| | | * \remarks Gets a parameter's value. | |
| | | * \note This method is typically used for parameters of type PT_USE | |
| | | R_DATA. | |
| | | * \sa getType, getSize, getName, setValue */ | |
| | | NVSG_API void getValue( void * v ) const; | |
| | | | |
| | | /*! \brief Sets a parameter's value using a void *. | |
| | | * parameter. | |
| | | * \param v A pointer to untyped memory, that is at least the size o | |
| | | f the parameter. | |
| | | * \remarks Sets a parameter's value. | |
| | | * \note This method is typically used for parameters of type PT_USE | |
| | | R_DATA. | |
| | | * \sa getType, getSize, getName, getValue */ | |
| | | NVSG_API void setValue( const void * v ); | |
| | | | |
| /*! \brief Gets a parameter's value using floats. | | /*! \brief Gets a parameter's value using floats. | |
| * \param f A pointer to an array of floating-point data, that is at
least the size of the | | * \param f A pointer to an array of floating-point data, that is at
least the size of the | |
| * parameter. | | * parameter. | |
| * \remarks Gets a floating-point parameter's value. Note that no co
nversions are performed. | | * \remarks Gets a floating-point parameter's value. Note that no co
nversions are performed. | |
| * \note The behavior is undefined the specified parameter is not a
floating-point parameter. | | * \note The behavior is undefined the specified parameter is not a
floating-point parameter. | |
| * \sa getType, getName, setValue */ | | * \sa getType, getName, setValue */ | |
| NVSG_API void getValue( float * f ) const; | | NVSG_API void getValue( float * f ) const; | |
| | | | |
| /*! \brief Sets a parameter's value using floats. | | /*! \brief Sets a parameter's value using floats. | |
| | | | |
| skipping to change at line 178 | | skipping to change at line 213 | |
| NVSG_API const std::vector<Annotation> & getAnnotations() const; | | NVSG_API const std::vector<Annotation> & getAnnotations() const; | |
| | | | |
| /*! \brief Get variable's semantic. | | /*! \brief Get variable's semantic. | |
| * \param result The returned semantic. | | * \param result The returned semantic. | |
| * \return bool True if the variable has a semantic, false otherwise
. | | * \return bool True if the variable has a semantic, false otherwise
. | |
| * \note semantics are currently immutable | | * \note semantics are currently immutable | |
| * \sa getAnnotation */ | | * \sa getAnnotation */ | |
| NVSG_API bool getSemantic( std::string & result ) const; | | NVSG_API bool getSemantic( std::string & result ) const; | |
| NVSG_API const std::string & getSemantic() const; | | NVSG_API const std::string & getSemantic() const; | |
| | | | |
|
| | | /*! \brief Get variable's type and count from a string description. | |
| | | * \note Unrecognized type names will return type=PT_USER_DATA assum | |
| | | ing the type was a data structure. | |
| | | * In addition, for parameters determined to be of type PT_USER_DATA | |
| | | , count will always be 1. | |
| | | * */ | |
| | | NVSG_API static bool stringToParameterDescription( const std::string | |
| | | & str, unsigned char & type, unsigned char & count ); | |
| | | | |
| | | /*! \brief Returns the named type of this parameter | |
| | | * \remarks If the parameter is a type PT_USER_DATA, and this parame | |
| | | ter was parsed from an RTFx file, | |
| | | * then this will be the data type parsed from the RTFx (ie: the str | |
| | | uct identifier). | |
| | | */ | |
| | | NVSG_API const std::string & getParameterTypeName(); | |
| | | | |
| private: | | private: | |
| NVSG_API void addAnnotation( const Annotation & anno ); | | NVSG_API void addAnnotation( const Annotation & anno ); | |
| | | | |
| // Note: the type is specified by the variable of the same name in th
e associated RTFxProgram !! | | // Note: the type is specified by the variable of the same name in th
e associated RTFxProgram !! | |
| std::string m_name; // name of paramete
r | | std::string m_name; // name of paramete
r | |
| unsigned char m_type; // type of the para
meter in m_data | | unsigned char m_type; // type of the para
meter in m_data | |
| unsigned char m_count; // number of elemen
ts in m_data | | unsigned char m_count; // number of elemen
ts in m_data | |
| std::vector<unsigned char> m_data; // the data buffer
for a single parameter | | std::vector<unsigned char> m_data; // the data buffer
for a single parameter | |
| nvsg::RTBufferAttributeHandle * m_buffer; // buffer parameter | | nvsg::RTBufferAttributeHandle * m_buffer; // buffer parameter | |
| nvsg::TextureAttributeItemHandle * m_texture; // texture paramete
r | | nvsg::TextureAttributeItemHandle * m_texture; // texture paramete
r | |
| std::vector<Annotation> m_annotations; // variable's annot
ations | | std::vector<Annotation> m_annotations; // variable's annot
ations | |
|
| std::string m_semantic; // variable's annotati | | std::string m_semantic; // variable's annot | |
| ons | | ations | |
| | | std::string m_typeName; // variable's type | |
| | | string | |
| }; | | }; | |
| | | | |
| inline const std::vector< RTFxParameter::Annotation > & RTFxParameter::ge
tAnnotations() const | | inline const std::vector< RTFxParameter::Annotation > & RTFxParameter::ge
tAnnotations() const | |
| { | | { | |
| return m_annotations; | | return m_annotations; | |
| } | | } | |
| | | | |
| inline unsigned int RTFxParameter::getNumberOfAnnotations() const | | inline unsigned int RTFxParameter::getNumberOfAnnotations() const | |
| { | | { | |
| return checked_cast< unsigned int >( m_annotations.size() ); | | return checked_cast< unsigned int >( m_annotations.size() ); | |
| | | | |
| skipping to change at line 508 | | skipping to change at line 556 | |
| * \return If this RTFxProgram was created from a source string, tha
t string is returned. | | * \return If this RTFxProgram was created from a source string, tha
t string is returned. | |
| * Otherwise an empty string is returned. | | * Otherwise an empty string is returned. | |
| * \sa RTFx::isFromLump, RTFx::createFromLump */ | | * \sa RTFx::isFromLump, RTFx::createFromLump */ | |
| NVSG_API const std::string & getSourceCode() const; | | NVSG_API const std::string & getSourceCode() const; | |
| | | | |
| /*! \brief Create an RTFxProgram from a file, caching the resulting R
TFxProgram | | /*! \brief Create an RTFxProgram from a file, caching the resulting R
TFxProgram | |
| * \param file The filename containing the RTFx code. | | * \param file The filename containing the RTFx code. | |
| * \param searchPaths A vector containing search paths to use for sh
ader and include paths. | | * \param searchPaths A vector containing search paths to use for sh
ader and include paths. | |
| * \param errorReturn If the method returns NULL, then errorReturn w
ill contain an error | | * \param errorReturn If the method returns NULL, then errorReturn w
ill contain an error | |
| * message indicating what the possible errors were. | | * message indicating what the possible errors were. | |
|
| | | * \param compargs A vector containing arguments to the NVCC compile | |
| | | r used to compile CUDA to PTX. An example | |
| | | * would be "-Iinclude" or "-DMYAPP", etc. These arguments are igno | |
| | | red if the source is already in compiled PTX | |
| | | * format. | |
| * \remarks Loads RTFx code from a file, parses it, and prepares it
for the RTTraverser which | | * \remarks Loads RTFx code from a file, parses it, and prepares it
for the RTTraverser which | |
| * will compile it at runtime.\n | | * will compile it at runtime.\n | |
| * The search paths will be used for all shader and include paths.\n | | * The search paths will be used for all shader and include paths.\n | |
| * If an RTFxProgram of the same file name is found in the cache, a
pointer to it will be returned instead. | | * If an RTFxProgram of the same file name is found in the cache, a
pointer to it will be returned instead. | |
| * \returns RTFxProgramHandle possibly cached. | | * \returns RTFxProgramHandle possibly cached. | |
| * \sa CgFxEffect::createFromFile */ | | * \sa CgFxEffect::createFromFile */ | |
| static NVSG_API RTFxProgramHandle * createFromFile( const std::string
& file, | | static NVSG_API RTFxProgramHandle * createFromFile( const std::string
& file, | |
|
| std::vector< std: | | const std::vector | |
| :string > & searchPaths, | | < std::string > & searchPaths, | |
| | | const std::vector | |
| | | < std::string > & compargs, | |
| std::string & err
orReturn ); | | std::string & err
orReturn ); | |
| | | | |
| /*! \brief Create an RTFxProgram from a string, caching the resulting
RTFxProgram | | /*! \brief Create an RTFxProgram from a string, caching the resulting
RTFxProgram | |
| * \param string A string containing RTFx code. | | * \param string A string containing RTFx code. | |
| * \param searchPaths A vector containing search paths to use for sh
ader and include paths. | | * \param searchPaths A vector containing search paths to use for sh
ader and include paths. | |
| * \param errorReturn If the method returns NULL, then errorReturn w
ill contain an error | | * \param errorReturn If the method returns NULL, then errorReturn w
ill contain an error | |
| * message indicating what the possible errors were. | | * message indicating what the possible errors were. | |
| * \param filetype Defaults to RTFxProgram::FT_RTFX indicating that
this is an RTFx formatted | | * \param filetype Defaults to RTFxProgram::FT_RTFX indicating that
this is an RTFx formatted | |
| * file. In the future, RTFxProgram::FT_METASL support may be added
using this same entry | | * file. In the future, RTFxProgram::FT_METASL support may be added
using this same entry | |
| * point. | | * point. | |
|
| | | * \param compargs A vector containing arguments to the NVCC compile | |
| | | r used to compile CUDA to PTX. An example | |
| | | * would be "-Iinclude" or "-DMYAPP", etc. These arguments are igno | |
| | | red if the source is already in compiled PTX | |
| | | * format. | |
| * \remarks Loads RTFx code from the given string, parses it, and pr
epares it for the | | * \remarks Loads RTFx code from the given string, parses it, and pr
epares it for the | |
| * RTTraverser which will compile it at runtime.\n | | * RTTraverser which will compile it at runtime.\n | |
| * The search paths will be used for all shader and include paths. | | * The search paths will be used for all shader and include paths. | |
| * \returns boolean indicating success or failure. | | * \returns boolean indicating success or failure. | |
| * \sa CgFxEffect::createFromLump */ | | * \sa CgFxEffect::createFromLump */ | |
| static NVSG_API RTFxProgramHandle * createFromLump( const std::string
& lump, | | static NVSG_API RTFxProgramHandle * createFromLump( const std::string
& lump, | |
|
| std::vector< std: | | const std::vector | |
| :string > & searchPaths, | | < std::string > & searchPaths, | |
| | | const std::vector | |
| | | < std::string > & compargs, | |
| std::string & err
orReturn, | | std::string & err
orReturn, | |
| FileType filetype
= FT_RTFX ); | | FileType filetype
= FT_RTFX ); | |
| | | | |
| private: | | private: | |
| NVSG_API void constructProgram( RTFxParser * parser ); | | NVSG_API void constructProgram( RTFxParser * parser ); | |
|
| NVSG_API bool createFromFile( const std::string & file, std::string & | | NVSG_API bool createFromFile( const std::string & file, const std::ve | |
| errorReturn ); | | ctor<std::string> & args, std::string & errorReturn ); | |
| NVSG_API bool createFromLump( const std::string & lump, std::string & | | NVSG_API bool createFromLump( const std::string & lump, const std::ve | |
| errorReturn, FileType filetype = FT_RTFX ); | | ctor<std::string> & args, std::string & errorReturn, FileType filetype = FT | |
| | | _RTFX ); | |
| NVSG_API void setSearchPaths( const std::vector<std::string> & paths
); | | NVSG_API void setSearchPaths( const std::vector<std::string> & paths
); | |
| NVSG_API void decomposeAnnotations( RTFxParameter & param, const std:
:string & annos ); | | NVSG_API void decomposeAnnotations( RTFxParameter & param, const std:
:string & annos ); | |
| | | | |
| private: | | private: | |
| struct TextureEntry | | struct TextureEntry | |
| { | | { | |
| std::string file; // file containing texture | | std::string file; // file containing texture | |
| TextureFormat format; // format of the buffer for t
exture conversion; currently ignored ! | | TextureFormat format; // format of the buffer for t
exture conversion; currently ignored ! | |
| std::string samplerName; // name of sampler in code to
assign bits to | | std::string samplerName; // name of sampler in code to
assign bits to | |
| FilterModes filterModes; | | FilterModes filterModes; | |
| | | | |
End of changes. 12 change blocks. |
| 14 lines changed or deleted | | 98 lines changed or added | |
|
| RTTraverser.h | | RTTraverser.h | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 112 | |
| float opacity; | | float opacity; | |
| }; | | }; | |
| | | | |
| public: | | public: | |
| //! Default constructor | | //! Default constructor | |
| RTTraverser( nvui::RTRenderArea * ra ); | | RTTraverser( nvui::RTRenderArea * ra ); | |
| | | | |
| virtual void setScene( nvsg::SceneHandle * scene ); | | virtual void setScene( nvsg::SceneHandle * scene ); | |
| void setSceneFileName( std::string & fileName ); | | void setSceneFileName( std::string & fileName ); | |
| | | | |
|
| NVRT_API void setAccelerationTypeGeometry( nvrt::RTAcceleration::RTBui | | | |
| lderType builder, nvrt::RTAcceleration::RTTraverserType traverser ); | | | |
| NVRT_API void setAccelerationTypeHierarchy( nvrt::RTAcceleration::RTBu | | | |
| ilderType builder, nvrt::RTAcceleration::RTTraverserType traverser ); | | | |
| NVRT_API void setAccelerationCache( nvrt::RTAccelerationCacheHandle *
ach ); | | NVRT_API void setAccelerationCache( nvrt::RTAccelerationCacheHandle *
ach ); | |
| NVRT_API nvrt::RTAccelerationCacheHandle * getAccelerationCache() cons
t; | | NVRT_API nvrt::RTAccelerationCacheHandle * getAccelerationCache() cons
t; | |
| | | | |
| NVRT_API void setSceneEpsilonFactor( float factor ); | | NVRT_API void setSceneEpsilonFactor( float factor ); | |
| NVRT_API float getSceneEpsilonFactor() const; | | NVRT_API float getSceneEpsilonFactor() const; | |
| NVRT_API void setMaxReflectionDepth( unsigned int depth ); | | NVRT_API void setMaxReflectionDepth( unsigned int depth ); | |
| NVRT_API unsigned int getMaxReflectionDepth() const; | | NVRT_API unsigned int getMaxReflectionDepth() const; | |
| NVRT_API void setMaxRefractionDepth( unsigned int depth ); | | NVRT_API void setMaxRefractionDepth( unsigned int depth ); | |
| NVRT_API unsigned int getMaxRefractionDepth() const; | | NVRT_API unsigned int getMaxRefractionDepth() const; | |
| NVRT_API void setMaxShadowDepth( unsigned int depth ); | | NVRT_API void setMaxShadowDepth( unsigned int depth ); | |
| | | | |
| skipping to change at line 183 | | skipping to change at line 181 | |
| private: | | private: | |
| typedef std::map< size_t, size_t > AttributeMap; | | typedef std::map< size_t, size_t > AttributeMap; | |
| | | | |
| private: | | private: | |
| nvsg::TextureAttributeItemHandle * getTextureOnTextureUnit( unsigned in
t which ); | | nvsg::TextureAttributeItemHandle * getTextureOnTextureUnit( unsigned in
t which ); | |
| void setVariable( nvrt::RTVariable *, const nvsg::
RTFxParameter & param ); | | void setVariable( nvrt::RTVariable *, const nvsg::
RTFxParameter & param ); | |
| unsigned int getAttributeMask( const AttributeMap & attrib
utes ); | | unsigned int getAttributeMask( const AttributeMap & attrib
utes ); | |
| void createDefaultTexture( void ); | | void createDefaultTexture( void ); | |
| void addLightSources( void ); | | void addLightSources( void ); | |
| void addSamplePoints( void ); | | void addSamplePoints( void ); | |
|
| nvrt::RTGroupHandle * createGroup(); | | nvrt::RTGroupHandle * createGroup( const nvsg::Group * p ); | |
| nvrt::RTBufferHandle * createIndexBuffer( const nvsg::QuadMeshes * p
); | | nvrt::RTBufferHandle * createIndexBuffer( const nvsg::QuadMeshes * p
); | |
| nvrt::RTBufferHandle * createIndexBuffer( const nvsg::Quads * p ); | | nvrt::RTBufferHandle * createIndexBuffer( const nvsg::Quads * p ); | |
| nvrt::RTBufferHandle * createIndexBuffer( const nvsg::QuadStrips * p
); | | nvrt::RTBufferHandle * createIndexBuffer( const nvsg::QuadStrips * p
); | |
| nvrt::RTBufferHandle * createIndexBuffer( const nvsg::Triangles * p
); | | nvrt::RTBufferHandle * createIndexBuffer( const nvsg::Triangles * p
); | |
| nvrt::RTBufferHandle * createIndexBuffer( const nvsg::TriFans * p ); | | nvrt::RTBufferHandle * createIndexBuffer( const nvsg::TriFans * p ); | |
| nvrt::RTBufferHandle * createIndexBuffer( const nvsg::TriStrips * p
); | | nvrt::RTBufferHandle * createIndexBuffer( const nvsg::TriStrips * p
); | |
| void createIntersectionPrograms( const AttributeMa
p & attributes, nvrt::RTGeometry * geom ); | | void createIntersectionPrograms( const AttributeMa
p & attributes, nvrt::RTGeometry * geom ); | |
| nvrt::RTMaterialHandle * createRTMaterial( nvrt::RTMaterialHandle * sr
c = 0 ); | | nvrt::RTMaterialHandle * createRTMaterial( nvrt::RTMaterialHandle * sr
c = 0 ); | |
| void createHitandAnyHitPrograms( nvsg::RTFxHandle
* rtfxHandle, nvrt::RTMaterialHandle * matHandle ); | | void createHitandAnyHitPrograms( nvsg::RTFxHandle
* rtfxHandle, nvrt::RTMaterialHandle * matHandle ); | |
|
| | | void determineAccelerationTypes( const nvsg::GeoNo | |
| | | de * p | |
| | | , nvrt::RTAccelerat | |
| | | ion::RTBuilderType & rtbt | |
| | | , nvrt::RTAccelerat | |
| | | ion::RTTraverserType & rttt ); | |
| | | void determineAccelerationTypes( const nvsg::Group | |
| | | * p | |
| | | , nvrt::RTAccelerat | |
| | | ion::RTBuilderType & rtbt | |
| | | , nvrt::RTAccelerat | |
| | | ion::RTTraverserType & rttt ); | |
| void getShaderMaterial( const nvsg::Material * p,
ShaderMaterial & sm ); | | void getShaderMaterial( const nvsg::Material * p,
ShaderMaterial & sm ); | |
| void setMaterialComponents( const nvsg::Material *
p, nvrt::RTMaterialHandle * rtm ); | | void setMaterialComponents( const nvsg::Material *
p, nvrt::RTMaterialHandle * rtm ); | |
|
| void initAccelerationGeometry( nvrt::RTAcceleratio | | void initAccelerationGeometry( nvrt::RTAcceleratio | |
| nHandle * accelerationHdl ); | | nHandle * accelerationHdl | |
| void initAccelerationHierarchy( nvrt::RTAccelerati | | , nvrt::RTAcceleratio | |
| onHandle * accelerationHdl ); | | n::RTBuilderType rtbt | |
| | | , nvrt::RTAcceleratio | |
| | | n::RTTraverserType rttt ); | |
| | | void initAccelerationHierarchy( nvrt::RTAccelerati | |
| | | onHandle * accelerationHdl | |
| | | , nvrt::RTAccelerati | |
| | | on::RTBuilderType rtbt | |
| | | , nvrt::RTAccelerati | |
| | | on::RTTraverserType rttt ); | |
| nvrt::RTGroupCache * processGroup( const nvsg::Group * p ); | | nvrt::RTGroupCache * processGroup( const nvsg::Group * p ); | |
| template<typename T> | | template<typename T> | |
| void processPrimitiveSet( T * p ); | | void processPrimitiveSet( T * p ); | |
| void processTextures( const nvsg::RTFxBase * rtfx,
nvrt::RTVariablesManager * vholder ); | | void processTextures( const nvsg::RTFxBase * rtfx,
nvrt::RTVariablesManager * vholder ); | |
| void processBuffers( const nvsg::RTFxBase * rtfx,
nvrt::RTVariablesManager * vholder ); | | void processBuffers( const nvsg::RTFxBase * rtfx,
nvrt::RTVariablesManager * vholder ); | |
| void pushLightType( nvsg::LightSourceHandle * lsh,
const nvmath::Mat44f&, const nvmath::Mat44f& ); | | void pushLightType( nvsg::LightSourceHandle * lsh,
const nvmath::Mat44f&, const nvmath::Mat44f& ); | |
| void setGlobalVariables( const nvsg::RTFxBase * p,
nvrt::RTContextHandle * ch ); | | void setGlobalVariables( const nvsg::RTFxBase * p,
nvrt::RTContextHandle * ch ); | |
| void setLocalVariables( const nvsg::RTFxBase * p,
nvrt::RTMaterialHandle * mh ); | | void setLocalVariables( const nvsg::RTFxBase * p,
nvrt::RTMaterialHandle * mh ); | |
| void setLocalVariables( const nvsg::RTFxBase * p,
nvrt::RTGeometryHandle * gh ); | | void setLocalVariables( const nvsg::RTFxBase * p,
nvrt::RTGeometryHandle * gh ); | |
| void setLocalVariables( const nvsg::RTFxBase * p,
std::vector<nvrt::RTProgramHandle *> & phv ); | | void setLocalVariables( const nvsg::RTFxBase * p,
std::vector<nvrt::RTProgramHandle *> & phv ); | |
| | | | |
| skipping to change at line 266 | | skipping to change at line 274 | |
| nvrt::RTTextureSamplerCache *getTextureSamplerCache(const nvsg::DALHost
*host) const; | | nvrt::RTTextureSamplerCache *getTextureSamplerCache(const nvsg::DALHost
*host) const; | |
| nvrt::RTTextureSamplerCache *getOrGenTextureSamplerCache(nvsg::TextureA
ttributeItemHandle *taih); | | nvrt::RTTextureSamplerCache *getOrGenTextureSamplerCache(nvsg::TextureA
ttributeItemHandle *taih); | |
| void updateTextureSampler( nvrt::RTTextureSamplerCache *c, nvsg::Textur
eAttributeItemHandle *p ); | | void updateTextureSampler( nvrt::RTTextureSamplerCache *c, nvsg::Textur
eAttributeItemHandle *p ); | |
| | | | |
| nvrt::RTVASBufferCache *genVASBufferCache(nvsg::DALHost *host, nvsg::Ob
ject *p); | | nvrt::RTVASBufferCache *genVASBufferCache(nvsg::DALHost *host, nvsg::Ob
ject *p); | |
| nvrt::RTVASBufferCache *getVASBufferCache(const nvsg::DALHost *host) co
nst; | | nvrt::RTVASBufferCache *getVASBufferCache(const nvsg::DALHost *host) co
nst; | |
| | | | |
| nvrt::RTFxSceneAttributeCache *genRTFxSceneAttributeCache(nvsg::DALHost
*host, nvsg::Object *p); | | nvrt::RTFxSceneAttributeCache *genRTFxSceneAttributeCache(nvsg::DALHost
*host, nvsg::Object *p); | |
| nvrt::RTFxSceneAttributeCache *getRTFxSceneAttributeCache(const nvsg::D
ALHost *host) const; | | nvrt::RTFxSceneAttributeCache *getRTFxSceneAttributeCache(const nvsg::D
ALHost *host) const; | |
| | | | |
|
| nvrt::RTGroupCache *genGroupCache(nvsg::DALHost *host, const nvsg::Obje
ct *p); | | nvrt::RTGroupCache *genGroupCache(nvsg::DALHost *host, const nvsg::Grou
p *p); | |
| nvrt::RTGroupCache *getGroupCache(const nvsg::DALHost *host) const; | | nvrt::RTGroupCache *getGroupCache(const nvsg::DALHost *host) const; | |
| | | | |
| nvrt::RTGeometryCache *genGeometryCache(nvsg::DALHost *host, nvsg::Obje
ct *p); | | nvrt::RTGeometryCache *genGeometryCache(nvsg::DALHost *host, nvsg::Obje
ct *p); | |
| nvrt::RTGeometryCache *getGeometryCache(const nvsg::DALHost *host) cons
t; | | nvrt::RTGeometryCache *getGeometryCache(const nvsg::DALHost *host) cons
t; | |
| | | | |
| private: | | private: | |
| // set this here for now | | // set this here for now | |
| enum { NVRT_MAX_TEXTURE_UNITS = 8 }; | | enum { NVRT_MAX_TEXTURE_UNITS = 8 }; | |
| | | | |
| nvsg::RTFxSceneAttributeHandle * m_defaultRTFxSceneAttribute; | | nvsg::RTFxSceneAttributeHandle * m_defaultRTFxSceneAttribute; | |
|
| nvrt::RTAcceleration::RTBuilderType m_accelerationBuilderTypeGeometry | | | |
| ; | | | |
| nvrt::RTAcceleration::RTTraverserType m_accelerationTraverserTypeGeomet | | | |
| ry; | | | |
| nvrt::RTAcceleration::RTBuilderType m_accelerationBuilderTypeHierarch | | | |
| y; | | | |
| nvrt::RTAcceleration::RTTraverserType m_accelerationTraverserTypeHierar | | | |
| chy; | | | |
| nvrt::RTAccelerationCacheHandle * m_rtCache; | | nvrt::RTAccelerationCacheHandle * m_rtCache; | |
| nvrt::RTDALDataCreator * m_DALDataCreator; | | nvrt::RTDALDataCreator * m_DALDataCreator; | |
| AttributeMap m_currentAttributes; | | AttributeMap m_currentAttributes; | |
| std::vector<nvrt::RTNodeHandle*> m_currentChildren; //! a list
of all children for the current object | | std::vector<nvrt::RTNodeHandle*> m_currentChildren; //! a list
of all children for the current object | |
| std::vector<nvrt::RTNodeHandle*> m_topLevelChildren; //! a list
of all children for the toplevel object | | std::vector<nvrt::RTNodeHandle*> m_topLevelChildren; //! a list
of all children for the toplevel object | |
| bool m_parentTransformChanged; //! tr
ue if the transform for any parent children has been changed | | bool m_parentTransformChanged; //! tr
ue if the transform for any parent children has been changed | |
| std::vector<std::pair<nvrt::RTMaterialHandle*,nvrt::RTGeometryHandle*>
> m_currentGeometries; | | std::vector<std::pair<nvrt::RTMaterialHandle*,nvrt::RTGeometryHandle*>
> m_currentGeometries; | |
| nvrt::RTGroupHandle * m_currentGroup; | | nvrt::RTGroupHandle * m_currentGroup; | |
| unsigned int m_currentGroupID; | | unsigned int m_currentGroupID; | |
| nvmath::Mat44f m_currentTransformation; | | nvmath::Mat44f m_currentTransformation; | |
| | | | |
End of changes. 6 change blocks. |
| 18 lines changed or deleted | | 26 lines changed or added | |
|
| RenderArea.h | | RenderArea.h | |
| | | | |
| skipping to change at line 20 | | skipping to change at line 20 | |
| // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE | | // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE | |
| // POSSIBILITY OF SUCH DAMAGES | | // POSSIBILITY OF SUCH DAMAGES | |
| | | | |
| /*! | | /*! | |
| * \file | | * \file | |
| * \brief | | * \brief | |
| */ | | */ | |
| | | | |
| #pragma once | | #pragma once | |
| | | | |
|
| #ifndef NVS_RENDERAREA_H | | #ifndef CPX_RENDERAREA_H | |
| #define NVS_RENDERAREA_H | | #define CPX_RENDERAREA_H | |
| | | | |
|
| #include "nvscale.h" | | #include "complex.h" | |
| | | | |
|
| namespace nvs | | namespace cpx | |
| { | | { | |
| class GPUInfo; | | class GPUInfo; | |
| | | | |
| /*! | | /*! | |
| * \brief Create an affinity GLcontext and FBO for offscreen rendering | | * \brief Create an affinity GLcontext and FBO for offscreen rendering | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| * \remarks | | * \remarks | |
| * A scene graph implementation can use this utility class to easily cr
eate a | | * A scene graph implementation can use this utility class to easily cr
eate a | |
| * GLcontext tied to a specific GPU. An FBO with color and depth buffer
s is | | * GLcontext tied to a specific GPU. An FBO with color and depth buffer
s is | |
| * bound to the created context to facilitate offscreen rendering. Othe
r pieces | | * bound to the created context to facilitate offscreen rendering. Othe
r pieces | |
| * of the MultiGPU SDK can then be used to perform distributed renderin
g and | | * of the MultiGPU SDK can then be used to perform distributed renderin
g and | |
| * final image composition. | | * final image composition. | |
| */ | | */ | |
| class RenderArea | | class RenderArea | |
| { | | { | |
| private: | | private: | |
| | | | |
| skipping to change at line 56 | | skipping to change at line 56 | |
| friend class FactoryImpl; | | friend class FactoryImpl; | |
| RenderArea() {} | | RenderArea() {} | |
| virtual ~RenderArea(void) {} | | virtual ~RenderArea(void) {} | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
| * \brief Create the affinity GLcontext and image buffer | | * \brief Create the affinity GLcontext and image buffer | |
| * \param gpu | | * \param gpu | |
| * GPUInfo which specifies which GPU to create the affinity GLconte
xt on. | | * GPUInfo which specifies which GPU to create the affinity GLconte
xt on. | |
| * \param format | | * \param format | |
|
| * Specifies features of the underlying frame buffer. See nvscale.h | | * Specifies features of the underlying frame buffer. See complex.h | |
| * for a list of possible values. Note that not all formats are eq
ually | | * for a list of possible values. Note that not all formats are eq
ually | |
| * efficient to transfer for compositing. When in doubt, use the d
efault. | | * efficient to transfer for compositing. When in doubt, use the d
efault. | |
| * \param colorSamples | | * \param colorSamples | |
| * Minimum number of desired color samples as specified in the | | * Minimum number of desired color samples as specified in the | |
| * GL_NV_framebuffer_multisample_coverage extension (see extension
documentation). | | * GL_NV_framebuffer_multisample_coverage extension (see extension
documentation). | |
| * \param coverageSamples | | * \param coverageSamples | |
| * Minimum number of desired coverage samples as specified in the | | * Minimum number of desired coverage samples as specified in the | |
| * GL_NV_framebuffer_multisample_coverage extension (see extension
documentation). | | * GL_NV_framebuffer_multisample_coverage extension (see extension
documentation). | |
| * \param share_area | | * \param share_area | |
| * RenderArea to share GL resources with, or NULL. NOTE: For GL res
ources to | | * RenderArea to share GL resources with, or NULL. NOTE: For GL res
ources to | |
| * be shared, the two RenderAreas must be bound to the SAME GPU. | | * be shared, the two RenderAreas must be bound to the SAME GPU. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the GLcontext and image buffer were created suc | | * 'CPX_R_SUCCESS' if the GLcontext and image buffer were created s | |
| cessfully;\n | | uccessfully;\n | |
| * 'NVS_CTX_CREATION_FAILED' if the GLcontext could not be created; | | * 'CPX_R_CTX_CREATION_FAILED' if the GLcontext could not be create | |
| \n | | d;\n | |
| * 'NVS_MISSING_EXTENSION' if a required GL extensions is not prese | | * 'CPX_R_MISSING_EXTENSION' if a required GL extensions is not pre | |
| nt;\n | | sent;\n | |
| * 'NVS_INVALID_FBO' if the FBO is of an incorrect format;\n | | * 'CPX_R_INVALID_FBO' if the FBO is of an incorrect format;\n | |
| * 'NVS_GL_ERROR' in case of GL errors;\n | | * 'CPX_R_GL_ERROR' in case of GL errors;\n | |
| * 'NVS_INVALID_OBJECT' in case of an invalid GPUInfo pointer.\n | | * 'CPX_R_INVALID_OBJECT' in case of an invalid GPUInfo pointer.\n | |
| * \remarks | | * \remarks | |
| * If the function succeeds, the created GLcontext will be current
on | | * If the function succeeds, the created GLcontext will be current
on | |
| * the calling thread and configured for off-screen rendering. The | | * the calling thread and configured for off-screen rendering. The | |
| * RenderArea is initially created with 0 width and height, and mus
t be | | * RenderArea is initially created with 0 width and height, and mus
t be | |
| * resized before it can be used. | | * resized before it can be used. | |
| * \warning | | * \warning | |
| * All other RenderArea methods except makeCurrent() may only be in
voked | | * All other RenderArea methods except makeCurrent() may only be in
voked | |
| * when the receiving RenderArea is already current on the calling
thread. | | * when the receiving RenderArea is already current on the calling
thread. | |
| * \sa resize | | * \sa resize | |
| */ | | */ | |
|
| virtual NVS_API Result initialize(GPUInfo *gpu, int format = NVS_CH
_DEFAULT_CHANNELS, | | virtual CPX_API Result initialize(GPUInfo *gpu, int format = CPX_CH
_DEFAULT_CHANNELS, | |
| int colorSamples=0, int coverageS
amples=0, | | int colorSamples=0, int coverageS
amples=0, | |
| RenderArea *share_area = NULL) =
0; | | RenderArea *share_area = NULL) =
0; | |
| | | | |
| /*! | | /*! | |
| * \brief Destroy the underlying image buffer and affinity context. | | * \brief Destroy the underlying image buffer and affinity context. | |
|
| | | * \return | |
| | | * 'CPX_R_SUCCESS' if cleanup succeeded;\n | |
| | | * 'CPX_R_CONTEXT_MISMATCH' if the receiver was not current at time | |
| | | -of-call;\n | |
| | | * 'CPX_R_GENERIC_FAILURE' otherwise.\n | |
| * \remarks | | * \remarks | |
| * Must be called from the thread on which the context is current. | | * Must be called from the thread on which the context is current. | |
| */ | | */ | |
|
| virtual NVS_API Result terminate(void) = 0; | | virtual CPX_API Result terminate(void) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Make the underlying affinity context current on the calli
ng thread | | * \brief Make the underlying affinity context current on the calli
ng thread | |
| * \warning | | * \warning | |
| * All other RenderArea methods except initialize() may only be inv
oked | | * All other RenderArea methods except initialize() may only be inv
oked | |
| * when the receiving RenderArea is already current on the calling
thread. | | * when the receiving RenderArea is already current on the calling
thread. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the underlying call succeeded;\n | | * 'CPX_R_SUCCESS' if the underlying call succeeded;\n | |
| * 'NVS_GENERIC_FAILURE' otherwise.\n | | * 'CPX_R_GENERIC_FAILURE' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result makeCurrent(void) = 0; | | virtual CPX_API Result makeCurrent(void) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Release the current context by making the NULL context cu
rrent. | | * \brief Release the current context by making the NULL context cu
rrent. | |
| * \remarks | | * \remarks | |
| * Must be called from the thread on which the context is current. | | * Must be called from the thread on which the context is current. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the underlying call succeeded;\n | | * 'CPX_R_SUCCESS' if the underlying call succeeded;\n | |
| * 'NVS_GENERIC_FAILURE' otherwise.\n | | * 'CPX_R_CONTEXT_MISMATCH' if the receiver was not current at time | |
| | | -of-call;\n | |
| | | * 'CPX_R_GENERIC_FAILURE' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result releaseCurrent(void) = 0; | | virtual CPX_API Result releaseCurrent(void) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Mark the end of the frame. | | * \brief Mark the end of the frame. | |
| * \remarks | | * \remarks | |
| * Must be called at the end of the frame. If also using the | | * Must be called at the end of the frame. If also using the | |
| * compositor, should be called after Node::composite(). | | * compositor, should be called after Node::composite(). | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the call succeeded;\n | | * 'CPX_R_SUCCESS' if the call succeeded;\n | |
| * 'NVS_GENERIC_FAILURE' otherwise.\n | | * 'CPX_R_CONTEXT_MISMATCH' if the receiver was not current at time | |
| | | -of-call;\n | |
| | | * 'CPX_R_GENERIC_FAILURE' otherwise.\n | |
| */ | | */ | |
|
| virtual NVS_API Result endFrame(void) = 0; | | virtual CPX_API Result endFrame(void) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Reallocate storage given the new dimensions of the Render
Area. | | * \brief Reallocate storage given the new dimensions of the Render
Area. | |
| * \remarks | | * \remarks | |
| * Must be called from the thread on which the context is current. | | * Must be called from the thread on which the context is current. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the FBOs were resized successfully;\n | | * 'CPX_R_SUCCESS' if the FBOs were resized successfully;\n | |
| * 'NVS_INVALID_FBO' if the FBO is of an incorrect format;\n | | * 'CPX_R_CONTEXT_MISMATCH' if the receiver was not current at time | |
| * 'NVS_GL_ERROR' in case of GL errors.\n | | -of-call;\n | |
| | | * 'CPX_R_INVALID_FBO' if the FBO is of an incorrect format;\n | |
| | | * 'CPX_R_GL_ERROR' in case of GL errors.\n | |
| */ | | */ | |
|
| virtual NVS_API Result resize(int width, int height) = 0; | | virtual CPX_API Result resize(int width, int height) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Display framebuffer contents in a window | | * \brief Display framebuffer contents in a window | |
| * \param title C-style string label for the window created | | * \param title C-style string label for the window created | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the call succeeded;\n | | * 'CPX_R_SUCCESS' if the call succeeded;\n | |
| * 'NVS_GENERIC_FAILURE' otherwise.\n | | * 'CPX_R_CONTEXT_MISMATCH' if the receiver was not current at time | |
| | | -of-call;\n | |
| | | * 'CPX_R_GENERIC_FAILURE' otherwise.\n | |
| * \remarks | | * \remarks | |
| * Create a window (or reuse the last one) and copy the image curre
ntly | | * Create a window (or reuse the last one) and copy the image curre
ntly | |
| * residing in this RenderArea to it for inspection. When composit
ion | | * residing in this RenderArea to it for inspection. When composit
ion | |
| * is behaving unexpectedly, this function can aid debugging by mak
ing | | * is behaving unexpectedly, this function can aid debugging by mak
ing | |
| * the normally-offscreen "source" images visible in an independent | | * the normally-offscreen "source" images visible in an independent | |
| * manner. The displayed image does not update automatically, but | | * manner. The displayed image does not update automatically, but | |
| * showFBContents() may be called repeatedly to update it manually. | | * showFBContents() may be called repeatedly to update it manually. | |
| * \warning | | * \warning | |
| * Must be called from the thread on which the context is current. | | * Must be called from the thread on which the context is current. | |
| * This is a slow operation intended for debugging only. | | * This is a slow operation intended for debugging only. | |
| */ | | */ | |
|
| virtual NVS_API Result showFBContents(const char *title) = 0; | | virtual CPX_API Result showFBContents(const char *title) = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Destroy the window displaying the frame buffer contents. | | * \brief Destroy the window displaying the frame buffer contents. | |
| * \return | | * \return | |
|
| * 'NVS_SUCCESS' if the call succeeded;\n | | * 'CPX_R_SUCCESS' if the call succeeded;\n | |
| * 'NVS_GENERIC_FAILURE' otherwise.\n | | * 'CPX_R_CONTEXT_MISMATCH' if the receiver was not current at time | |
| | | -of-call;\n | |
| | | * 'CPX_R_GENERIC_FAILURE' otherwise.\n | |
| * \remarks | | * \remarks | |
| * Must be called from the thread on which the context is current. | | * Must be called from the thread on which the context is current. | |
| */ | | */ | |
|
| virtual NVS_API Result hideFBContents(void) = 0; | | virtual CPX_API Result hideFBContents(void) = 0; | |
| }; | | }; | |
| | | | |
|
| } // namespace nvs | | } // namespace cpx | |
| | | | |
|
| #endif // NVS_RENDERAREA_H | | #endif // CPX_RENDERAREA_H | |
| | | | |
End of changes. 23 change blocks. |
| 37 lines changed or deleted | | 52 lines changed or added | |
|
| SystemInfo.h | | SystemInfo.h | |
| | | | |
| skipping to change at line 20 | | skipping to change at line 20 | |
| // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE | | // INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE | |
| // POSSIBILITY OF SUCH DAMAGES | | // POSSIBILITY OF SUCH DAMAGES | |
| | | | |
| /*! | | /*! | |
| * \file | | * \file | |
| * \brief | | * \brief | |
| */ | | */ | |
| | | | |
| #pragma once | | #pragma once | |
| | | | |
|
| #ifndef NVS_SYSTEM_INFO_H | | #ifndef CPX_SYSTEM_INFO_H | |
| #define NVS_SYSTEM_INFO_H | | #define CPX_SYSTEM_INFO_H | |
| | | | |
|
| #include "nvscale.h" | | #include "complex.h" | |
| | | | |
|
| namespace nvs | | namespace cpx | |
| { | | { | |
| /*! | | /*! | |
| * \brief GPUInfo provides the interface to get information about a | | * \brief GPUInfo provides the interface to get information about a | |
| * a specific GPU needed to configure a compositor network. | | * a specific GPU needed to configure a compositor network. | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| */ | | */ | |
| class GPUInfo | | class GPUInfo | |
| { | | { | |
| private: | | private: | |
| GPUInfo(const GPUInfo &); | | GPUInfo(const GPUInfo &); | |
| GPUInfo& operator=(const GPUInfo &); | | GPUInfo& operator=(const GPUInfo &); | |
| | | | |
| protected: | | protected: | |
| GPUInfo(); | | GPUInfo(); | |
| virtual ~GPUInfo(); | | virtual ~GPUInfo(); | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
|
| * \brief Get the index of the represented GPU in the NVScale names
pace. | | * \brief Get the index of the represented GPU in the CompleX names
pace. | |
| * \return | | * \return | |
| * The integer index of the represented GPU. | | * The integer index of the represented GPU. | |
| * \remarks | | * \remarks | |
| * The value returned here is the unique name by which the represen
ted | | * The value returned here is the unique name by which the represen
ted | |
|
| * GPU is known within the NVScale framework. It can be used to | | * GPU is known within the CompleX framework. It can be used to | |
| * obtaining this GPUinfo object from the SystemInfo instance, to c
reate | | * obtaining this GPUinfo object from the SystemInfo instance, to c
reate | |
| * an affiliated RenderArea, or anywhere else a GPU index is requir
ed | | * an affiliated RenderArea, or anywhere else a GPU index is requir
ed | |
|
| * within the NVScale API. | | * within the CompleX API. | |
| * \warning | | * \warning | |
|
| * The integer index of the represented GPU in the NVScale namespac
e is | | * The integer index of the represented GPU in the CompleX namespac
e is | |
| * NOT guaranteed to correspond to its index in any OS-maintained l
ist | | * NOT guaranteed to correspond to its index in any OS-maintained l
ist | |
| * of GPUs, in the windows GPU affinity mask, or anywhere else outs
ide | | * of GPUs, in the windows GPU affinity mask, or anywhere else outs
ide | |
|
| * the NVScale namespace. However, handles identifying the represe
nted | | * the CompleX namespace. However, handles identifying the represe
nted | |
| * GPU in these contexts may also be retrieved from this GPUInfo ob
ject. | | * GPU in these contexts may also be retrieved from this GPUInfo ob
ject. | |
| * \sa getDisplayString(), getAffinityHandle() | | * \sa getDisplayString(), getAffinityHandle() | |
| */ | | */ | |
|
| virtual NVS_API int getGPUIndex() const = 0; | | virtual CPX_API int getGPUIndex() const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get the X11 display string for this GPU. | | * \brief Get the X11 display string for this GPU. | |
| * \return | | * \return | |
| * A string which may be used to retrieve the X Display object | | * A string which may be used to retrieve the X Display object | |
| * corresponding to this GPU from XOpenDisplay(), or NULL on failur
e. | | * corresponding to this GPU from XOpenDisplay(), or NULL on failur
e. | |
| * \warning | | * \warning | |
| * This method is only to be used on Linux systems, it will always
return | | * This method is only to be used on Linux systems, it will always
return | |
|
| * failure on Windows. Use getAffinityIndex() on Windows. | | * failure on Windows. Use getAffinityHandle() on Windows. | |
| */ | | */ | |
|
| virtual NVS_API const char *getDisplayString() const = 0; | | virtual CPX_API const char *getDisplayString() const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get the affinity handle for this GPU. | | * \brief Get the affinity handle for this GPU. | |
| * \return | | * \return | |
| * A pointer to a handle which may be set in the affinity mask pass
ed to | | * A pointer to a handle which may be set in the affinity mask pass
ed to | |
| * wglCreateAffinityDCNV() to obtain an HDC corresponding to this G
PU, | | * wglCreateAffinityDCNV() to obtain an HDC corresponding to this G
PU, | |
| * or NULL on failure. | | * or NULL on failure. | |
| * \warning | | * \warning | |
| * This method is only to be used on Windows systems, it will alway
s return | | * This method is only to be used on Windows systems, it will alway
s return | |
| * failure on Linux. Use getDisplayString() on Linux. | | * failure on Linux. Use getDisplayString() on Linux. | |
| */ | | */ | |
|
| virtual NVS_API PHANDLE getAffinityHandle() const = 0; | | virtual CPX_API PHANDLE getAffinityHandle() const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Determine if the named compositor type is supported. | | * \brief Determine if the named compositor type is supported. | |
| * \param type | | * \param type | |
|
| * The type of compositor to check for, see the CompositionTechniqu | | * The type of compositor for which to check support. If:\n | |
| e documentation | | * CPX_CT_SCREEN: True if this GPU can participate in a screen | |
| * for more details. | | * composition network;\n | |
| | | * CPX_CT_DEPTH: True if this GPU can participate in a depth | |
| | | * composition network (proper depth buffer formats are | |
| | | * available, etc.);\n | |
| | | * CPX_CT_ALPHA: True if this GPU can participate in an alpha | |
| | | * composition network (proper alpha channel formats are | |
| | | * available, etc.);\n | |
| | | * CPX_CT_SKIP: True if this GPU can participate trivially in a | |
| | | * skip-composition network (GPU is not excluded from | |
| | | * composition on technique-independent grounds, etc.).\n | |
| * \return | | * \return | |
|
| * True if the compositing mode is supported, false otherwise. | | * True if the technique is supported, false otherwise. | |
| */ | | */ | |
|
| virtual NVS_API bool supportsCompositor(CompositionTechnique type)
const = 0; | | virtual CPX_API bool supportsCompositor(CompositionTechnique type)
const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Determine if the named compositor option is supported. | | * \brief Determine if the named compositor option is supported. | |
| * \param option | | * \param option | |
|
| * The option to check for, see the CompositorOption documentation | | * The option to check for. If:\n | |
| for | | * CPX_OPT_STEREO: True if quadbuffer stereo contexts can be create | |
| * more details. | | d on | |
| | | * this GPU;\n | |
| | | * CPX_OPT_MSAA: True if multisample anti-aliased frame buffers can | |
| | | be | |
| | | * created on this GPU;\n | |
| | | * CPX_OPT_PRODUCTION_MODE: True if this GPU can be used without | |
| | | * triggering the "developer only" warning and watermark.\n | |
| * \return | | * \return | |
| * True if the compositing option is supported, false otherwise. | | * True if the compositing option is supported, false otherwise. | |
| */ | | */ | |
|
| virtual NVS_API bool supportsOption(CompositorOption option) const
= 0; | | virtual CPX_API bool supportsOption(CompositorOption option) const
= 0; | |
| | | | |
| /*! | | /*! | |
|
| * \brief Get the amount of memory the card has. | | * \brief Get the specified memory capacity for this GPU in megabyt
es | |
| * \return | | * \return | |
|
| * An integer representing the amount of memory in megabytes. | | * An integer representing the memory capacity (sum of allocated an | |
| | | d | |
| | | * unallocated) in megabytes. | |
| */ | | */ | |
|
| virtual NVS_API int getMemory() const = 0; | | virtual CPX_API int getMemory() const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Determine if the GPU is the primary display device. | | * \brief Determine if the GPU is the primary display device. | |
| * \return | | * \return | |
| * True if the GPU is the primary display device, false otherwise. | | * True if the GPU is the primary display device, false otherwise. | |
| * \remark | | * \remark | |
| * The primary display device is the device which new windows are | | * The primary display device is the device which new windows are | |
| * created on by default. | | * created on by default. | |
| */ | | */ | |
|
| virtual NVS_API bool isPrimaryDisplay() const = 0; | | virtual CPX_API bool isPrimaryDisplay() const = 0; | |
| | | | |
| // JB_NOTE: Still need a perf accessor. | | | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| * \brief SystemInfo provides the interface to get system information | | * \brief SystemInfo provides the interface to get system information | |
| * needed to configure the compositor network. | | * needed to configure the compositor network. | |
|
| * \par Namespace: nvs | | * \par Namespace: cpx | |
| */ | | */ | |
| class SystemInfo | | class SystemInfo | |
| { | | { | |
| private: | | private: | |
| SystemInfo(const SystemInfo &); | | SystemInfo(const SystemInfo &); | |
| SystemInfo& operator=(const SystemInfo &); | | SystemInfo& operator=(const SystemInfo &); | |
| | | | |
| protected: | | protected: | |
| SystemInfo(); | | SystemInfo(); | |
| virtual ~SystemInfo(); | | virtual ~SystemInfo(); | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
| * \brief Obtain the one global SystemInfo instance for queries. | | * \brief Obtain the one global SystemInfo instance for queries. | |
| */ | | */ | |
|
| static NVS_API SystemInfo *getInstance(); | | static CPX_API SystemInfo *getInstance(); | |
| | | | |
| /*! | | /*! | |
| * \brief Get the number of GPUs recognized by the system. | | * \brief Get the number of GPUs recognized by the system. | |
| * \remarks | | * \remarks | |
| * gpu_name_t values in the range [0,getNumGPUs()) name GPUs eligib
le for use | | * gpu_name_t values in the range [0,getNumGPUs()) name GPUs eligib
le for use | |
|
| * as producers or consumers in an NVScale distribution and composi
tion | | * as producers or consumers in an CompleX distribution and composi
tion | |
| * network. | | * network. | |
| */ | | */ | |
|
| virtual NVS_API int getNumGPUs() const = 0; | | virtual CPX_API int getNumGPUs() const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get the GPUInfo object corresponding to a particular GPU. | | * \brief Get the GPUInfo object corresponding to a particular GPU. | |
| * \param gpuIdx | | * \param gpuIdx | |
| * The name of the GPU about which to get info. | | * The name of the GPU about which to get info. | |
| * \return | | * \return | |
| * Pointer to the GPUInfo instance on success, NULL on failure. | | * Pointer to the GPUInfo instance on success, NULL on failure. | |
| * \remarks | | * \remarks | |
|
| * The name used here is that of the GPU in the NVScale namespace: | | * The name used here is that of the GPU in the CompleX namespace: | |
| an | | an | |
| * integral value in [0, getNumGPUs()). Other functions in the NVS | | * integral value in [0, getNumGPUs()). Other functions in the Com | |
| cale | | pleX | |
| * API which take gpu_name_t parameters expect them to be in this n
amespace | | * API which take gpu_name_t parameters expect them to be in this n
amespace | |
| * too. | | * too. | |
| */ | | */ | |
|
| virtual NVS_API GPUInfo *getGPUInfo(int gpuIdx) const = 0; | | virtual CPX_API GPUInfo *getGPUInfo(int gpuIdx) const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get a GPU index from a display string. | | * \brief Get a GPU index from a display string. | |
| * \param display | | * \param display | |
| * A string containing an X11 display name. | | * A string containing an X11 display name. | |
| * \return | | * \return | |
| * On success an integer which can be used to query the GPU info th
rough with getGPUInfo(). | | * On success an integer which can be used to query the GPU info th
rough with getGPUInfo(). | |
| * On failure -1. | | * On failure -1. | |
| * \warning | | * \warning | |
| * This method will always fail on Windows, use getGPUInfoFromAffin
ity() on Windows. | | * This method will always fail on Windows, use getGPUInfoFromAffin
ity() on Windows. | |
| */ | | */ | |
|
| virtual NVS_API GPUInfo *getGPUInfoFromDisplay(const char *display)
const = 0; | | virtual CPX_API GPUInfo *getGPUInfoFromDisplay(const char *display)
const = 0; | |
| | | | |
| /*! | | /*! | |
| * \brief Get a GPU index from an affinity index. | | * \brief Get a GPU index from an affinity index. | |
| * \param affHandle | | * \param affHandle | |
| * A pointer to an HGPUNV. | | * A pointer to an HGPUNV. | |
| * \return | | * \return | |
| * On success an integer which can be used to query the GPU info th
rough with getGPUInfo(). | | * On success an integer which can be used to query the GPU info th
rough with getGPUInfo(). | |
| * On failure -1. | | * On failure -1. | |
| * \warning | | * \warning | |
| * This method will always fail on Linux, use getGPUInfoFromDisplay
() on Linux. | | * This method will always fail on Linux, use getGPUInfoFromDisplay
() on Linux. | |
| */ | | */ | |
|
| virtual NVS_API GPUInfo *getGPUInfoFromAffinity(PHANDLE affHandle)
const = 0; | | virtual CPX_API GPUInfo *getGPUInfoFromAffinity(PHANDLE affHandle)
const = 0; | |
| }; | | }; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 30 change blocks. |
| 40 lines changed or deleted | | 55 lines changed or added | |
|