Fix T59349: Cycles viewport render flickering when changing some settings.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 3 Jan 2019 18:21:10 +0000 (19:21 +0100)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Thu, 3 Jan 2019 18:21:10 +0000 (19:21 +0100)
intern/cycles/device/device.cpp
intern/cycles/device/device_cuda.cpp

index be35b90bff01cb574fe99c52929031a4381e4f41..6ff94b45700eb5c899717e88306968694c7a41ea 100644 (file)
@@ -242,6 +242,7 @@ void Device::draw_pixels(
        mem_copy_from(rgba, y, w, h, rgba.memory_elements_size(1));
 
        GLuint texid;
+       glActiveTexture(GL_TEXTURE0);
        glGenTextures(1, &texid);
        glBindTexture(GL_TEXTURE_2D, texid);
 
index a788a8627d87b30382ee1429b508810544fc9e31..67f5793e793caf78ed1688d48c494961c080e3e1 100644 (file)
@@ -1861,6 +1861,7 @@ public:
 
                glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
 
+               glActiveTexture(GL_TEXTURE0);
                glGenTextures(1, &pmem.cuTexId);
                glBindTexture(GL_TEXTURE_2D, pmem.cuTexId);
                if(mem.data_type == TYPE_HALF)
@@ -1949,6 +1950,7 @@ public:
                                offset *= sizeof(uint8_t);
 
                        glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pmem.cuPBO);
+                       glActiveTexture(GL_TEXTURE0);
                        glBindTexture(GL_TEXTURE_2D, pmem.cuTexId);
                        if(mem.data_type == TYPE_HALF) {
                                glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, w, h, GL_RGBA, GL_HALF_FLOAT, (void*)offset);