Commit 6820f77a by Anders Leino Committed by Commit Bot

Fix issue where last 8 bits of D24X8 influence depth calculation.

Bug: angleproject:4573 Change-Id: If33737cf6ae660b8df58c06a08df32dade472540 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2211768 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 27ceed38
......@@ -504,6 +504,7 @@ inline float normalizedToFloat(T input)
{
static_assert(std::numeric_limits<T>::is_integer, "T must be an integer.");
static_assert(inputBitCount < (sizeof(T) * 8), "T must have more bits than inputBitCount.");
ASSERT((input & ~((1 << inputBitCount) - 1)) == 0);
if (inputBitCount > 23)
{
......
......@@ -1832,7 +1832,7 @@ void D16::WriteDepthStencil(D16 *dst, const DepthStencil *src)
void D24X8::ReadDepthStencil(DepthStencil *dst, const D24X8 *src)
{
dst->depth = gl::normalizedToFloat<24>(src->D);
dst->depth = gl::normalizedToFloat<24>(src->D & 0x00ffffff);
}
void D24X8::WriteDepthStencil(D24X8 *dst, const DepthStencil *src)
......
......@@ -751,7 +751,8 @@ struct D16
struct D24X8
{
uint32_t D;
uint32_t D : 24;
uint32_t X : 8;
static void ReadDepthStencil(DepthStencil *dst, const D24X8 *src);
static void WriteDepthStencil(D24X8 *dst, const DepthStencil *src);
......
......@@ -416,9 +416,6 @@ TEST_P(DepthStencilFormatsTest, DepthStencilReadback_UShort)
// This test will initialize a depth texture, clear it and read it back, if possible
TEST_P(DepthStencilFormatsTest, DepthStencilReadback_UInt)
{
// http://anglebug.com/4573
ANGLE_SKIP_TEST_IF(IsWindows() && IsVulkan());
GLuint fakeData[10] = {0};
ReadbackTestParam type = {
GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, fakeData, 16, 0};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment