Skip to content

Commit

Permalink
Update Rpr/RprSupport
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvalme committed Jun 9, 2018
1 parent 846819d commit fc500ff
Show file tree
Hide file tree
Showing 4 changed files with 1,740 additions and 1,333 deletions.
223 changes: 112 additions & 111 deletions 3rdparty/RprSupport/include/RprSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,88 +12,96 @@
* of confidentiality. The year included in the foregoing notice is the
* year of creation of the work.
\*****************************************************************************/
#pragma once
#ifndef __RPRSUPPORT_H
#define __RPRSUPPORT_H


#include "RadeonProRender.h"
#ifdef __cplusplus
extern "C" {
#endif


#define RPRX_SUPPORT_API_VERSION 0x0000002
#include "RadeonProRender.h"

#define RPRX_FLAGS_ENABLE_LOGGING 0x1
#define RPRX_SUPPORT_API_VERSION 0x0000002
#define RPRX_FLAGS_ENABLE_LOGGING 0x1

#define RPRX_MATERIAL_UBER 0x1
#define RPRX_MATERIAL_ARCHITECTURAL 0x2
#define RPRX_MATERIAL_SKIN 0x3
#define RPRX_MATERIAL_CARPAINT 0x4
/*rprx_material_type*/
#define RPRX_MATERIAL_UBER 0x1
#define RPRX_MATERIAL_ARCHITECTURAL 0x2
#define RPRX_MATERIAL_SKIN 0x3
#define RPRX_MATERIAL_CARPAINT 0x4

typedef rpr_uint rprx_material_type;
typedef rpr_uint rprx_parameter;
typedef rpr_uint rpr_parameter_type;
typedef struct _rprxcontext {}*rprx_context;
typedef struct _rprxmaterial {}*rprx_material;


#define RPRX_UBER_MATERIAL_DIFFUSE_COLOR 0x100U
#define RPRX_UBER_MATERIAL_DIFFUSE_WEIGHT 0x101U
#define RPRX_UBER_MATERIAL_DIFFUSE_ROUGHNESS 0x102U
#define RPRX_UBER_MATERIAL_REFLECTION_COLOR 0x103U
#define RPRX_UBER_MATERIAL_REFLECTION_WEIGHT 0x104U
#define RPRX_UBER_MATERIAL_REFLECTION_ROUGHNESS 0x105U
#define RPRX_UBER_MATERIAL_REFLECTION_ANISOTROPY 0x106U
#define RPRX_UBER_MATERIAL_REFLECTION_ANISOTROPY_ROTATION 0x107U
#define RPRX_UBER_MATERIAL_REFLECTION_MODE 0x108U
#define RPRX_UBER_MATERIAL_REFLECTION_IOR 0x109U
#define RPRX_UBER_MATERIAL_REFLECTION_METALNESS 0x109U
#define RPRX_UBER_MATERIAL_REFRACTION_COLOR 0x10AU
#define RPRX_UBER_MATERIAL_REFRACTION_WEIGHT 0x10BU
#define RPRX_UBER_MATERIAL_REFRACTION_ROUGHNESS 0x10CU
#define RPRX_UBER_MATERIAL_REFRACTION_IOR 0x10DU
#define RPRX_UBER_MATERIAL_REFRACTION_IOR_MODE 0x10EU
#define RPRX_UBER_MATERIAL_REFRACTION_THIN_SURFACE 0x10FU
#define RPRX_UBER_MATERIAL_COATING_COLOR 0x110U
#define RPRX_UBER_MATERIAL_COATING_WEIGHT 0x111U
#define RPRX_UBER_MATERIAL_COATING_ROUGHNESS 0x112U
#define RPRX_UBER_MATERIAL_COATING_MODE 0x113U
#define RPRX_UBER_MATERIAL_COATING_IOR 0x114U
#define RPRX_UBER_MATERIAL_COATING_METALNESS 0x114U
#define RPRX_UBER_MATERIAL_EMISSION_COLOR 0x115U
#define RPRX_UBER_MATERIAL_EMISSION_WEIGHT 0x116U
#define RPRX_UBER_MATERIAL_EMISSION_MODE 0x117U
#define RPRX_UBER_MATERIAL_TRANSPARENCY 0x118U
#define RPRX_UBER_MATERIAL_NORMAL 0x119U
#define RPRX_UBER_MATERIAL_BUMP 0x11AU
#define RPRX_UBER_MATERIAL_DISPLACEMENT 0x11BU

#define RPRX_UBER_MATERIAL_SSS_ABSORPTION_COLOR 0x11CU
#define RPRX_UBER_MATERIAL_SSS_SCATTER_COLOR 0x11DU
#define RPRX_UBER_MATERIAL_SSS_ABSORPTION_DISTANCE 0x11EU
#define RPRX_UBER_MATERIAL_SSS_SCATTER_DISTANCE 0x11FU
#define RPRX_UBER_MATERIAL_SSS_SCATTER_DIRECTION 0x120U
#define RPRX_UBER_MATERIAL_SSS_WEIGHT 0x121U
#define RPRX_UBER_MATERIAL_SSS_SUBSURFACE_COLOR 0x122U
#define RPRX_UBER_MATERIAL_SSS_MULTISCATTER 0x123U

#define RPRX_UBER_MATERIAL_REFLECTION_MODE_PBR 0x1U
#define RPRX_UBER_MATERIAL_REFLECTION_MODE_METALNESS 0x2U

#define RPRX_UBER_MATERIAL_REFRACTION_MODE_SEPARATE 0x1U
#define RPRX_UBER_MATERIAL_REFRACTION_MODE_LINKED 0x2U

#define RPRX_UBER_MATERIAL_COATING_MODE_PBR 0x1U
#define RPRX_UBER_MATERIAL_COATING_MODE_METALNESS 0x2U

#define RPRX_UBER_MATERIAL_EMISSION_MODE_SINGLESIDED 0x1U
#define RPRX_UBER_MATERIAL_EMISSION_MODE_DOUBLESIDED 0x2U

#define RPRX_PARAMETER_TYPE_FLOAT4 0x1U
#define RPRX_PARAMETER_TYPE_UINT 0x2U
#define RPRX_PARAMETER_TYPE_NODE 0x3U

#ifdef __cplusplus
extern "C" {
#endif
/** @brief Create RPRX context.
typedef rpr_uint rprx_parameter_type;

struct _rprxcontext
{
rpr_uint padding;
};
struct _rprxmaterial
{
rpr_uint padding;
};

typedef _rprxcontext *rprx_context;
typedef _rprxmaterial *rprx_material;

/*rprx_material_type*/
#define RPRX_UBER_MATERIAL_DIFFUSE_COLOR 0x100U
#define RPRX_UBER_MATERIAL_DIFFUSE_WEIGHT 0x101U
#define RPRX_UBER_MATERIAL_DIFFUSE_ROUGHNESS 0x102U
#define RPRX_UBER_MATERIAL_REFLECTION_COLOR 0x103U
#define RPRX_UBER_MATERIAL_REFLECTION_WEIGHT 0x104U
#define RPRX_UBER_MATERIAL_REFLECTION_ROUGHNESS 0x105U
#define RPRX_UBER_MATERIAL_REFLECTION_ANISOTROPY 0x106U
#define RPRX_UBER_MATERIAL_REFLECTION_ANISOTROPY_ROTATION 0x107U
#define RPRX_UBER_MATERIAL_REFLECTION_MODE 0x108U
#define RPRX_UBER_MATERIAL_REFLECTION_IOR 0x109U
#define RPRX_UBER_MATERIAL_REFLECTION_METALNESS 0x109U
#define RPRX_UBER_MATERIAL_REFRACTION_COLOR 0x10AU
#define RPRX_UBER_MATERIAL_REFRACTION_WEIGHT 0x10BU
#define RPRX_UBER_MATERIAL_REFRACTION_ROUGHNESS 0x10CU
#define RPRX_UBER_MATERIAL_REFRACTION_IOR 0x10DU
#define RPRX_UBER_MATERIAL_REFRACTION_IOR_MODE 0x10EU
#define RPRX_UBER_MATERIAL_REFRACTION_THIN_SURFACE 0x10FU
#define RPRX_UBER_MATERIAL_COATING_COLOR 0x110U
#define RPRX_UBER_MATERIAL_COATING_WEIGHT 0x111U
#define RPRX_UBER_MATERIAL_COATING_ROUGHNESS 0x112U
#define RPRX_UBER_MATERIAL_COATING_MODE 0x113U
#define RPRX_UBER_MATERIAL_COATING_IOR 0x114U
#define RPRX_UBER_MATERIAL_COATING_METALNESS 0x114U
#define RPRX_UBER_MATERIAL_EMISSION_COLOR 0x115U
#define RPRX_UBER_MATERIAL_EMISSION_WEIGHT 0x116U
#define RPRX_UBER_MATERIAL_EMISSION_MODE 0x117U
#define RPRX_UBER_MATERIAL_TRANSPARENCY 0x118U
#define RPRX_UBER_MATERIAL_NORMAL 0x119U
#define RPRX_UBER_MATERIAL_BUMP 0x11AU
#define RPRX_UBER_MATERIAL_DISPLACEMENT 0x11BU
#define RPRX_UBER_MATERIAL_SSS_ABSORPTION_COLOR 0x11CU
#define RPRX_UBER_MATERIAL_SSS_SCATTER_COLOR 0x11DU
#define RPRX_UBER_MATERIAL_SSS_ABSORPTION_DISTANCE 0x11EU
#define RPRX_UBER_MATERIAL_SSS_SCATTER_DISTANCE 0x11FU
#define RPRX_UBER_MATERIAL_SSS_SCATTER_DIRECTION 0x120U
#define RPRX_UBER_MATERIAL_SSS_WEIGHT 0x121U
#define RPRX_UBER_MATERIAL_SSS_SUBSURFACE_COLOR 0x122U
#define RPRX_UBER_MATERIAL_SSS_MULTISCATTER 0x123U

#define RPRX_UBER_MATERIAL_REFLECTION_MODE_PBR 0x1U
#define RPRX_UBER_MATERIAL_REFLECTION_MODE_METALNESS 0x2U
#define RPRX_UBER_MATERIAL_REFRACTION_MODE_SEPARATE 0x1U
#define RPRX_UBER_MATERIAL_REFRACTION_MODE_LINKED 0x2U
#define RPRX_UBER_MATERIAL_COATING_MODE_PBR 0x1U
#define RPRX_UBER_MATERIAL_COATING_MODE_METALNESS 0x2U
#define RPRX_UBER_MATERIAL_EMISSION_MODE_SINGLESIDED 0x1U
#define RPRX_UBER_MATERIAL_EMISSION_MODE_DOUBLESIDED 0x2U

/*rprx_parameter_type*/
#define RPRX_PARAMETER_TYPE_FLOAT4 0x1U
#define RPRX_PARAMETER_TYPE_UINT 0x2U
#define RPRX_PARAMETER_TYPE_NODE 0x3U

/** @brief Create RPRX context.
*
* RPR contexts allow to track several RPR contexts and material systems at the same time.
*
Expand All @@ -102,9 +110,9 @@ extern "C" {
* @param out_context Context
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxCreateContext(rpr_material_system material_system, rpr_uint flags, rprx_context* out_context);
extern RPR_API_ENTRY rpr_int rprxCreateContext(rpr_material_system material_system, rpr_uint flags, rprx_context* out_context);

/** @brief Create RPRX material
/** @brief Create RPRX material
*
* The function creates a material of a specified type. Supported types:
* RPRX_MATERIAL_UBER
Expand All @@ -114,9 +122,9 @@ extern "C" {
* @param out_material Pointer to newly created material
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxCreateMaterial(rprx_context context, rprx_material_type type, rprx_material* out_material);
extern RPR_API_ENTRY rpr_int rprxCreateMaterial(rprx_context context, rprx_material_type type, rprx_material* out_material);

/** @brief Delete RPRX material
/** @brief Delete RPRX material
*
* The function deletes the material passed in. The function also remove material from
* the set of tracked materials.
Expand All @@ -129,9 +137,9 @@ extern "C" {
* @param material Material to delete
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxMaterialDelete(rprx_context context, rprx_material material);
extern RPR_API_ENTRY rpr_int rprxMaterialDelete(rprx_context context, rprx_material material);

/** @brief Set the parameter for a material
/** @brief Set the parameter for a material
*
* The function sets specified parameter for a given material.
*
Expand All @@ -141,25 +149,23 @@ extern "C" {
* @param node Input node
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxMaterialSetParameterN(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_material_node node);
extern RPR_API_ENTRY rpr_int rprxMaterialSetParameterU(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_uint value);
extern RPR_API_ENTRY rpr_int rprxMaterialSetParameterF(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_float x, rpr_float y, rpr_float z, rpr_float w);

extern RPR_API_ENTRY rpr_int rprxMaterialSetParameterN(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_material_node node);
extern RPR_API_ENTRY rpr_int rprxMaterialSetParameterU(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_uint value);
extern RPR_API_ENTRY rpr_int rprxMaterialSetParameterF(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_float x, rpr_float y, rpr_float z, rpr_float w);
extern RPR_API_ENTRY rpr_int rprxMaterialGetParameterType(rprx_context context, rprx_material material, rprx_parameter parameter, rprx_parameter_type * out_type);
extern RPR_API_ENTRY rpr_int rprxMaterialGetParameterValue(rprx_context context, rprx_material material, rprx_parameter parameter, void * out_value);

extern RPR_API_ENTRY rpr_int rprxMaterialGetParameterType(rprx_context context, rprx_material material, rprx_parameter parameter, rpr_parameter_type* out_type);
extern RPR_API_ENTRY rpr_int rprxMaterialGetParameterValue(rprx_context context, rprx_material material, rprx_parameter parameter, void* out_value);

/** @brief Commit changes for a specified material
/** @brief Commit changes for a specified material
*
* initializes internal data structures and established necessary conditions
*
* @param context RPRX context
* @param material Material to commit changes for
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxMaterialCommit(rprx_context context, rprx_material material);
extern RPR_API_ENTRY rpr_int rprxMaterialCommit(rprx_context context, rprx_material material);

/** @brief Attach RPRX material for a shape
/** @brief Attach RPRX material for a shape
*
* RPRX library internally optimizes material by recompiling internal material graph structure.
* Change-commit approach allows to minimize the number of costly unnecessary recompilations and only
Expand All @@ -172,9 +178,9 @@ extern "C" {
* @param material Material
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxShapeAttachMaterial(rprx_context context, rpr_shape shape, rprx_material material);
extern RPR_API_ENTRY rpr_int rprxShapeAttachMaterial(rprx_context context, rpr_shape shape, rprx_material material);

/** @brief Detach RPRX material from a shape
/** @brief Detach RPRX material from a shape
*
* RPRX library internally optimizes material by recompiling internal material graph structure.
* Change-commit approach allows to minimize the number of costly unnecessary recompilations and only
Expand All @@ -189,9 +195,9 @@ extern "C" {
* @param material Material
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxShapeDetachMaterial(rprx_context context, rpr_shape shape, rprx_material material);
extern RPR_API_ENTRY rpr_int rprxShapeDetachMaterial(rprx_context context, rpr_shape shape, rprx_material material);

/** @brief Attach RPRX material for a shape
/** @brief Attach RPRX material for a shape
*
* RPRX library internally optimizes material by recompiling internal material graph structure.
* Change-commit approach allows to minimize the number of costly unnecessary recompilations and only
Expand All @@ -207,9 +213,9 @@ extern "C" {
* @param material Material
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxMaterialAttachMaterial(rprx_context context, rpr_material_node node, rpr_char const* parameter, rprx_material material);
extern RPR_API_ENTRY rpr_int rprxMaterialAttachMaterial(rprx_context context, rpr_material_node node, rpr_char const * parameter, rprx_material material);

/** @brief Detach RPRX material from a shape
/** @brief Detach RPRX material from a shape
*
* RPRX library internally optimizes material by recompiling internal material graph structure.
* Change-commit approach allows to minimize the number of costly unnecessary recompilations and only
Expand All @@ -226,35 +232,30 @@ extern "C" {
* @param material Material
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxMaterialDetachMaterial(rprx_context context, rpr_material_node node, rpr_char const* parameter, rprx_material material);
extern RPR_API_ENTRY rpr_int rprxMaterialDetachMaterial(rprx_context context, rpr_material_node node, rpr_char const * parameter, rprx_material material);

/** @brief Delete RPRX context
/** @brief Delete RPRX context
*
* The function deletes the context passed in.
*
* @param context RPRX context
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxDeleteContext(rprx_context context);
extern RPR_API_ENTRY rpr_int rprxDeleteContext(rprx_context context);

/** @brief Check whether specified rpr_material_node belongs to rprx material
/** @brief Check whether specified rpr_material_node belongs to rprx material
*
* @param context RPRX context
* @param node RPR material node
* @param material RPRX material
* @param result out_result result
* @return RPR_SUCCESS in case of success, error code otherwise
*/
extern RPR_API_ENTRY rpr_int rprxIsMaterialRprx(rprx_context context, rpr_material_node node, rprx_material* out_material, rpr_bool* out_result);

extern RPR_API_ENTRY rpr_int rprxGetLog(rprx_context context, rpr_char* log, size_t* size);



extern RPR_API_ENTRY rpr_int rprxShapeGetMaterial(rprx_context context, rpr_shape shape, rprx_material* material);



extern RPR_API_ENTRY rpr_int rprxIsMaterialRprx(rprx_context context, rpr_material_node node, rprx_material * out_material, rpr_bool* out_result);
extern RPR_API_ENTRY rpr_int rprxGetLog(rprx_context context, rpr_char* log, size_t* size);
extern RPR_API_ENTRY rpr_int rprxShapeGetMaterial(rprx_context context, rpr_shape shape, rprx_material* material);
#ifdef __cplusplus
}
#endif
#endif

#endif /*__RPRSUPPORT_H */
12 changes: 6 additions & 6 deletions Rpr/RadeonProRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,12 +1007,6 @@ rpr_int rprImageSetWrap(rpr_image image, rpr_image_wrap_type type)
UNSUPPORTED_FUNCTION
}

rpr_int rprImageSetOption(rpr_image image, rpr_image_option option)
{
UNSUPPORTED_FUNCTION
}


rpr_int rprShapeSetTransform(rpr_shape in_shape, rpr_bool transpose, rpr_float const * transform)
{
//cast data
Expand Down Expand Up @@ -2546,3 +2540,9 @@ rpr_int rprShapeSetLayerMask(rpr_shape shape, rpr_uint layerMask)
{
UNIMLEMENTED_FUNCTION
}

rpr_int rprContextCreateHeteroVolume(rpr_context context, rpr_hetero_volume * out_heteroVolume, size_t gridSizeX, size_t gridSizeY, size_t gridSizeZ, void const * indicesList, size_t numberOfIndices, rpr_hetero_volume_indices_topology indicesListTopology, void const * gridData, size_t gridDataSizeByte, rpr_uint gridDataTopology___unused)
{
UNSUPPORTED_FUNCTION
}

Loading

0 comments on commit fc500ff

Please sign in to comment.