Fix assert for combined depth/stencil formats
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 2 Jan 2017 11:22:29 +0000 (12:22 +0100)
committerPyry Haulos <phaulos@google.com>
Thu, 5 Jan 2017 17:54:42 +0000 (13:54 -0400)
This was using tcu::isCombinedDepthStencilType(format.type) for this,
but this only checks the type and for 24bit depth formats with a
x8 d24 setup it will incorrectly identify them as combined
depth/stencil even though the underlying format is depth-only. Fix
this by testing if the format has depth and stencil components
instead.

Prevents crashes in tests with the following signature (144 tests):
dEQP-VK.texture.shadow.*x8_d24*

Fixes #563

Change-Id: Ie43e140a0461de49c02e0d97eeed38fa8ef24040

external/vulkancts/modules/vulkan/pipeline/vktPipelineImageUtil.cpp

index ad77b32..4d750d2 100644 (file)
@@ -401,7 +401,7 @@ void uploadTestTextureInternal (const DeviceInterface&                      vk,
        bufferSize =  (srcTexture.isCompressed())? srcTexture.getCompressedSize(): srcTexture.getSize();
 
        // Stencil-only texture should be provided if (and only if) the image has a combined DS format
-       DE_ASSERT(tcu::isCombinedDepthStencilType(format.type) == (srcStencilTexture != DE_NULL));
+       DE_ASSERT((tcu::hasDepthComponent(format.order) && tcu::hasStencilComponent(format.order)) == (srcStencilTexture != DE_NULL));
 
        if (srcStencilTexture != DE_NULL)
        {