[virglrenderer-devel] [PATCH 09/16] vrend: Support Z32 format, with work around.

Jakob Bornecrantz jakob.bornecrantz at collabora.com
Fri Dec 22 18:57:49 UTC 2017


GLES does not support using Z32 as depth stencil, overwrite this
with Z24 which is supported.

Signed-off-by: Jakob Bornecrantz <jakob.bornecrantz at collabora.com>
---
 src/vrend_formats.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/vrend_formats.c b/src/vrend_formats.c
index 9bf4cfe..21d08bf 100644
--- a/src/vrend_formats.c
+++ b/src/vrend_formats.c
@@ -254,6 +254,10 @@ static struct vrend_format_table gles_bgra_formats[] = {
   { VIRGL_FORMAT_B8G8R8A8_UNORM, GL_BGRA_EXT, GL_BGRA_EXT, GL_UNSIGNED_BYTE, 0 },
 };
 
+static struct vrend_format_table gles_z32_format[] = {
+  { VIRGL_FORMAT_Z32_UNORM, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0 },
+};
+
 static void vrend_add_formats(struct vrend_format_table *table, int num_entries)
 {
   int i;
@@ -385,4 +389,11 @@ void vrend_build_format_list_gles(void)
    * GL_EXT_texture_format_BGRA8888 extension.
    */
   add_formats(gles_bgra_formats);
+
+
+  /* The Z32 format is required, but OpenGL ES does not support
+   * using it as a depth buffer. We just fake support with Z24
+   * and hope nobody notices.
+   */
+  add_formats(gles_z32_format);
 }
-- 
2.11.0



More information about the virglrenderer-devel mailing list