diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-08-18 07:32:28 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-08-18 07:32:28 +0400 |
commit | a6d1b955ab90f608116fc1fae172a14bcd84c4cd (patch) | |
tree | 9f7f972ed55fdd62a2580b3c0779214b22c1d6a9 /source/blender/gpu | |
parent | 0fee1a3c0b125321ed5acb880958864ac043c88e (diff) |
Moving more duplicate code from GPU_create_gl_tex_compressed() and BL_Texture::InitGLCompressedTex() into GPU_Upload_dxt_texture(). This reduces code duplication and ensures that both paths are using the same settings.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_draw.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 3c2d3e11197..d03913af417 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -730,6 +730,11 @@ int GPU_upload_dxt_texture(ImBuf *ibuf) return FALSE; } + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1)); + + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + blocksize = (format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) ? 8 : 16; for (i=0; i<ibuf->dds_data.nummipmaps && (width||height); ++i) { if (width == 0) @@ -766,11 +771,6 @@ void GPU_create_gl_tex_compressed(unsigned int *bind, unsigned int *pix, int x, glGenTextures(1, (GLuint *)bind); glBindTexture(GL_TEXTURE_2D, *bind); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1)); - - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - if (GPU_upload_dxt_texture(ibuf) == 0) { glDeleteTextures(1, (GLuint*)bind); GPU_create_gl_tex(bind, pix, NULL, x, y, mipmap, 0, ima); |