From 4a9f9844aec346c73a1e96d7164b3d993c619d06 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 25 Mar 2014 01:21:26 +0100 Subject: [PATCH] Add proper formats for RGB without alpha. --- Makefile.in | 4 ++-- resource_pool.cpp | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 445f5b7..d028c08 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,8 +6,8 @@ GTEST_DIR ?= /usr/src/gtest # strive towards having a rock-stable ABI, but at least the soversion will increase # whenever it breaks, so that you will not have silent failures, and distribution package # management can run its course. -movit_ltversion = 1:3:0 -movit_version = 1.0.3 +movit_ltversion = 2:0:0 +movit_version = 1.1 prefix = @prefix@ exec_prefix = @exec_prefix@ diff --git a/resource_pool.cpp b/resource_pool.cpp index a32247d..d322a17 100644 --- a/resource_pool.cpp +++ b/resource_pool.cpp @@ -200,6 +200,12 @@ GLuint ResourcePool::create_2d_texture(GLint internal_format, GLsizei width, GLs case GL_SRGB8_ALPHA8: format = GL_RGBA; break; + case GL_RGB32F_ARB: + case GL_RGB16F_ARB: + case GL_RGB8: + case GL_SRGB8: + format = GL_RGB; + break; case GL_RG32F: case GL_RG16F: format = GL_RG; @@ -345,6 +351,16 @@ size_t ResourcePool::estimate_texture_size(const Texture2D &texture_format) case GL_SRGB8_ALPHA8: bytes_per_pixel = 4; break; + case GL_RGB32F_ARB: + bytes_per_pixel = 12; + break; + case GL_RGB16F_ARB: + bytes_per_pixel = 6; + break; + case GL_RGB8: + case GL_SRGB8: + bytes_per_pixel = 3; + break; case GL_RG32F: bytes_per_pixel = 8; break; -- 2.39.2