From a699a9680bf88cef76fcf6be89d62bdeb532bd4c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Jun 2019 22:09:04 +1000 Subject: Fix T65812: Image empty has wrong aspect with limit texture size --- source/blender/gpu/intern/gpu_texture.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/gpu/intern/gpu_texture.c') diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index 58d0dd5576f..54e93c361ca 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -68,6 +68,7 @@ typedef enum eGPUTextureFormatFlag { /* GPUTexture */ struct GPUTexture { int w, h, d; /* width/height/depth */ + int orig_w, orig_h; /* width/height (of source data), optional. */ int number; /* number for multitexture binding */ int refcount; /* reference count */ GLenum target; /* GL_TEXTURE_* */ @@ -1778,6 +1779,22 @@ int GPU_texture_height(const GPUTexture *tex) return tex->h; } +int GPU_texture_orig_width(const GPUTexture *tex) +{ + return tex->orig_w; +} + +int GPU_texture_orig_height(const GPUTexture *tex) +{ + return tex->orig_h; +} + +void GPU_texture_orig_size_set(GPUTexture *tex, int w, int h) +{ + tex->orig_w = w; + tex->orig_h = h; +} + int GPU_texture_layers(const GPUTexture *tex) { return tex->d; -- cgit v1.2.3