Cleanup: Move GPU_material.h to C++
This commit is contained in:
parent
691512b9ce
commit
dccf0e8699
@ -86,7 +86,7 @@
|
||||
|
||||
#include "SEQ_utils.hh" /* SEQ_get_topmost_sequence() */
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#include "BLI_sys_types.h" /* for intptr_t support */
|
||||
|
@ -72,7 +72,7 @@
|
||||
#include "DEG_depsgraph_build.hh"
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "NOD_shader.h"
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "BLO_read_write.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "DNA_node_types.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "NOD_derived_node_tree.hh"
|
||||
|
||||
@ -23,7 +23,7 @@ using namespace nodes::derived_node_tree_types;
|
||||
* A shader node encapsulates a compositor node tree that is capable of being used together with
|
||||
* other shader nodes to construct a Shader Operation using the GPU material compiler. A GPU node
|
||||
* stack for each of the node inputs and outputs is stored and populated during construction in
|
||||
* order to represent the node as a GPU node inside the GPU material graph, see GPU_material.h for
|
||||
* order to represent the node as a GPU node inside the GPU material graph, see GPU_material.hh for
|
||||
* more information. Derived classes should implement the compile method to add the node and link
|
||||
* it to the GPU material given to the method. The compiler is expected to initialize the input
|
||||
* links of the node before invoking the compile method. See the discussion in
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "BLI_string_ref.hh"
|
||||
#include "BLI_vector_set.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#include "gpu_shader_create_info.hh"
|
||||
@ -33,7 +33,7 @@ using ShaderCompileUnit = VectorSet<DNode>;
|
||||
* Shader Operation
|
||||
*
|
||||
* An operation that evaluates a shader compiled from a contiguous subset of the node execution
|
||||
* schedule using the GPU material compiler, see GPU_material.h for more information. The subset
|
||||
* schedule using the GPU material compiler, see GPU_material.hh for more information. The subset
|
||||
* of the node execution schedule is called a shader compile unit, see the discussion in
|
||||
* COM_compile_state.hh for more information.
|
||||
*
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "NOD_derived_node_tree.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
#include "COM_utilities.hh"
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "DNA_customdata_types.h"
|
||||
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_uniform_buffer.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_uniform_buffer.h"
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
#include "ED_screen.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "UI_resources.hh"
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "DNA_view3d_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#include "NOD_shader.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#include "eevee_private.h"
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
#include "eevee_private.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
#include "BKE_cryptomatte.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "eevee_cryptomatte.hh"
|
||||
#include "eevee_instance.hh"
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
#include "NOD_shader.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "eevee_instance.hh"
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "BLI_map.hh"
|
||||
#include "BLI_vector.hh"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "eevee_sync.hh"
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#include "BLI_string_ref.hh"
|
||||
#include "DRW_render.hh"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#include "eevee_material.hh"
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DRW_render.hh"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "eevee_shader_shared.hh"
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "DNA_world_types.h"
|
||||
|
||||
#include "GPU_framebuffer.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_primitive.h"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_storage_buffer.h"
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#include "UI_resources.hh"
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#include "DRW_render.hh"
|
||||
|
@ -50,7 +50,7 @@
|
||||
#include "bmesh.hh"
|
||||
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "DRW_render.hh"
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "BKE_pointcloud.hh"
|
||||
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "draw_attributes.hh"
|
||||
#include "draw_cache_impl.hh"
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_compute.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_vertex_buffer.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_compute.h"
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_vertex_buffer.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "DRW_engine.hh"
|
||||
#include "DRW_render.hh" /* For DRW_shgroup_get_instance_count() */
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "DNA_particle_types.h"
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "BLI_map.hh"
|
||||
#include "BLI_sys_types.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "draw_resource.hh"
|
||||
#include "draw_view.hh"
|
||||
|
@ -45,7 +45,7 @@
|
||||
#endif
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_uniform_buffer.h"
|
||||
|
||||
#include "intern/gpu_codegen.h"
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#include "WM_api.hh"
|
||||
|
@ -46,7 +46,7 @@
|
||||
#include "BKE_image.h"
|
||||
|
||||
#include "GPU_debug.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "DRW_gpu_wrapper.hh"
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "GPU_batch.h"
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_compute.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_vertex_buffer.h"
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "BKE_volume.hh"
|
||||
#include "BKE_volume_render.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "draw_common.h"
|
||||
#include "draw_manager.h"
|
||||
|
@ -63,7 +63,7 @@
|
||||
#include "UI_view2d.hh"
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "IMB_imbuf_types.hh"
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
||||
#include "RNA_enum_types.hh"
|
||||
#include "RNA_path.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "outliner_intern.hh"
|
||||
#include "tree/tree_element_rna.hh"
|
||||
|
@ -70,7 +70,7 @@
|
||||
#include "GPU_framebuffer.h"
|
||||
#include "GPU_immediate.h"
|
||||
#include "GPU_immediate_util.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_matrix.h"
|
||||
#include "GPU_state.h"
|
||||
#include "GPU_viewport.h"
|
||||
|
@ -97,7 +97,7 @@ set(SRC
|
||||
GPU_immediate_util.h
|
||||
GPU_index_buffer.h
|
||||
GPU_init_exit.h
|
||||
GPU_material.h
|
||||
GPU_material.hh
|
||||
GPU_matrix.h
|
||||
GPU_platform.h
|
||||
GPU_primitive.h
|
||||
|
@ -17,15 +17,12 @@
|
||||
#include "GPU_shader.h" /* for GPUShaderCreateInfo */
|
||||
#include "GPU_texture.h" /* for GPUSamplerState */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct GHash;
|
||||
struct GPUMaterial;
|
||||
struct GPUNode;
|
||||
struct GPUNodeLink;
|
||||
struct GPUNodeStack;
|
||||
struct GPUPass;
|
||||
struct GPUTexture;
|
||||
struct GPUUniformBuf;
|
||||
struct Image;
|
||||
@ -37,13 +34,9 @@ struct Scene;
|
||||
struct bNode;
|
||||
struct bNodeTree;
|
||||
|
||||
typedef struct GPUMaterial GPUMaterial;
|
||||
typedef struct GPUNode GPUNode;
|
||||
typedef struct GPUNodeLink GPUNodeLink;
|
||||
|
||||
/* Functions to create GPU Materials nodes. */
|
||||
|
||||
typedef enum eGPUType {
|
||||
enum eGPUType {
|
||||
/* Keep in sync with GPU_DATATYPE_STR */
|
||||
/* The value indicates the number of elements in each type */
|
||||
GPU_NONE = 0,
|
||||
@ -66,9 +59,9 @@ typedef enum eGPUType {
|
||||
|
||||
/* Opengl Attributes */
|
||||
GPU_ATTR = 3001,
|
||||
} eGPUType;
|
||||
};
|
||||
|
||||
typedef enum eGPUMaterialFlag {
|
||||
enum eGPUMaterialFlag {
|
||||
GPU_MATFLAG_DIFFUSE = (1 << 0),
|
||||
GPU_MATFLAG_SUBSURFACE = (1 << 1),
|
||||
GPU_MATFLAG_GLOSSY = (1 << 2),
|
||||
@ -101,42 +94,42 @@ typedef enum eGPUMaterialFlag {
|
||||
|
||||
/* HACK(fclem) Tells the environment texture node to not bail out if empty. */
|
||||
GPU_MATFLAG_LOOKDEV_HACK = (1 << 30),
|
||||
} eGPUMaterialFlag;
|
||||
};
|
||||
|
||||
ENUM_OPERATORS(eGPUMaterialFlag, GPU_MATFLAG_LOOKDEV_HACK);
|
||||
|
||||
typedef struct GPUNodeStack {
|
||||
struct GPUNodeStack {
|
||||
eGPUType type;
|
||||
float vec[4];
|
||||
struct GPUNodeLink *link;
|
||||
GPUNodeLink *link;
|
||||
bool hasinput;
|
||||
bool hasoutput;
|
||||
short sockettype;
|
||||
bool end;
|
||||
} GPUNodeStack;
|
||||
};
|
||||
|
||||
typedef enum eGPUMaterialStatus {
|
||||
enum eGPUMaterialStatus {
|
||||
GPU_MAT_FAILED = 0,
|
||||
GPU_MAT_CREATED,
|
||||
GPU_MAT_QUEUED,
|
||||
GPU_MAT_SUCCESS,
|
||||
} eGPUMaterialStatus;
|
||||
};
|
||||
|
||||
/* GPU_MAT_OPTIMIZATION_SKIP for cases where we do not
|
||||
* plan to perform optimization on a given material. */
|
||||
typedef enum eGPUMaterialOptimizationStatus {
|
||||
enum eGPUMaterialOptimizationStatus {
|
||||
GPU_MAT_OPTIMIZATION_SKIP = 0,
|
||||
GPU_MAT_OPTIMIZATION_READY,
|
||||
GPU_MAT_OPTIMIZATION_QUEUED,
|
||||
GPU_MAT_OPTIMIZATION_SUCCESS,
|
||||
} eGPUMaterialOptimizationStatus;
|
||||
};
|
||||
|
||||
typedef enum eGPUDefaultValue {
|
||||
enum eGPUDefaultValue {
|
||||
GPU_DEFAULT_0 = 0,
|
||||
GPU_DEFAULT_1,
|
||||
} eGPUDefaultValue;
|
||||
};
|
||||
|
||||
typedef struct GPUCodegenOutput {
|
||||
struct GPUCodegenOutput {
|
||||
char *attr_load;
|
||||
/* Node-tree functions calls. */
|
||||
char *displacement;
|
||||
@ -147,9 +140,9 @@ typedef struct GPUCodegenOutput {
|
||||
char *material_functions;
|
||||
|
||||
GPUShaderCreateInfo *create_info;
|
||||
} GPUCodegenOutput;
|
||||
};
|
||||
|
||||
typedef void (*GPUCodegenCallbackFn)(void *thunk, GPUMaterial *mat, GPUCodegenOutput *codegen);
|
||||
using GPUCodegenCallbackFn = void (*)(void *thunk, GPUMaterial *mat, GPUCodegenOutput *codegen);
|
||||
|
||||
GPUNodeLink *GPU_constant(const float *num);
|
||||
GPUNodeLink *GPU_uniform(const float *num);
|
||||
@ -173,12 +166,12 @@ GPUNodeLink *GPU_uniform_attribute(GPUMaterial *mat,
|
||||
uint32_t *r_hash);
|
||||
GPUNodeLink *GPU_layer_attribute(GPUMaterial *mat, const char *name);
|
||||
GPUNodeLink *GPU_image(GPUMaterial *mat,
|
||||
struct Image *ima,
|
||||
struct ImageUser *iuser,
|
||||
Image *ima,
|
||||
ImageUser *iuser,
|
||||
GPUSamplerState sampler_state);
|
||||
void GPU_image_tiled(GPUMaterial *mat,
|
||||
struct Image *ima,
|
||||
struct ImageUser *iuser,
|
||||
Image *ima,
|
||||
ImageUser *iuser,
|
||||
GPUSamplerState sampler_state,
|
||||
GPUNodeLink **r_image_tiled_link,
|
||||
GPUNodeLink **r_image_tiled_mapping_link);
|
||||
@ -199,7 +192,7 @@ GPUNodeLink *GPU_differentiate_float_function(const char *function_name);
|
||||
|
||||
bool GPU_link(GPUMaterial *mat, const char *name, ...);
|
||||
bool GPU_stack_link(GPUMaterial *mat,
|
||||
const struct bNode *node,
|
||||
const bNode *node,
|
||||
const char *name,
|
||||
GPUNodeStack *in,
|
||||
GPUNodeStack *out,
|
||||
@ -227,24 +220,24 @@ char *GPU_material_split_sub_function(GPUMaterial *material,
|
||||
GPUNodeLink **link);
|
||||
|
||||
bool GPU_material_sss_profile_create(GPUMaterial *material, float radii[3]);
|
||||
struct GPUUniformBuf *GPU_material_sss_profile_get(GPUMaterial *material,
|
||||
int sample_len,
|
||||
struct GPUTexture **tex_profile);
|
||||
GPUUniformBuf *GPU_material_sss_profile_get(GPUMaterial *material,
|
||||
int sample_len,
|
||||
GPUTexture **tex_profile);
|
||||
|
||||
/**
|
||||
* High level functions to create and use GPU materials.
|
||||
*/
|
||||
|
||||
typedef enum eGPUMaterialEngine {
|
||||
enum eGPUMaterialEngine {
|
||||
GPU_MAT_EEVEE_LEGACY = 0,
|
||||
GPU_MAT_EEVEE,
|
||||
GPU_MAT_COMPOSITOR,
|
||||
} eGPUMaterialEngine;
|
||||
};
|
||||
|
||||
GPUMaterial *GPU_material_from_nodetree(struct Scene *scene,
|
||||
struct Material *ma,
|
||||
struct bNodeTree *ntree,
|
||||
struct ListBase *gpumaterials,
|
||||
GPUMaterial *GPU_material_from_nodetree(Scene *scene,
|
||||
Material *ma,
|
||||
bNodeTree *ntree,
|
||||
ListBase *gpumaterials,
|
||||
const char *name,
|
||||
eGPUMaterialEngine engine,
|
||||
uint64_t shader_uuid,
|
||||
@ -255,19 +248,19 @@ GPUMaterial *GPU_material_from_nodetree(struct Scene *scene,
|
||||
|
||||
void GPU_material_compile(GPUMaterial *mat);
|
||||
void GPU_material_free_single(GPUMaterial *material);
|
||||
void GPU_material_free(struct ListBase *gpumaterial);
|
||||
void GPU_material_free(ListBase *gpumaterial);
|
||||
|
||||
void GPU_material_acquire(GPUMaterial *mat);
|
||||
void GPU_material_release(GPUMaterial *mat);
|
||||
|
||||
void GPU_materials_free(struct Main *bmain);
|
||||
void GPU_materials_free(Main *bmain);
|
||||
|
||||
struct Scene *GPU_material_scene(GPUMaterial *material);
|
||||
struct GPUPass *GPU_material_get_pass(GPUMaterial *material);
|
||||
Scene *GPU_material_scene(GPUMaterial *material);
|
||||
GPUPass *GPU_material_get_pass(GPUMaterial *material);
|
||||
/** Return the most optimal shader configuration for the given material. */
|
||||
struct GPUShader *GPU_material_get_shader(GPUMaterial *material);
|
||||
GPUShader *GPU_material_get_shader(GPUMaterial *material);
|
||||
/** Return the base un-optimized shader. */
|
||||
struct GPUShader *GPU_material_get_shader_base(GPUMaterial *material);
|
||||
GPUShader *GPU_material_get_shader_base(GPUMaterial *material);
|
||||
const char *GPU_material_get_name(GPUMaterial *material);
|
||||
|
||||
/**
|
||||
@ -281,7 +274,7 @@ void GPU_material_optimize(GPUMaterial *mat);
|
||||
/**
|
||||
* Return can be NULL if it's a world material.
|
||||
*/
|
||||
struct Material *GPU_material_get_material(GPUMaterial *material);
|
||||
Material *GPU_material_get_material(GPUMaterial *material);
|
||||
/**
|
||||
* Return true if the material compilation has not yet begin or begin.
|
||||
*/
|
||||
@ -313,14 +306,14 @@ bool GPU_material_optimization_ready(GPUMaterial *mat);
|
||||
*/
|
||||
void GPU_material_set_default(GPUMaterial *material, GPUMaterial *default_material);
|
||||
|
||||
struct GPUUniformBuf *GPU_material_uniform_buffer_get(GPUMaterial *material);
|
||||
GPUUniformBuf *GPU_material_uniform_buffer_get(GPUMaterial *material);
|
||||
/**
|
||||
* Create dynamic UBO from parameters
|
||||
*
|
||||
* \param inputs: Items are #LinkData, data is #GPUInput (`BLI_genericNodeN(GPUInput)`).
|
||||
*/
|
||||
void GPU_material_uniform_buffer_create(GPUMaterial *material, ListBase *inputs);
|
||||
struct GPUUniformBuf *GPU_material_create_sss_profile_ubo(void);
|
||||
GPUUniformBuf *GPU_material_create_sss_profile_ubo();
|
||||
|
||||
bool GPU_material_has_surface_output(GPUMaterial *mat);
|
||||
bool GPU_material_has_volume_output(GPUMaterial *mat);
|
||||
@ -332,14 +325,14 @@ eGPUMaterialFlag GPU_material_flag(const GPUMaterial *mat);
|
||||
bool GPU_material_recalc_flag_get(GPUMaterial *mat);
|
||||
uint64_t GPU_material_uuid_get(GPUMaterial *mat);
|
||||
|
||||
void GPU_pass_cache_init(void);
|
||||
void GPU_pass_cache_garbage_collect(void);
|
||||
void GPU_pass_cache_free(void);
|
||||
void GPU_pass_cache_init();
|
||||
void GPU_pass_cache_garbage_collect();
|
||||
void GPU_pass_cache_free();
|
||||
|
||||
/* Requested Material Attributes and Textures */
|
||||
|
||||
typedef struct GPUMaterialAttribute {
|
||||
struct GPUMaterialAttribute *next, *prev;
|
||||
struct GPUMaterialAttribute {
|
||||
GPUMaterialAttribute *next, *prev;
|
||||
int type; /* eCustomDataType */
|
||||
char name[68]; /* MAX_CUSTOMDATA_LAYER_NAME */
|
||||
char input_name[12 + 1]; /* GPU_MAX_SAFE_ATTR_NAME + 1 */
|
||||
@ -357,26 +350,26 @@ typedef struct GPUMaterialAttribute {
|
||||
* If true, the attribute is the length of hair particles and curves.
|
||||
*/
|
||||
bool is_hair_length;
|
||||
} GPUMaterialAttribute;
|
||||
};
|
||||
|
||||
typedef struct GPUMaterialTexture {
|
||||
struct GPUMaterialTexture *next, *prev;
|
||||
struct Image *ima;
|
||||
struct ImageUser iuser;
|
||||
struct GPUMaterialTexture {
|
||||
GPUMaterialTexture *next, *prev;
|
||||
Image *ima;
|
||||
ImageUser iuser;
|
||||
bool iuser_available;
|
||||
struct GPUTexture **colorband;
|
||||
struct GPUTexture **sky;
|
||||
GPUTexture **colorband;
|
||||
GPUTexture **sky;
|
||||
char sampler_name[32]; /* Name of sampler in GLSL. */
|
||||
char tiled_mapping_name[32]; /* Name of tile mapping sampler in GLSL. */
|
||||
int users;
|
||||
GPUSamplerState sampler_state;
|
||||
} GPUMaterialTexture;
|
||||
};
|
||||
|
||||
ListBase GPU_material_attributes(const GPUMaterial *material);
|
||||
ListBase GPU_material_textures(GPUMaterial *material);
|
||||
|
||||
typedef struct GPUUniformAttr {
|
||||
struct GPUUniformAttr *next, *prev;
|
||||
struct GPUUniformAttr {
|
||||
GPUUniformAttr *next, *prev;
|
||||
|
||||
/* Meaningful part of the attribute set key. */
|
||||
char name[68]; /* MAX_CUSTOMDATA_LAYER_NAME */
|
||||
@ -387,23 +380,23 @@ typedef struct GPUUniformAttr {
|
||||
/* Helper fields used by code generation. */
|
||||
short id;
|
||||
int users;
|
||||
} GPUUniformAttr;
|
||||
};
|
||||
|
||||
typedef struct GPUUniformAttrList {
|
||||
struct GPUUniformAttrList {
|
||||
ListBase list; /* GPUUniformAttr */
|
||||
|
||||
/* List length and hash code precomputed for fast lookup and comparison. */
|
||||
unsigned int count, hash_code;
|
||||
} GPUUniformAttrList;
|
||||
};
|
||||
|
||||
const GPUUniformAttrList *GPU_material_uniform_attributes(const GPUMaterial *material);
|
||||
|
||||
struct GHash *GPU_uniform_attr_list_hash_new(const char *info);
|
||||
GHash *GPU_uniform_attr_list_hash_new(const char *info);
|
||||
void GPU_uniform_attr_list_copy(GPUUniformAttrList *dest, const GPUUniformAttrList *src);
|
||||
void GPU_uniform_attr_list_free(GPUUniformAttrList *set);
|
||||
|
||||
typedef struct GPULayerAttr {
|
||||
struct GPULayerAttr *next, *prev;
|
||||
struct GPULayerAttr {
|
||||
GPULayerAttr *next, *prev;
|
||||
|
||||
/* Meaningful part of the attribute set key. */
|
||||
char name[68]; /* MAX_CUSTOMDATA_LAYER_NAME */
|
||||
@ -412,13 +405,13 @@ typedef struct GPULayerAttr {
|
||||
|
||||
/* Helper fields used by code generation. */
|
||||
int users;
|
||||
} GPULayerAttr;
|
||||
};
|
||||
|
||||
const ListBase *GPU_material_layer_attributes(const GPUMaterial *material);
|
||||
|
||||
/* A callback passed to GPU_material_from_callbacks to construct the material graph by adding and
|
||||
* linking the necessary GPU material nodes. */
|
||||
typedef void (*ConstructGPUMaterialFn)(void *thunk, GPUMaterial *material);
|
||||
using ConstructGPUMaterialFn = void (*)(void *thunk, GPUMaterial *material);
|
||||
|
||||
/* Construct a GPU material from a set of callbacks. See the callback types for more information.
|
||||
* The given thunk will be passed as the first parameter of each callback. */
|
||||
@ -426,7 +419,3 @@ GPUMaterial *GPU_material_from_callbacks(eGPUMaterialEngine engine,
|
||||
ConstructGPUMaterialFn construct_function_cb,
|
||||
GPUCodegenCallbackFn generate_code_function_cb,
|
||||
void *thunk);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -28,7 +28,7 @@
|
||||
|
||||
#include "GPU_capabilities.h"
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_uniform_buffer.h"
|
||||
#include "GPU_vertex_format.h"
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include "NOD_shader.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
#include "GPU_texture.h"
|
||||
#include "GPU_uniform_buffer.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "BLI_ghash.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_shader.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "BLI_string_ref.hh"
|
||||
#include "BLI_vector.hh"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_texture.h"
|
||||
|
||||
#include <iostream>
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "gpu_backend.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
#include "GPU_vertex_buffer.h" /* For GPUUsageType. */
|
||||
|
||||
#include "GPU_storage_buffer.h"
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "gpu_node_graph.h"
|
||||
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "GPU_uniform_buffer.h"
|
||||
#include "gpu_uniform_buffer_private.hh"
|
||||
|
@ -8,7 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "BLI_assert.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
enum eMTLDataType {
|
||||
MTL_DATATYPE_CHAR,
|
||||
|
@ -600,7 +600,7 @@ static const EnumPropertyItem node_cryptomatte_layer_name_items[] = {
|
||||
# include "ED_node.hh"
|
||||
# include "ED_render.hh"
|
||||
|
||||
# include "GPU_material.h"
|
||||
# include "GPU_material.hh"
|
||||
|
||||
# include "NOD_common.h"
|
||||
# include "NOD_composite.hh"
|
||||
|
@ -580,7 +580,7 @@ static const EnumPropertyItem rna_enum_curve_display_handle_items[] = {
|
||||
# include "ED_transform.hh"
|
||||
# include "ED_view3d.hh"
|
||||
|
||||
# include "GPU_material.h"
|
||||
# include "GPU_material.hh"
|
||||
|
||||
# include "IMB_imbuf_types.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_node_operation.hh"
|
||||
#include "COM_shader_node.hh"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "BKE_colortools.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "DNA_material_types.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "BLI_assert.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "BLI_assert.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* \ingroup cmpnodes
|
||||
*/
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "BKE_colorband.hh"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_shader_node.hh"
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "RNA_access.hh"
|
||||
#include "RNA_prototypes.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "RE_texture.h"
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include "DNA_node_types.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "NOD_socket_declarations.hh"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "BKE_node.h"
|
||||
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
@ -111,7 +111,7 @@
|
||||
|
||||
#include "GPU_context.h"
|
||||
#include "GPU_init_exit.h"
|
||||
#include "GPU_material.h"
|
||||
#include "GPU_material.hh"
|
||||
|
||||
#include "COM_compositor.hh"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user