diff options
Diffstat (limited to 'source/blender/gpu/GPU_material.h')
-rw-r--r-- | source/blender/gpu/GPU_material.h | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h index f38b9681ad7..55fbe3f981f 100644 --- a/source/blender/gpu/GPU_material.h +++ b/source/blender/gpu/GPU_material.h @@ -109,10 +109,10 @@ typedef enum eGPUMaterialStatus { GPU_MAT_SUCCESS, } eGPUMaterialStatus; -typedef enum eGPUVolumeDefaultValue { - GPU_VOLUME_DEFAULT_0, - GPU_VOLUME_DEFAULT_1, -} eGPUVolumeDefaultValue; +typedef enum eGPUDefaultValue { + GPU_DEFAULT_0 = 0, + GPU_DEFAULT_1, +} eGPUDefaultValue; typedef struct GPUCodegenOutput { char *attr_load; @@ -131,6 +131,10 @@ typedef void (*GPUCodegenCallbackFn)(void *thunk, GPUMaterial *mat, GPUCodegenOu GPUNodeLink *GPU_constant(const float *num); GPUNodeLink *GPU_uniform(const float *num); GPUNodeLink *GPU_attribute(GPUMaterial *mat, CustomDataType type, const char *name); +GPUNodeLink *GPU_attribute_with_default(GPUMaterial *mat, + CustomDataType type, + const char *name, + eGPUDefaultValue default_value); GPUNodeLink *GPU_uniform_attribute(GPUMaterial *mat, const char *name, bool use_dupli); GPUNodeLink *GPU_image(GPUMaterial *mat, struct Image *ima, @@ -142,9 +146,7 @@ GPUNodeLink *GPU_image_tiled(GPUMaterial *mat, eGPUSamplerState sampler_state); GPUNodeLink *GPU_image_tiled_mapping(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser); GPUNodeLink *GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *row); -GPUNodeLink *GPU_volume_grid(GPUMaterial *mat, - const char *name, - eGPUVolumeDefaultValue default_value); + /** * Create an implementation defined differential calculation of a float function. * The given function should return a float. @@ -255,9 +257,11 @@ void GPU_pass_cache_free(void); typedef struct GPUMaterialAttribute { struct GPUMaterialAttribute *next, *prev; - int type; /* CustomDataType */ - char name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ + int type; /* CustomDataType */ + char name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */ + char input_name[12 + 1]; /* GPU_MAX_SAFE_ATTR_NAME + 1 */ eGPUType gputype; + eGPUDefaultValue default_value; /* Only for volumes attributes. */ int id; int users; } GPUMaterialAttribute; @@ -274,18 +278,8 @@ typedef struct GPUMaterialTexture { int sampler_state; /* eGPUSamplerState */ } GPUMaterialTexture; -typedef struct GPUMaterialVolumeGrid { - struct GPUMaterialVolumeGrid *next, *prev; - char *name; - eGPUVolumeDefaultValue default_value; - char sampler_name[32]; /* Name of sampler in GLSL. */ - char transform_name[32]; /* Name of 4x4 matrix in GLSL. */ - int users; -} GPUMaterialVolumeGrid; - ListBase GPU_material_attributes(GPUMaterial *material); ListBase GPU_material_textures(GPUMaterial *material); -ListBase GPU_material_volume_grids(GPUMaterial *material); typedef struct GPUUniformAttr { struct GPUUniformAttr *next, *prev; |