]> git.sesse.net Git - nageru/commitdiff
Fix edge clamping behavior with out self-allocated textures.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 5 Oct 2015 23:18:46 +0000 (01:18 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 5 Oct 2015 23:18:46 +0000 (01:18 +0200)
pbo_frame_allocator.cpp

index 5f9d1bda9b659cc929c998bb37b274dbe1009ad8..15fcb61d37b8cefad61df15f26b165796e91b528 100644 (file)
@@ -38,6 +38,10 @@ PBOFrameAllocator::PBOFrameAllocator(size_t frame_size, GLuint width, GLuint hei
                check_error();
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                check_error();
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+               check_error();
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+               check_error();
                glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
                check_error();
 
@@ -47,6 +51,10 @@ PBOFrameAllocator::PBOFrameAllocator(size_t frame_size, GLuint width, GLuint hei
                check_error();
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                check_error();
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+               check_error();
+               glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+               check_error();
                glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, width / 2, height, 0, GL_RG, GL_UNSIGNED_BYTE, NULL);
                check_error();