summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopengltexture.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-05-25 15:00:56 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-26 10:57:18 +0200
commit0c789184c7c7a7130346206e4abbcffc0858dfd7 (patch)
tree117a85deb3059d1c6121e1e9eaa26d6ae06ba414 /src/gui/opengl/qopengltexture.h
parent739fc9f24ea35bf55f853a970fe5ec27ef7a82ef (diff)
Fix support for depth/stencil textures in QOpenGLTexture
When allocating (mutable) storage for a texture, OpenGL mandates that the client-side format and pixel type "match" the internal format. That needs to happen even if we are not actually uploading anything (because we're passing NULL as the data parameter and no PBO is bound). This means that we need to pick a compatible format/type and not just pass GL_RGBA / GL_UNSIGNED_INT. In turn, it implies adding new enum values to the various format/type enums. Change-Id: If40c63b1d44764b3be131dd1b41d13983a19ae45 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/gui/opengl/qopengltexture.h')
-rw-r--r--src/gui/opengl/qopengltexture.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengltexture.h b/src/gui/opengl/qopengltexture.h
index 113325f0f6..ea81f1f8a4 100644
--- a/src/gui/opengl/qopengltexture.h
+++ b/src/gui/opengl/qopengltexture.h
@@ -203,6 +203,7 @@ public:
D32 = 0x81A7, // GL_DEPTH_COMPONENT32
D32F = 0x8CAC, // GL_DEPTH_COMPONENT32F
D32FS8X24 = 0x8CAD, // GL_DEPTH32F_STENCIL8
+ S8 = 0x8D48, // GL_STENCIL_INDEX8
// Compressed formats
RGB_DXT1 = 0x83F0, // GL_COMPRESSED_RGB_S3TC_DXT1_EXT
@@ -310,6 +311,7 @@ public:
BGR_Integer = 0x8D9A, // GL_BGR_INTEGER
RGBA_Integer = 0x8D99, // GL_RGBA_INTEGER
BGRA_Integer = 0x8D9B, // GL_BGRA_INTEGER
+ Stencil = 0x1901, // GL_STENCIL_INDEX
Depth = 0x1902, // GL_DEPTH_COMPONENT
DepthStencil = 0x84F9, // GL_DEPTH_STENCIL
Alpha = 0x1906, // GL_ALPHA
@@ -339,7 +341,9 @@ public:
UInt16_RGBA4 = 0x8033, // GL_UNSIGNED_SHORT_4_4_4_4
UInt16_RGBA4_Rev = 0x8365, // GL_UNSIGNED_SHORT_4_4_4_4_REV
UInt32_RGB10A2 = 0x8036, // GL_UNSIGNED_INT_10_10_10_2
- UInt32_RGB10A2_Rev = 0x8368 // GL_UNSIGNED_INT_2_10_10_10_REV
+ UInt32_RGB10A2_Rev = 0x8368, // GL_UNSIGNED_INT_2_10_10_10_REV
+ UInt32_D24S8 = 0x84FA, // GL_UNSIGNED_INT_24_8
+ Float32_D32_UInt32_S8_X24 = 0x8DAD // GL_FLOAT_32_UNSIGNED_INT_24_8_REV
};
// Pixel transfer