Cleanup: use pre-defined STRINGIFY macro
This commit is contained in:
@@ -43,6 +43,14 @@
|
||||
|
||||
#define CLAY_ENGINE "BLENDER_CLAY"
|
||||
|
||||
#define MAX_CLAY_MAT 512 /* 512 = 9 bit material id */
|
||||
|
||||
#define SHADER_DEFINES \
|
||||
"#define MAX_MATERIAL " STRINGIFY(MAX_CLAY_MAT) "\n" \
|
||||
"#define USE_ROTATION\n" \
|
||||
"#define USE_AO\n" \
|
||||
"#define USE_HSV\n"
|
||||
|
||||
extern char datatoc_clay_frag_glsl[];
|
||||
extern char datatoc_clay_vert_glsl[];
|
||||
extern char datatoc_ssao_alchemy_glsl[];
|
||||
@@ -73,8 +81,6 @@ typedef struct CLAY_HAIR_UBO_Material {
|
||||
} CLAY_HAIR_UBO_Material; /* 32 bytes */
|
||||
BLI_STATIC_ASSERT_ALIGN(CLAY_UBO_Material, 16)
|
||||
|
||||
#define MAX_CLAY_MAT 512 /* 512 = 9 bit material id */
|
||||
|
||||
typedef struct CLAY_UBO_Storage {
|
||||
CLAY_UBO_Material materials[MAX_CLAY_MAT];
|
||||
} CLAY_UBO_Storage;
|
||||
@@ -327,10 +333,7 @@ static void CLAY_engine_init(void *vedata)
|
||||
if (!e_data.clay_sh) {
|
||||
DynStr *ds = BLI_dynstr_new();
|
||||
const char *max_mat =
|
||||
"#define MAX_MATERIAL 512\n"
|
||||
"#define USE_ROTATION\n"
|
||||
"#define USE_AO\n"
|
||||
"#define USE_HSV\n";
|
||||
SHADER_DEFINES;
|
||||
char *matcap_with_ao;
|
||||
|
||||
BLI_dynstr_append(ds, datatoc_clay_frag_glsl);
|
||||
|
||||
@@ -39,16 +39,13 @@
|
||||
|
||||
#define EEVEE_ENGINE "BLENDER_EEVEE"
|
||||
|
||||
#define STR_HELPER(x) #x
|
||||
#define STR(x) STR_HELPER(x)
|
||||
|
||||
#define SHADER_DEFINES \
|
||||
"#define EEVEE_ENGINE\n" \
|
||||
"#define MAX_LIGHT " STR(MAX_LIGHT) "\n" \
|
||||
"#define MAX_SHADOW_CUBE " STR(MAX_SHADOW_CUBE) "\n" \
|
||||
"#define MAX_SHADOW_MAP " STR(MAX_SHADOW_MAP) "\n" \
|
||||
"#define MAX_SHADOW_CASCADE " STR(MAX_SHADOW_CASCADE) "\n" \
|
||||
"#define MAX_CASCADE_NUM " STR(MAX_CASCADE_NUM) "\n"
|
||||
"#define MAX_LIGHT " STRINGIFY(MAX_LIGHT) "\n" \
|
||||
"#define MAX_SHADOW_CUBE " STRINGIFY(MAX_SHADOW_CUBE) "\n" \
|
||||
"#define MAX_SHADOW_MAP " STRINGIFY(MAX_SHADOW_MAP) "\n" \
|
||||
"#define MAX_SHADOW_CASCADE " STRINGIFY(MAX_SHADOW_CASCADE) "\n" \
|
||||
"#define MAX_CASCADE_NUM " STRINGIFY(MAX_CASCADE_NUM) "\n"
|
||||
|
||||
/* *********** STATIC *********** */
|
||||
static struct {
|
||||
|
||||
Reference in New Issue
Block a user