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:
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py1
-rw-r--r--source/blender/gpu/GPU_draw.h2
-rw-r--r--source/blender/gpu/intern/gpu_draw.c12
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c11
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_ghost.cpp2
6 files changed, 24 insertions, 6 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index f6eaf421a7a..0bb25e98456 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -437,6 +437,7 @@ class USERPREF_PT_system(Panel):
col.label(text="OpenGL:")
col.prop(system, "gl_clip_alpha", slider=True)
col.prop(system, "use_mipmaps")
+ col.prop(system, "use_gpu_mipmap")
col.prop(system, "use_16bit_textures")
col.label(text="Anisotropic Filtering")
col.prop(system, "anisotropic_filter", text="")
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 5f6eb45ad70..b26c25558c3 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -116,7 +116,7 @@ void GPU_set_anisotropic(float value);
float GPU_get_anisotropic(void);
/* enable gpu mipmapping */
-void GPU_set_gpu_mipmapping(void);
+void GPU_set_gpu_mipmapping(int gpu_mipmap);
/* Image updates and free
* - these deal with images bound as opengl textures */
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index bcdbfe781f8..d466e59452b 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -240,10 +240,16 @@ static struct GPUTextureState {
/* Mipmap settings */
-void GPU_set_gpu_mipmapping()
+void GPU_set_gpu_mipmapping(int gpu_mipmap)
{
- /* always enable if it's supported */
- GTS.gpu_mipmap = GLEW_EXT_framebuffer_object;
+ int old_value = GTS.gpu_mipmap;
+
+ /* only actually enable if it's supported */
+ GTS.gpu_mipmap = gpu_mipmap && GLEW_EXT_framebuffer_object;
+
+ if (old_value != GTS.gpu_mipmap) {
+ GPU_free_images();
+ }
}
void GPU_set_mipmap(int mipmap)
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index bd454bab25d..7be34c398ae 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -144,6 +144,12 @@ static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA
rna_userdef_update(bmain, scene, ptr);
}
+static void rna_userdef_gl_gpu_mipmaps(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
+ rna_userdef_update(bmain, scene, ptr);
+}
+
static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
GPU_free_images();
@@ -3218,6 +3224,11 @@ static void rna_def_userdef_system(BlenderRNA *brna)
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, "use_gpu_mipmap", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "use_gpu_mipmap", 1);
+ RNA_def_property_ui_text(prop, "GPU Mipmap Generation", "Generate Image Mipmaps on the GPU");
+ RNA_def_property_update(prop, 0, "rna_userdef_gl_gpu_mipmaps");
+
prop = RNA_def_property(srna, "use_vertex_buffer_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gameflags", USER_DISABLE_VBO);
RNA_def_property_ui_text(prop, "VBOs",
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 1b8bcd51564..c9f0bbffc63 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -183,7 +183,7 @@ void WM_init(bContext *C, int argc, const char **argv)
GPU_extensions_init();
GPU_set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
GPU_set_anisotropic(U.anisotropic_filter);
- GPU_set_gpu_mipmapping();
+ GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
UI_init();
}
diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
index 475e139bfcc..a82f9ce1779 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
@@ -756,7 +756,7 @@ int main(int argc, char** argv)
}
GPU_set_anisotropic(U.anisotropic_filter);
- GPU_set_gpu_mipmapping();
+ GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
// Create the system
if (GHOST_ISystem::createSystem() == GHOST_kSuccess)