[Bf-blender-cvs] [72266d2] soc-2016-cycles_denoising: Render: Extend the passtype field of RenderPasses to 64 bit

Lukas Stockner noreply at git.blender.org
Sat Jun 4 22:03:07 CEST 2016


Commit: 72266d21b708205186218d3d8024eb84c7b668b8
Author: Lukas Stockner
Date:   Sat Jun 4 21:21:52 2016 +0200
Branches: soc-2016-cycles_denoising
https://developer.blender.org/rB72266d21b708205186218d3d8024eb84c7b668b8

Render: Extend the passtype field of RenderPasses to 64 bit

This commit extends the number of possible pass types to 64 bit. However, it only
affects the structures used for storage during and after rendering, not the SceneRenderLayer
that's visible to the user (due to various limitations to 32 bit integers in RNA).
Therefore, their main purpose is to be allocated by the renderer based on some other setting.

===================================================================

M	source/blender/makesrna/intern/rna_render.c
M	source/blender/render/extern/include/RE_pipeline.h
M	source/blender/render/intern/source/pipeline.c
M	source/blender/render/intern/source/render_result.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index 8438270..2870a66 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -403,6 +403,12 @@ void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values)
 	memcpy(rpass->rect, values, sizeof(float) * rpass->rectx * rpass->recty * rpass->channels);
 }
 
+static int rna_RenderPass_extended_type_get(PointerRNA *ptr)
+{
+	RenderPass *rpass = (RenderPass *)ptr->data;
+	return rpass->passtype >> 32;
+}
+
 static PointerRNA rna_BakePixel_next_get(PointerRNA *ptr)
 {
 	BakePixel *bp = ptr->data;
@@ -831,6 +837,10 @@ static void rna_def_render_pass(BlenderRNA *brna)
 	RNA_def_property_enum_items(prop, rna_enum_render_pass_type_items);
 	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
+	prop = RNA_def_property(srna, "extended_type", PROP_INT, PROP_NONE);
+	RNA_def_property_int_funcs(prop, "rna_RenderPass_extended_type_get", NULL, NULL);
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
 	prop = RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_DYNAMIC);
 	RNA_def_property_multi_array(prop, 2, NULL);
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index ce0691b..3076a58 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -84,7 +84,8 @@ typedef struct RenderView {
 
 typedef struct RenderPass {
 	struct RenderPass *next, *prev;
-	int passtype, channels;
+	uint64_t passtype;
+	int channels;
 	char name[64];		/* amount defined in openexr_multi.h */
 	char chan_id[8];	/* amount defined in openexr_multi.h */
 	float *rect;
@@ -112,7 +113,8 @@ typedef struct RenderLayer {
 	/* copy of RenderData */
 	char name[RE_MAXNAME];
 	unsigned int lay, lay_zmask, lay_exclude;
-	int layflag, passflag, pass_xor;
+	int layflag, pass_xor;
+	uint64_t passflag;
 	
 	struct Material *mat_override;
 	struct Group *light_override;
@@ -235,7 +237,7 @@ void RE_render_result_rect_from_ibuf(struct RenderResult *rr, struct RenderData
     struct ImBuf *ibuf, const int view_id);
 
 struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name);
-float *RE_RenderLayerGetPass(volatile struct RenderLayer *rl, int passtype, const char *viewname);
+float *RE_RenderLayerGetPass(volatile struct RenderLayer *rl, uint64_t passtype, const char *viewname);
 
 /* obligatory initialize call, disprect is optional */
 void RE_InitState(struct Render *re, struct Render *source, struct RenderData *rd,
@@ -332,7 +334,7 @@ int RE_seq_render_active(struct Scene *scene, struct RenderData *rd);
 
 bool RE_layers_have_name(struct RenderResult *result);
 
-struct RenderPass *RE_pass_find_by_type(volatile struct RenderLayer *rl, int passtype, const char *viewname);
+struct RenderPass *RE_pass_find_by_type(volatile struct RenderLayer *rl, uint64_t passtype, const char *viewname);
 
 /* shaded view or baking options */
 #define RE_BAKE_LIGHT				0	/* not listed in rna_scene.c -> can't be enabled! */
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index c88e3b3..6a38148 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -237,7 +237,7 @@ void RE_FreeRenderResult(RenderResult *res)
 	render_result_free(res);
 }
 
-float *RE_RenderLayerGetPass(volatile RenderLayer *rl, int passtype, const char *viewname)
+float *RE_RenderLayerGetPass(volatile RenderLayer *rl, uint64_t passtype, const char *viewname)
 {
 	RenderPass *rpass = RE_pass_find_by_type(rl, passtype, viewname);
 	return rpass ? rpass->rect : NULL;
@@ -3989,7 +3989,7 @@ bool RE_layers_have_name(struct RenderResult *rr)
 	return false;
 }
 
-RenderPass *RE_pass_find_by_type(volatile RenderLayer *rl, int passtype, const char *viewname)
+RenderPass *RE_pass_find_by_type(volatile RenderLayer *rl, uint64_t passtype, const char *viewname)
 {
 	RenderPass *rp = NULL;
 
diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c
index 2d26fcf..a8791d7 100644
--- a/source/blender/render/intern/source/render_result.c
+++ b/source/blender/render/intern/source/render_result.c
@@ -173,7 +173,7 @@ void render_result_views_shallowdelete(RenderResult *rr)
 	}
 }
 
-static const char *name_from_passtype(int passtype, int channel)
+static const char *name_from_passtype(uint64_t passtype, int channel)
 {
 	if (passtype == SCE_PASS_COMBINED) {
 		if (channel == -1) return "Combined";
@@ -359,7 +359,7 @@ static const char *name_from_passtype(int passtype, int channel)
 	return "Unknown";
 }
 
-static int passtype_from_name(const char *str)
+static uint64_t passtype_from_name(const char *str)
 {
 	if (STRPREFIX(str, "Combined"))
 		return SCE_PASS_COMBINED;
@@ -458,7 +458,7 @@ static int passtype_from_name(const char *str)
 }
 
 
-static void set_pass_name(char *passname, int passtype, int channel, const char *view)
+static void set_pass_name(char *passname, uint64_t passtype, int channel, const char *view)
 {
 	const char delims[] = {'.', '\0'};
 	const char *sep;
@@ -484,7 +484,7 @@ static void set_pass_name(char *passname, int passtype, int channel, const char
 
 /********************************** New **************************************/
 
-static RenderPass *render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int channels, int passtype, const char *viewname)
+static RenderPass *render_layer_add_pass(RenderResult *rr, RenderLayer *rl, int channels, uint64_t passtype, const char *viewname)
 {
 	const int view_id = BLI_findstringindex(&rr->views, viewname, offsetof(RenderView, name));
 	const char *typestr = name_from_passtype(passtype, -1);




More information about the Bf-blender-cvs mailing list