[Bf-blender-cvs] [d62f443f2d0] master: GPUTexture: Fixed typo where wrong enum was used

Ethan-Hall noreply at git.blender.org
Thu Apr 14 11:47:02 CEST 2022


Commit: d62f443f2d0b464131f77f770f9aa19d81164f0c
Author: Ethan-Hall
Date:   Thu Apr 14 11:41:47 2022 +0200
Branches: master
https://developer.blender.org/rBd62f443f2d0b464131f77f770f9aa19d81164f0c

GPUTexture: Fixed typo where wrong enum was used

This patch fixes a typo in commit e59f754c169d which incorrectly uses `GPU_TEXTURE_ARRAY` instead of `GPU_FORMAT_COMPRESSED`.

`GPU_FORMAT_COMPRESSED` and `GPU_TEXTURE_ARRAY` both currently evaluate to 16,  so this patch does not change anything functionally; however, this patch will prevent issues from arising in the future.

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D14384

===================================================================

M	source/blender/gpu/opengl/gl_texture.cc

===================================================================

diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc
index b78e30e8b4c..14f84273925 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -72,7 +72,7 @@ bool GLTexture::init_internal()
   GLenum internal_format = to_gl_internal_format(format_);
   const bool is_cubemap = bool(type_ == GPU_TEXTURE_CUBE);
   const bool is_layered = bool(type_ & GPU_TEXTURE_ARRAY);
-  const bool is_compressed = bool(format_flag_ & GPU_TEXTURE_ARRAY);
+  const bool is_compressed = bool(format_flag_ & GPU_FORMAT_COMPRESSED);
   const int dimensions = (is_cubemap) ? 2 : this->dimensions_count();
   GLenum gl_format = to_gl_data_format(format_);
   GLenum gl_type = to_gl(to_data_format(format_));



More information about the Bf-blender-cvs mailing list