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:
authorCampbell Barton <ideasman42@gmail.com>2019-06-24 15:09:04 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-06-24 15:10:43 +0300
commita699a9680bf88cef76fcf6be89d62bdeb532bd4c (patch)
tree728173ce40b90f16e3830bb3fe7276ade4a9b98e /source/blender/gpu/intern/gpu_texture.c
parentd51b74f9e3de4379dc675e08df8766b37105ee0e (diff)
Fix T65812: Image empty has wrong aspect with limit texture size
Diffstat (limited to 'source/blender/gpu/intern/gpu_texture.c')
-rw-r--r--source/blender/gpu/intern/gpu_texture.c17
1 files changed, 17 insertions, 0 deletions
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;