[Bf-blender-cvs] [49562da98d8] master: Preferences: remove unnecessary 16 bit textures preference.

Brecht Van Lommel noreply at git.blender.org
Wed Jan 16 16:24:15 CET 2019


Commit: 49562da98d81a0a3d2a4c94b1138be9272587c91
Author: Brecht Van Lommel
Date:   Wed Jan 16 15:24:43 2019 +0100
Branches: master
https://developer.blender.org/rB49562da98d81a0a3d2a4c94b1138be9272587c91

Preferences: remove unnecessary 16 bit textures preference.

This is a leftover from a time when these were not supported on all GPUs.

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/blenloader/intern/versioning_userdef.c
M	source/blender/gpu/intern/gpu_draw.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 115d9d27107..5435d0a90fd 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -656,8 +656,6 @@ class USERPREF_PT_system_opengl_textures(PreferencePanel):
         flow.prop(system, "texture_collection_rate", text="Garbage Collection Rate")
         flow.prop(system, "image_draw_method", text="Image Display Method")
 
-        flow.prop(system, "use_16bit_textures")
-
 
 class USERPREF_PT_system_opengl_selection(PreferencePanel):
     bl_label = "Selection"
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index c9e49e7e028..ce02c73cd96 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -308,10 +308,6 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
 		BKE_addon_ensure(&userdef->addons, "cycles");
 	}
 
-	if (!USER_VERSION_ATLEAST(261, 4)) {
-		userdef->use_16bit_textures = true;
-	}
-
 	if (!USER_VERSION_ATLEAST(267, 0)) {
 
 		/* GL Texture Garbage Collection */
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index cf9cbc8ca89..7c06555f255 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -309,18 +309,7 @@ GPUTexture *GPU_texture_from_blender(
 	bool use_high_bit_depth = false, do_color_management = false;
 
 	if (ibuf->rect_float) {
-		if (U.use_16bit_textures) {
-			/* use high precision textures. This is relatively harmless because OpenGL gives us
-			 * a high precision format only if it is available */
-			use_high_bit_depth = true;
-		}
-		else if (ibuf->rect == NULL) {
-			IMB_rect_from_float(ibuf);
-		}
-		/* we may skip this in high precision, but if not, we need to have a valid buffer here */
-		else if (ibuf->userflags & IB_RECT_INVALID) {
-			IMB_rect_from_float(ibuf);
-		}
+		use_high_bit_depth = true;
 
 		/* TODO unneeded when float images are correctly treated as linear always */
 		if (!is_data) {
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 854b7b7afc8..be172d6d418 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -694,12 +694,11 @@ typedef struct UserDef {
 	/** Seconds to zoom around current frame. */
 	float view_frame_seconds;
 
-	char _pad1[4];
+	char _pad1[6];
 
 	/** Private, defaults to 20 for 72 DPI setting. */
 	short widget_unit;
 	short anisotropic_filter;
-	short use_16bit_textures;
 
 	/** Tablet API to use (Windows only). */
 	short tablet_api;
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 8f8b42faf70..12de47acd1f 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -191,12 +191,6 @@ static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, Point
 	rna_userdef_update(bmain, scene, ptr);
 }
 
-static void rna_userdef_gl_use_16bit_textures(Main *bmain, Scene *scene, PointerRNA *ptr)
-{
-	GPU_free_images(bmain);
-	rna_userdef_update(bmain, scene, ptr);
-}
-
 static void rna_userdef_undo_steps_set(PointerRNA *ptr, int value)
 {
 	UserDef *userdef = (UserDef *)ptr->data;
@@ -4473,11 +4467,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 
 	/* Textures */
 
-	prop = RNA_def_property(srna, "use_16bit_textures", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "use_16bit_textures", 1);
-	RNA_def_property_ui_text(prop, "16 Bit Float Textures", "Use 16 bit per component texture for float images");
-	RNA_def_property_update(prop, 0, "rna_userdef_gl_use_16bit_textures");
-
 	prop = RNA_def_property(srna, "image_draw_method", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_items(prop, image_draw_methods);
 	RNA_def_property_enum_sdna(prop, NULL, "image_draw_method");



More information about the Bf-blender-cvs mailing list