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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-15 23:56:33 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-15 23:56:33 +0400
commit2d21e6521f99825cd4c5783ca6866910947c7e13 (patch)
tree6bd977781c715f8fa0c8ce5bb8e373ef57777c95 /source/blender/gpu/intern
parent88cf1a2bc73bbd2f2fbf2ba3d5b1e7d4a1db7a93 (diff)
Fix: multisample viewport drawing didn't work well with selection or particle
brushes, due to issues with color coded drawing or slow/buggy reading from such a buffer on some systems. In case multisample is enabled now, it uses an offscreen buffer for such drawing, which is not multisampled and so should not cause issues. This does mean there is some extra GPU memory usage when multisample is enabled, and we could optimize triple buffer to work together here somehow to share buffers, but it's better than having selection not working.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_extensions.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c
index f5eaa716dfa..c7a421a49fc 100644
--- a/source/blender/gpu/intern/gpu_extensions.c
+++ b/source/blender/gpu/intern/gpu_extensions.c
@@ -905,10 +905,8 @@ void GPU_framebuffer_texture_bind(GPUFrameBuffer *UNUSED(fb), GPUTexture *tex, i
glMatrixMode(GL_PROJECTION);
glPushMatrix();
- glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
- glLoadIdentity();
}
void GPU_framebuffer_texture_unbind(GPUFrameBuffer *UNUSED(fb), GPUTexture *UNUSED(tex))
@@ -1096,6 +1094,16 @@ void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels)
glReadPixels(0, 0, ofs->w, ofs->h, GL_RGBA, type, pixels);
}
+int GPU_offscreen_width(GPUOffScreen *ofs)
+{
+ return ofs->w;
+}
+
+int GPU_offscreen_height(GPUOffScreen *ofs)
+{
+ return ofs->h;
+}
+
/* GPUShader */
struct GPUShader {