Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_image.c')
-rw-r--r--source/blender/makesrna/intern/rna_image.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index 9f5f1635536..94b5786665c 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -193,6 +193,17 @@ static char *rna_ImageUser_path(PointerRNA *ptr)
return BLI_strdup("");
}
+static void rna_Image_gpu_texture_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ Image *ima = (Image *)ptr->owner_id;
+
+ if (!G.background) {
+ GPU_free_image(ima);
+ }
+
+ WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id);
+}
+
static const EnumPropertyItem *rna_Image_source_itemf(bContext *UNUSED(C),
PointerRNA *ptr,
PropertyRNA *UNUSED(prop),
@@ -1119,6 +1130,13 @@ static void rna_def_image(BlenderRNA *brna)
"when saving and loading the image");
RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_colormanage_update");
+ prop = RNA_def_property(srna, "use_half_precision", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMA_HIGH_BITDEPTH);
+ RNA_def_property_ui_text(prop,
+ "Half Float Precision",
+ "Use 16bits per channel to lower the memory usage during rendering");
+ RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, "rna_Image_gpu_texture_update");
+
/* multiview */
prop = RNA_def_property(srna, "views_format", PROP_ENUM, PROP_NONE);
RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);