[Bf-blender-cvs] [09df147f8d6] soc-2019-npr: LANPR: GPU mode cache size option.

YimingWu noreply at git.blender.org
Thu Jul 4 06:33:57 CEST 2019


Commit: 09df147f8d6ec3a09b0ab5c9ce23d96b59d74b49
Author: YimingWu
Date:   Thu Jul 4 12:05:25 2019 +0800
Branches: soc-2019-npr
https://developer.blender.org/rB09df147f8d6ec3a09b0ab5c9ce23d96b59d74b49

LANPR: GPU mode cache size option.

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

M	release/scripts/startup/bl_ui/properties_render.py
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py
index 56886f8818d..baa64787845 100644
--- a/release/scripts/startup/bl_ui/properties_render.py
+++ b/release/scripts/startup/bl_ui/properties_render.py
@@ -753,6 +753,9 @@ class RENDER_PT_lanpr(RenderButtonsPanel, Panel):
                 if not lanpr.auto_update:
                     row.operator("scene.lanpr_calculate", icon='FILE_REFRESH', text=txt)
             
+            if lanpr.master_mode == "DPIX":
+                layout.label(text="Cache Size:")
+                layout.prop(lanpr,"gpu_cache_size", expand=True)
 
             layout.prop(lanpr, "disable_edge_splits")
             
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index b0cda544894..8a3fbd14466 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -1682,7 +1682,8 @@ typedef struct SceneLANPR {
 
   /* edge split modifier will cause problems in LANPR. */
   int disable_edge_splits;
-  char _pad[4];
+  
+  int gpu_cache_size; /* enum! */
 
   /* offline render */
   ListBase line_layers;
@@ -1700,6 +1701,13 @@ typedef struct SceneLANPR {
 
 } SceneLANPR;
 
+enum {
+  LANPR_GPU_CACHE_SIZE_512 = 0,
+  LANPR_GPU_CACHE_SIZE_1K = 1, /* default */
+  LANPR_GPU_CACHE_SIZE_2K = 2,
+  LANPR_GPU_CACHE_SIZE_4K = 3,
+};
+
 /* *************************************************************** */
 /* Scene ID-Block */
 
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 56d46b24a58..4baf34ee949 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -7191,6 +7191,13 @@ static void rna_def_scene_lanpr(BlenderRNA *brna)
        "Same",
        "Use same taper value for both sides of the line"},
       {0, NULL, 0, NULL, NULL}};
+  static const EnumPropertyItem rna_enum_lanpr_gpu_cache_size[] = {
+      {LANPR_GPU_CACHE_SIZE_512, "S512", 0, "512", "512px texture as cache"},
+      {LANPR_GPU_CACHE_SIZE_1K, "S1K", 0, "1K", "1K px texture as cache"},
+      {LANPR_GPU_CACHE_SIZE_2K, "S2K", 0, "2K", "2K px texture as cache"},
+      {LANPR_GPU_CACHE_SIZE_4K, "S4K", 0, "4K", "4K px texture as cache"},
+      {0, NULL, 0, NULL, NULL}};
+
 
   srna = RNA_def_struct(brna, "SceneLANPR", NULL);
   RNA_def_struct_sdna(srna, "SceneLANPR");
@@ -7219,6 +7226,13 @@ static void rna_def_scene_lanpr(BlenderRNA *brna)
   RNA_def_property_flag(prop, PROP_EDITABLE);
   RNA_def_property_update(prop, NC_SCENE, NULL);
 
+  prop = RNA_def_property(srna, "gpu_cache_size", PROP_ENUM, PROP_NONE);
+  RNA_def_property_enum_items(prop, rna_enum_lanpr_gpu_cache_size);
+  RNA_def_property_enum_default(prop, LANPR_GPU_CACHE_SIZE_512);
+  RNA_def_property_ui_text(prop, "GPU Cache Size", "Texture cache size for DPIX algorithm");
+  RNA_def_property_flag(prop, PROP_EDITABLE);
+  RNA_def_property_update(prop, NC_SCENE, NULL);
+
   prop = RNA_def_property(srna, "enable_vector_trace", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_items(prop, rna_enum_lanpr_enable_post_processing);
   RNA_def_property_enum_default(prop, LANPR_POST_PROCESSING_DISABLED);



More information about the Bf-blender-cvs mailing list