diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-22 22:20:23 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-02 21:49:38 +0300 |
commit | 3f9f27e5a864f6e46cd47f31387390800e2600f2 (patch) | |
tree | fd3a30ef66b83ab0c68287681d14fd8fb7ad53a3 /source | |
parent | fd23c42faad1caa33188897535a0f3322b2e4971 (diff) |
GPUTexture: Fix wrong multisample texture size.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_texture.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c index d55bc02c836..19e26dcce8c 100644 --- a/source/blender/gpu/intern/gpu_texture.c +++ b/source/blender/gpu/intern/gpu_texture.c @@ -93,19 +93,20 @@ static unsigned int memory_usage; static unsigned int gpu_texture_memory_footprint_compute(GPUTexture *tex) { + int samp = max_ii(tex->samples, 1); switch (tex->target) { case GL_TEXTURE_1D: - return tex->bytesize * tex->w; + return tex->bytesize * tex->w * samp; case GL_TEXTURE_1D_ARRAY: case GL_TEXTURE_2D: - return tex->bytesize * tex->w * tex->h; + return tex->bytesize * tex->w * tex->h * samp; case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_3D: - return tex->bytesize * tex->w * tex->h * tex->d; + return tex->bytesize * tex->w * tex->h * tex->d * samp; case GL_TEXTURE_CUBE_MAP: - return tex->bytesize * 6 * tex->w * tex->h; + return tex->bytesize * 6 * tex->w * tex->h * samp; case GL_TEXTURE_CUBE_MAP_ARRAY: - return tex->bytesize * 6 * tex->w * tex->h * tex->d; + return tex->bytesize * 6 * tex->w * tex->h * tex->d * samp; default: return 0; } |