2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2005 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-08-23 14:36:22 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup gpu
|
|
|
|
|
*
|
2020-02-12 12:48:44 +01:00
|
|
|
* Parsing of and code generation using GLSL shaders in gpu/shaders/material. */
|
2019-08-23 14:36:22 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2024-02-01 10:40:24 -05:00
|
|
|
#include "GPU_material.hh"
|
2020-02-12 12:48:44 +01:00
|
|
|
|
2022-04-14 18:47:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-02-12 12:48:44 +01:00
|
|
|
#define MAX_FUNCTION_NAME 64
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
#define MAX_PARAMETER 36
|
2020-02-12 12:48:44 +01:00
|
|
|
|
|
|
|
|
struct GSet;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
FUNCTION_QUAL_IN,
|
|
|
|
|
FUNCTION_QUAL_OUT,
|
|
|
|
|
FUNCTION_QUAL_INOUT,
|
|
|
|
|
} GPUFunctionQual;
|
GPU: Split gpu_shader_material into multiple files.
This patch continue the efforts to split the `gpu_shader_material` file
started in D5569.
Dependency resolution is now recursive. Each shading node gets its own
file. Additionally, some utility files are added to be shared between
files, like `math_util`, `color_util`, and `hash`. Some files are always
included because they may be used in the execution function, like
`world_normals`.
Some glsl functions appeared to be unused, so they were removed, like
`output_node`, `bits_to_01`, and `exp_blender`. Other functions have
been renamed to be more general and get used as utils, like `texco_norm`
which became `vector_normalize`.
A lot of the opengl tests fails, but those same tests also fail in
master, so this is probably unrelated to this patch.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5616
2019-08-30 17:23:04 +02:00
|
|
|
|
2020-02-12 12:48:44 +01:00
|
|
|
typedef struct GPUFunction {
|
|
|
|
|
char name[MAX_FUNCTION_NAME];
|
|
|
|
|
eGPUType paramtype[MAX_PARAMETER];
|
|
|
|
|
GPUFunctionQual paramqual[MAX_PARAMETER];
|
|
|
|
|
int totparam;
|
2022-05-30 10:22:17 +02:00
|
|
|
/* TODO(@fclem): Clean that void pointer. */
|
2022-04-14 18:47:58 +02:00
|
|
|
void *source; /* GPUSource */
|
2020-02-12 12:48:44 +01:00
|
|
|
} GPUFunction;
|
2019-09-12 17:42:13 +02:00
|
|
|
|
2020-02-12 12:48:44 +01:00
|
|
|
GPUFunction *gpu_material_library_use_function(struct GSet *used_libraries, const char *name);
|
GPU: Split gpu_shader_material into multiple files.
This patch continue the efforts to split the `gpu_shader_material` file
started in D5569.
Dependency resolution is now recursive. Each shading node gets its own
file. Additionally, some utility files are added to be shared between
files, like `math_util`, `color_util`, and `hash`. Some files are always
included because they may be used in the execution function, like
`world_normals`.
Some glsl functions appeared to be unused, so they were removed, like
`output_node`, `bits_to_01`, and `exp_blender`. Other functions have
been renamed to be more general and get used as utils, like `texco_norm`
which became `vector_normalize`.
A lot of the opengl tests fails, but those same tests also fail in
master, so this is probably unrelated to this patch.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D5616
2019-08-30 17:23:04 +02:00
|
|
|
|
2022-04-14 18:47:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|