[Bf-blender-cvs] [1b20a9d383b] tmp-worbench-rewrite2-optimizations: Optimization: Don't use glClearTexImage

Miguel Pozo noreply at git.blender.org
Sun Jan 1 15:39:55 CET 2023


Commit: 1b20a9d383ba0659819f58ffcdba7f92a00c859c
Author: Miguel Pozo
Date:   Fri Dec 30 17:18:47 2022 +0100
Branches: tmp-worbench-rewrite2-optimizations
https://developer.blender.org/rB1b20a9d383ba0659819f58ffcdba7f92a00c859c

Optimization: Don't use glClearTexImage

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

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 6ec079f44b8..e12b15fd071 100644
--- a/source/blender/gpu/opengl/gl_texture.cc
+++ b/source/blender/gpu/opengl/gl_texture.cc
@@ -385,7 +385,9 @@ void GLTexture::clear(eGPUDataFormat data_format, const void *data)
 {
   BLI_assert(validate_data_format(format_, data_format));
 
-  if (GLContext::clear_texture_support) {
+  /* ClearTexImage can be up to 10 times slower */
+  const bool USE_CLEAR_TEX_IMAGE = false;
+  if (USE_CLEAR_TEX_IMAGE && GLContext::clear_texture_support) {
     int mip = 0;
     GLenum gl_format = to_gl_data_format(format_);
     GLenum gl_type = to_gl(data_format);



More information about the Bf-blender-cvs mailing list