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:
authorClément Foucault <foucault.clem@gmail.com>2021-02-01 15:40:57 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-02-01 15:41:07 +0300
commit03c1c5f3a4c58e9f85a9ae79010a4fd41c8af92c (patch)
tree9bd70ac4128d3037e2a5f5c539b86901f11bcb3d /source/blender/gpu
parent5e117b122632bf52f84a84270639173df99b6cce (diff)
GPU: Fix performance regression on AMD GPU
This was caused by a missing check left over during the GL isolation. Fix T84277 Solid and Wireframe viewport performance hit on AMD Radeon GPUs
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/opengl/gl_drawlist.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/gpu/opengl/gl_drawlist.cc b/source/blender/gpu/opengl/gl_drawlist.cc
index f0a18deafd3..0270020b9d8 100644
--- a/source/blender/gpu/opengl/gl_drawlist.cc
+++ b/source/blender/gpu/opengl/gl_drawlist.cc
@@ -69,7 +69,6 @@ GLDrawList::GLDrawList(int length)
buffer_id_ = 0;
command_len_ = 0;
command_offset_ = 0;
- data_offset_ = 0;
data_size_ = 0;
data_ = nullptr;
@@ -81,6 +80,8 @@ GLDrawList::GLDrawList(int length)
/* Indicates MDI is not supported. */
buffer_size_ = 0;
}
+ /* Force buffer specification on first init. */
+ data_offset_ = buffer_size_;
}
GLDrawList::~GLDrawList()
@@ -104,10 +105,10 @@ void GLDrawList::init()
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, buffer_id_);
/* If buffer is full, orphan buffer data and start fresh. */
- // if (command_offset_ >= data_size_) {
- glBufferData(GL_DRAW_INDIRECT_BUFFER, buffer_size_, nullptr, GL_DYNAMIC_DRAW);
- data_offset_ = 0;
- // }
+ if (data_offset_ >= buffer_size_) {
+ glBufferData(GL_DRAW_INDIRECT_BUFFER, buffer_size_, nullptr, GL_DYNAMIC_DRAW);
+ data_offset_ = 0;
+ }
/* Map the remaining range. */
GLbitfield flag = GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_FLUSH_EXPLICIT_BIT;
data_size_ = buffer_size_ - data_offset_;