From 1165280cbd37dee1e499358633478ab869de21df Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 1 Jun 2011 15:48:51 +0200 Subject: mesa: initial ARB_depth_buffer_float support Using GL_NONE as DataType of Z32_FLOAT_X24S8, not sure what I should put there. The spec says the type is n/a. Reviewed-by: Kenneth Graunke --- src/mesa/main/formats.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/mesa/main/formats.c') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index e88ba43971b..f58b1975672 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1091,6 +1091,25 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 4 }, + /* ARB_depth_buffer_float */ + { + MESA_FORMAT_Z32_FLOAT, /* Name */ + "MESA_FORMAT_Z32_FLOAT", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_FLOAT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z32_FLOAT_X24S8, /* Name */ + "MESA_FORMAT_Z32_FLOAT_X24S8", /* StrName */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_NONE /* XXX */, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 32, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 8 /* BlockWidth/Height,Bytes */ + }, }; @@ -1654,6 +1673,16 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 1; return; + case MESA_FORMAT_Z32_FLOAT: + *datatype = GL_FLOAT; + *comps = 1; + return; + + case MESA_FORMAT_Z32_FLOAT_X24S8: + *datatype = GL_FLOAT_32_UNSIGNED_INT_24_8_REV; + *comps = 1; + return; + case MESA_FORMAT_DUDV8: *datatype = GL_BYTE; *comps = 2; -- cgit v1.2.3 From e134eaa2c5619b47e944e33d053ee23c61da7aa9 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 11 Jul 2011 13:53:42 +0200 Subject: mesa: fix assertion failure in _mesa_test_formats Z32_FLOAT_X24S8 has DataType of GL_NONE. --- src/mesa/main/formats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/main/formats.c') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index f58b1975672..e01ea11df97 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1485,7 +1485,8 @@ _mesa_test_formats(void) info->DataType == GL_SIGNED_NORMALIZED || info->DataType == GL_UNSIGNED_INT || info->DataType == GL_INT || - info->DataType == GL_FLOAT); + info->DataType == GL_FLOAT || + info->DataType == GL_NONE); if (info->BaseFormat == GL_RGB) { assert(info->RedBits > 0); -- cgit v1.2.3 From ceb04b32baf13bbd62cf80496e5751612287ef15 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 11 Jul 2011 15:18:14 +0200 Subject: mesa: add a comment in _mesa_test_formats --- src/mesa/main/formats.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/main/formats.c') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index e01ea11df97..f9298d2d1e9 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1486,6 +1486,7 @@ _mesa_test_formats(void) info->DataType == GL_UNSIGNED_INT || info->DataType == GL_INT || info->DataType == GL_FLOAT || + /* Z32_FLOAT_X24S8 has DataType of GL_NONE */ info->DataType == GL_NONE); if (info->BaseFormat == GL_RGB) { -- cgit v1.2.3