mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 02:30:18 +01:00
mesa: Don't use memcpy() in _mesa_texstore() for float depth texture data
because float depth texture data needs clamping to [0.0, 1.0]. Let the
_mesa_texstore() fallback to slower path.
Fixes Khronos GLES3 CTS tests:
shadow_execution_vert
shadow_execution_frag
V2: Move the check to _mesa_texstore_can_use_memcpy() function.
Add check for floating point data types.
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 9548ba6e7b)
This commit is contained in:
parent
8e91b094c8
commit
f876eae80b
1 changed files with 15 additions and 0 deletions
|
|
@ -3908,6 +3908,21 @@ _mesa_texstore_can_use_memcpy(struct gl_context *ctx,
|
|||
return GL_FALSE;
|
||||
}
|
||||
|
||||
/* Depth texture data needs clamping in following cases:
|
||||
* - Floating point dstFormat with signed srcType: clamp to [0.0, 1.0].
|
||||
* - Fixed point dstFormat with signed srcType: clamp to [0, 2^n -1].
|
||||
*
|
||||
* All the cases except one (float dstFormat with float srcType) are ruled
|
||||
* out by _mesa_format_matches_format_and_type() check above. Handle the
|
||||
* remaining case here.
|
||||
*/
|
||||
if ((baseInternalFormat == GL_DEPTH_COMPONENT ||
|
||||
baseInternalFormat == GL_DEPTH_STENCIL) &&
|
||||
(srcType == GL_FLOAT ||
|
||||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV)) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue