Snap for 4649231 from f03effb5a034c9e6dadd27d58fcc2d33af75eb00 to nougat-mr1-cts-release
Change-Id: Ib08936a7f2b82eb7b720105ef6d287ea9fb25f73
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 @@
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;
}