From: Bas Nieuwenhuizen Date: Thu, 15 Feb 2018 10:33:22 +0000 (+0100) Subject: DO NOT MERGE: Fix dEQP-VK.api.copy_and_blit.image_to_image_depth value range. X-Git-Tag: upstream/1.3.5~1205^2^2~2^2^2^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f03effb5a034c9e6dadd27d58fcc2d33af75eb00;p=platform%2Fupstream%2FVK-GL-CTS.git DO NOT MERGE: Fix dEQP-VK.api.copy_and_blit.image_to_image_depth value range. Per spec: "Because depth or stencil aspect buffer to image copies may require format conversions on some implementations, they are not supported on queues that do not support graphics. When copying to a depth aspect, the data in buffer memory must be in the the range [0,1] or undefined results occur." Initializing it to integer values falls afoul of this rule quickly. As the image is 256 by 256, x/255.0 should always fall in the range [0,1]. Not entirely sure this would initialize combined depth stencil correctly, but this version of CTS does not have a test using those formats with this code. This has been fixed upstream for a while with "9909b9f3 Fix combined depth/stencil clear colors." but this is not a straight backport as these tests saw some significant rework between this CTS version and the fix. Bug: b/73449389 Change-Id: Iaf0ce14ed4338d437f1b20033be5d0f8c0cbd699 --- diff --git a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp index 43bd8a9..e248f5b 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiCopiesAndBlittingTests.cpp @@ -189,16 +189,28 @@ void CopiesAndBlittingTestInstance::generateBuffer(tcu::PixelBufferAccess buffer switch (mode) { case FILL_MODE_SEQUENTIAL: - buffer.setPixel(tcu::UVec4(x, y, z, 255), x, y, z); + if (tcu::hasDepthComponent(buffer.getFormat().order)) + buffer.setPixDepth((float)x/255.0f, x, y, z); + else + buffer.setPixel(tcu::UVec4(x, y, z, 255), x, y, z); break; case FILL_MODE_WHITE: - buffer.setPixel(tcu::UVec4(255, 255, 255, 255), x, y, z); + if (tcu::hasDepthComponent(buffer.getFormat().order)) + buffer.setPixDepth(1.0f, x, y, z); + else + buffer.setPixel(tcu::UVec4(255, 255, 255, 255), x, y, z); break; case FILL_MODE_RED: - buffer.setPixel(tcu::UVec4(255, 0, 0, 255), x, y, z); + if (tcu::hasDepthComponent(buffer.getFormat().order)) + buffer.setPixDepth(1.0f, x, y, z); + else + buffer.setPixel(tcu::UVec4(255, 0, 0, 255), x, y, z); break; case FILL_MODE_RANDOM: - buffer.setPixel(tcu::UVec4(rnd.getUint8(), rnd.getUint8(), rnd.getUint8(), 255), x, y, z); + if (tcu::hasDepthComponent(buffer.getFormat().order)) + buffer.setPixDepth(rnd.getUint8()/255.0f, x, y, z); + else + buffer.setPixel(tcu::UVec4(rnd.getUint8(), rnd.getUint8(), rnd.getUint8(), 255), x, y, z); default: break; }