diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-10-19 00:11:07 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-10-19 00:11:07 +0400 |
commit | 451607630edd2d1b1ef86bac2f62baa162546078 (patch) | |
tree | 341276c8b0d781c6bb56d87b835c8f8365c22546 /intern | |
parent | 596982fe67a4cf284a92db2436251c6fd33420a2 (diff) |
Fix #37134: cycles viewport not displaying correct with multi GPU render
and graphics card that does not support CUDA OpenGL interop.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index eb262a907a4..5c771aa1c8b 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -64,11 +64,16 @@ void Device::draw_pixels(device_memory& rgba, int y, int w, int h, int dy, int w glColor3f(1.0f, 1.0f, 1.0f); if(rgba.data_type == TYPE_HALF) { + /* for multi devices, this assumes the ineffecient method that we allocate + * all pixels on the device even though we only render to a subset */ + GLhalf *data_pointer = (GLhalf*)rgba.data_pointer; + data_pointer += 4*y*w; + /* draw half float texture, GLSL shader for display transform assumed to be bound */ GLuint texid; glGenTextures(1, &texid); glBindTexture(GL_TEXTURE_2D, texid); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, GL_RGBA, GL_HALF_FLOAT, (void*)rgba.data_pointer); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, w, h, 0, GL_RGBA, GL_HALF_FLOAT, data_pointer); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |