Mesa (master): mesa: Fix depth/stencil ordering in _mesa_format_from_format_and_type().

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 17 21:40:00 UTC 2019


Module: Mesa
Branch: master
Commit: 7be72b24f50f71257453e14cc30d33cd45fae21e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7be72b24f50f71257453e14cc30d33cd45fae21e

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Sep 17 14:54:48 2019 -0700

mesa: Fix depth/stencil ordering in _mesa_format_from_format_and_type().

The GL spec says the 24-bit component is in the high bits, and
format_unpack.c looks at the high 24 bits in the S8Z24 case, not
Z24SS8.

Avoids a regression in the next commit.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/main/glformats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 7df26189359..3ab06456e8b 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -3737,7 +3737,7 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
       break;
    case GL_UNSIGNED_INT_24_8:
       if (format == GL_DEPTH_STENCIL)
-         return MESA_FORMAT_Z24_UNORM_S8_UINT;
+         return MESA_FORMAT_S8_UINT_Z24_UNORM;
       break;
    case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
       if (format == GL_DEPTH_STENCIL)




More information about the mesa-commit mailing list