mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
mesa: Add and use _mesa_has_depth_float_channel
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7410>
(cherry picked from commit fda015023a)
This commit is contained in:
parent
14167715cc
commit
5b83eb0b09
4 changed files with 14 additions and 3 deletions
|
|
@ -1102,7 +1102,7 @@
|
|||
"description": "mesa: Add and use _mesa_has_depth_float_channel",
|
||||
"nominated": false,
|
||||
"nomination_type": null,
|
||||
"resolution": 4,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1335,6 +1335,15 @@ _mesa_is_depth_or_stencil_format(GLenum format)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if the given image format has a floating-point depth component.
|
||||
*/
|
||||
GLboolean
|
||||
_mesa_has_depth_float_channel(GLenum internalFormat)
|
||||
{
|
||||
return internalFormat == GL_DEPTH32F_STENCIL8 ||
|
||||
internalFormat == GL_DEPTH_COMPONENT32F;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test if an image format is a supported compressed format.
|
||||
|
|
|
|||
|
|
@ -104,6 +104,9 @@ _mesa_is_depthstencil_format(GLenum format);
|
|||
extern GLboolean
|
||||
_mesa_is_depth_or_stencil_format(GLenum format);
|
||||
|
||||
extern GLboolean
|
||||
_mesa_has_depth_float_channel(GLenum internalFormat);
|
||||
|
||||
extern GLboolean
|
||||
_mesa_is_compressed_format(const struct gl_context *ctx, GLenum format);
|
||||
|
||||
|
|
|
|||
|
|
@ -910,8 +910,7 @@ read_pixels_es3_error_check(struct gl_context *ctx, GLenum format, GLenum type,
|
|||
const GLenum data_type = _mesa_get_format_datatype(rb->Format);
|
||||
GLboolean is_unsigned_int = GL_FALSE;
|
||||
GLboolean is_signed_int = GL_FALSE;
|
||||
GLboolean is_float_depth = (internalFormat == GL_DEPTH_COMPONENT32F) ||
|
||||
(internalFormat == GL_DEPTH32F_STENCIL8);
|
||||
GLboolean is_float_depth = _mesa_has_depth_float_channel(internalFormat);
|
||||
|
||||
is_unsigned_int = _mesa_is_enum_format_unsigned_int(internalFormat);
|
||||
if (!is_unsigned_int) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue