From: Jeff Bolz Date: Mon, 14 Dec 2015 23:05:57 +0000 (+0000) Subject: Fix stencil clear. Add threshold for image comparison (needed or RGB565) X-Git-Tag: upstream/0.1.0~812^2~434^2~3^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4009d8d01eb43b066f90059b9955ee20f0c677d;p=platform%2Fupstream%2FVK-GL-CTS.git Fix stencil clear. Add threshold for image comparison (needed or RGB565) --- diff --git a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp index 3d6e356..8d226b9 100644 --- a/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp +++ b/external/vulkancts/modules/vulkan/vktRenderPassTests.cpp @@ -1925,8 +1925,8 @@ void pushImageInitializationCommands (const DeviceInterface& vk, }; const VkImageSubresourceRange range = { - (VkImageAspectFlags)(hasDepthComponent(format.order) ? VK_IMAGE_ASPECT_DEPTH_BIT : 0 - | hasStencilComponent(format.order) ? VK_IMAGE_ASPECT_STENCIL_BIT : 0), + (VkImageAspectFlags)((hasDepthComponent(format.order) ? VK_IMAGE_ASPECT_DEPTH_BIT : 0) + | (hasStencilComponent(format.order) ? VK_IMAGE_ASPECT_STENCIL_BIT : 0)), 0, 1, 0, @@ -2790,6 +2790,12 @@ void checkColorRenderQuad (const ConstPixelBufferAccess& result, de::clamp(textureInfo.valueMin[3], clampMin, clampMax)); const BVec4 channelMask = tcu::getTextureFormatChannelMask(format); + IVec4 formatBitDepths = tcu::getTextureFormatBitDepth(format); + Vec4 threshold = Vec4(1.0f) / Vec4((float)(1 << formatBitDepths.x()), + (float)(1 << formatBitDepths.y()), + (float)(1 << formatBitDepths.z()), + (float)(1 << formatBitDepths.w())); + switch (channelClass) { case tcu::TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT: @@ -2811,9 +2817,9 @@ void checkColorRenderQuad (const ConstPixelBufferAccess& result, const Vec4 resColor (result.getPixel(x, y)); const Vec4 minRefColor = srgb ? tcu::linearToSRGB(valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs)) - : valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs); + : valueMax * minUvs + valueMin * (Vec4(1.0f) - minUvs) - threshold; const Vec4 maxRefColor = srgb ? tcu::linearToSRGB(valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs)) - : valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs); + : valueMax * maxUvs + valueMin * (Vec4(1.0f) - maxUvs) + threshold; DE_ASSERT(minRefColor[0] <= maxRefColor[0]); DE_ASSERT(minRefColor[1] <= maxRefColor[1]);