[Bf-blender-cvs] [62ee034] GPU_data_request: Add workflow shader ID to the system

Antony Riakiotakis noreply at git.blender.org
Fri Apr 10 15:00:26 CEST 2015


Commit: 62ee03467aa7730cc41a9a4eb2e17e9fec1fa2b2
Author: Antony Riakiotakis
Date:   Fri Apr 10 15:00:10 2015 +0200
Branches: GPU_data_request
https://developer.blender.org/rB62ee03467aa7730cc41a9a4eb2e17e9fec1fa2b2

Add workflow shader ID to the system

Only struct definitions here. Workflow is also
set per 3d region. (We should be able to get a
workflow per region just like current textured,
solid etc modes can be set per 3D region)

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

M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenkernel/intern/library.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_view3d_types.h

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

diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index e88a4e8..d137718 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -71,7 +71,7 @@ void id_clear_lib_data(struct Main *bmain, struct ID *id);
 
 struct ListBase *which_libbase(struct Main *mainlib, short type);
 
-#define MAX_LIBARRAY    35
+#define MAX_LIBARRAY    36
 int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]);
 
 void BKE_libblock_free(struct Main *bmain, void *idv);
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index ec654ea..f2370cf 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -94,6 +94,7 @@ typedef struct Main {
 	ListBase movieclip;
 	ListBase mask;
 	ListBase linestyle;
+	ListBase gpuworkflows;
 
 	char id_tag_update[256];
 
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 9cda4d9..dfce7a8 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -521,6 +521,8 @@ ListBase *which_libbase(Main *mainlib, short type)
 			return &(mainlib->palettes);
 		case ID_PC:
 			return &(mainlib->paintcurves);
+		case ID_GPUWS:
+			return &(mainlib->gpuworkflows);
 	}
 	return NULL;
 }
@@ -618,6 +620,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
 	lb[a++] = &(main->library);
 	lb[a++] = &(main->wm);
 	lb[a++] = &(main->mask);
+	lb[a++] = &(main->gpuworkflows);
 	
 	lb[a] = NULL;
 
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 50f26ec..e301ccc 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3124,6 +3124,19 @@ static void write_paintcurves(WriteData *wd, ListBase *idbase)
 	}
 }
 
+static void write_gpuworkflows(WriteData *wd, ListBase *idbase)
+{
+	GPUWorkflowShader *wfshader;
+
+	for (wfshader = idbase->first; wfshader; wfshader = wfshader->id.next) {
+		if (wfshader->id.us > 0 || wd->current) {
+			writestruct(wd, ID_GPUWS, "GPUWorkflowShader", 1, wfshader);
+			if (wfshader->id.properties) IDP_WriteProperty(wfshader->id.properties, wd);
+		}
+	}
+}
+
+
 static void write_scripts(WriteData *wd, ListBase *idbase)
 {
 	Script *script;
@@ -3599,6 +3612,7 @@ static int write_file_handle(
 	write_brushes  (wd, &mainvar->brush);
 	write_palettes (wd, &mainvar->palettes);
 	write_paintcurves (wd, &mainvar->paintcurves);
+	write_gpuworkflows (wd, &mainvar->gpuworkflows);
 	write_scripts  (wd, &mainvar->script);
 	write_gpencils (wd, &mainvar->gpencil);
 	write_linestyles(wd, &mainvar->linestyle);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index b51b53c..d7593eb 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -222,6 +222,7 @@ typedef struct PreviewImage {
 #define ID_LS		MAKE_ID2('L', 'S') /* FreestyleLineStyle */
 #define ID_PAL		MAKE_ID2('P', 'L') /* Palette */
 #define ID_PC		MAKE_ID2('P', 'C') /* PaintCurve  */
+#define ID_GPUWS	MAKE_ID2('G', 'W') /* GPUWorkflowShader */
 
 	/* NOTE! Fake IDs, needed for g.sipo->blocktype or outliner */
 #define ID_SEQ		MAKE_ID2('S', 'Q')
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 93e6148..c472824 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -61,6 +61,8 @@ struct GPUFX;
 #include "DNA_movieclip_types.h"
 #include "DNA_gpu_types.h"
 
+struct bNodeTree;
+
 /* ******************************** */
 
 /* The near/far thing is a Win EXCEPTION. Thus, leave near/far in the
@@ -81,6 +83,16 @@ typedef struct BGpic {
 	char pad[6];
 } BGpic;
 
+
+typedef struct GPUWorkflowShader {
+	ID id;
+	int objectmode; /* object modes for which this workflow applies */
+	int use_material; /* workflow shader is overlaid over materials of the meshes */
+	int	datamask; /* datamask of the data that will be required for this workflow shader */
+	int pad;
+	struct bNodeTree *ntree; /* node tree that describes the shader */
+} GPUWorkflowShader;
+
 /* ********************************* */
 
 typedef struct RegionView3D {
@@ -147,6 +159,7 @@ typedef struct RegionView3D {
 	float rot_axis[3];
 
 	struct GPUFX *compositor;
+	struct GPUWorkflowShader *activeworkflow;
 } RegionView3D;
 
 /* 3D ViewPort Struct */




More information about the Bf-blender-cvs mailing list