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.h3
-rw-r--r--source/blender/gpu/intern/gpu_draw.c79
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h4
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c11
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c1
6 files changed, 6 insertions, 93 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index a4feabf7254..115d9d27107 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -657,7 +657,6 @@ class USERPREF_PT_system_opengl_textures(PreferencePanel):
flow.prop(system, "image_draw_method", text="Image Display Method")
flow.prop(system, "use_16bit_textures")
- flow.prop(system, "use_gpu_mipmap")
class USERPREF_PT_system_opengl_selection(PreferencePanel):
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index 008f4199b02..4b94b79022b 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -80,9 +80,6 @@ void GPU_paint_set_mipmap(struct Main *bmain, bool mipmap);
void GPU_set_anisotropic(struct Main *bmain, float value);
float GPU_get_anisotropic(void);
-/* enable gpu mipmapping */
-void GPU_set_gpu_mipmapping(struct Main *bmain, 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 6f939261729..cf9cbc8ca89 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -125,23 +125,10 @@ static struct GPUTextureState {
bool texpaint;
float anisotropic;
- int gpu_mipmap;
-} GTS = {1, 0, 0, 1.0f, 0};
+} GTS = {1, 0, 0, 1.0f};
/* Mipmap settings */
-void GPU_set_gpu_mipmapping(Main *bmain, int gpu_mipmap)
-{
- int old_value = GTS.gpu_mipmap;
-
- /* only actually enable if it's supported */
- GTS.gpu_mipmap = gpu_mipmap;
-
- if (old_value != GTS.gpu_mipmap) {
- GPU_free_images(bmain);
- }
-}
-
void GPU_set_mipmap(Main *bmain, bool mipmap)
{
if (GTS.domipmap != mipmap) {
@@ -479,31 +466,7 @@ void GPU_create_gl_tex(
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
if (GPU_get_mipmap() && mipmap) {
- if (GTS.gpu_mipmap) {
- glGenerateMipmap(GL_TEXTURE_2D);
- }
- else {
- int i;
- if (!ibuf) {
- if (use_high_bit_depth) {
- ibuf = IMB_allocFromBuffer(NULL, frect, tpx, tpy);
- }
- else {
- ibuf = IMB_allocFromBuffer(rect, NULL, tpx, tpy);
- }
- }
- IMB_makemipmap(ibuf, true);
-
- for (i = 1; i < ibuf->miptot; i++) {
- ImBuf *mip = ibuf->mipmap[i - 1];
- if (use_high_bit_depth) {
- glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16F, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
- }
- else {
- glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA8, mip->x, mip->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, mip->rect);
- }
- }
- }
+ glGenerateMipmap(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter(0));
if (ima)
ima->tpageflag |= IMA_MIPMAP_COMPLETE;
@@ -527,38 +490,7 @@ void GPU_create_gl_tex(
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
if (GPU_get_mipmap() && mipmap) {
- if (GTS.gpu_mipmap) {
- glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
- }
- else {
- if (!ibuf) {
- if (use_high_bit_depth) {
- ibuf = IMB_allocFromBuffer(NULL, frect, tpx, tpy);
- }
- else {
- ibuf = IMB_allocFromBuffer(rect, NULL, tpx, tpy);
- }
- }
-
- IMB_makemipmap(ibuf, true);
-
- for (int i = 1; i < ibuf->miptot; i++) {
- ImBuf *mip = ibuf->mipmap[i - 1];
- void **mip_cube_map = gpu_gen_cube_map(
- mip->rect, mip->rect_float,
- mip->x, mip->y, use_high_bit_depth);
- int mipw = mip->x / 3, miph = mip->y / 2;
-
- if (mip_cube_map) {
- for (int j = 0; j < 6; j++) {
- glTexImage2D(
- GL_TEXTURE_CUBE_MAP_POSITIVE_X + j, i,
- informat, mipw, miph, 0, GL_RGBA, type, mip_cube_map[j]);
- }
- }
- gpu_del_cube_map(mip_cube_map);
- }
- }
+ glGenerateMipmap(GL_TEXTURE_CUBE_MAP);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, gpu_get_mipmap_filter(0));
if (ima)
@@ -799,8 +731,7 @@ void GPU_paint_update_image(Image *ima, ImageUser *iuser, int x, int y, int w, i
{
ImBuf *ibuf = BKE_image_acquire_ibuf(ima, iuser, NULL);
- if ((!GTS.gpu_mipmap && GPU_get_mipmap()) ||
- (ima->gputexture[TEXTARGET_TEXTURE_2D] == NULL) ||
+ if ((ima->gputexture[TEXTARGET_TEXTURE_2D] == NULL) ||
(ibuf == NULL) ||
(w == 0) || (h == 0))
{
@@ -829,8 +760,6 @@ void GPU_paint_update_image(Image *ima, ImageUser *iuser, int x, int y, int w, i
MEM_freeN(buffer);
- /* we have already accounted for the case where GTS.gpu_mipmap is false
- * so we will be using GPU mipmap generation here */
if (GPU_get_mipmap()) {
glGenerateMipmap(GL_TEXTURE_2D);
}
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 996cfeb76b4..854b7b7afc8 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -694,12 +694,12 @@ typedef struct UserDef {
/** Seconds to zoom around current frame. */
float view_frame_seconds;
- char _pad1[2];
+ char _pad1[4];
/** Private, defaults to 20 for 72 DPI setting. */
short widget_unit;
short anisotropic_filter;
- short use_16bit_textures, use_gpu_mipmap;
+ 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 eea2595d2a7..8f8b42faf70 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -185,12 +185,6 @@ 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(bmain, 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(bmain);
@@ -4484,11 +4478,6 @@ 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, "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");
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 2a99d06e9f9..134a1e31fce 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -187,7 +187,6 @@ void WM_init_opengl(Main *bmain)
GPU_set_mipmap(bmain, true);
GPU_set_linear_mipmap(true);
GPU_set_anisotropic(bmain, U.anisotropic_filter);
- GPU_set_gpu_mipmapping(bmain, U.use_gpu_mipmap);
GPU_pass_cache_init();