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>
This commit is contained in:
parent
bf5cea7232
commit
fda015023a
|
@ -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.
|
* Test if an image format is a supported compressed format.
|
||||||
|
|
|
@ -104,6 +104,9 @@ _mesa_is_depthstencil_format(GLenum format);
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
_mesa_is_depth_or_stencil_format(GLenum format);
|
_mesa_is_depth_or_stencil_format(GLenum format);
|
||||||
|
|
||||||
|
extern GLboolean
|
||||||
|
_mesa_has_depth_float_channel(GLenum internalFormat);
|
||||||
|
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
_mesa_is_compressed_format(const struct gl_context *ctx, GLenum format);
|
_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);
|
const GLenum data_type = _mesa_get_format_datatype(rb->Format);
|
||||||
GLboolean is_unsigned_int = GL_FALSE;
|
GLboolean is_unsigned_int = GL_FALSE;
|
||||||
GLboolean is_signed_int = GL_FALSE;
|
GLboolean is_signed_int = GL_FALSE;
|
||||||
GLboolean is_float_depth = (internalFormat == GL_DEPTH_COMPONENT32F) ||
|
GLboolean is_float_depth = _mesa_has_depth_float_channel(internalFormat);
|
||||||
(internalFormat == GL_DEPTH32F_STENCIL8);
|
|
||||||
|
|
||||||
is_unsigned_int = _mesa_is_enum_format_unsigned_int(internalFormat);
|
is_unsigned_int = _mesa_is_enum_format_unsigned_int(internalFormat);
|
||||||
if (!is_unsigned_int) {
|
if (!is_unsigned_int) {
|
||||||
|
|
Loading…
Reference in New Issue