From: Lionel Landwerlin Date: Thu, 26 Aug 2021 11:42:53 +0000 (+0300) Subject: Fix fragment shading rate validation layer warning X-Git-Tag: upstream/1.3.5~597 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51ab0de31f67d96be92f40e1df21092600fe9291;p=platform%2Fupstream%2FVK-GL-CTS.git Fix fragment shading rate validation layer warning We passing a number of layer > 1 for an image view type of VK_IMAGE_VIEW_TYPE_2D. Also if we're not using ATTACHMENT_MODE_2DARRAY, then there is only one layer for the fragment rate shading attachment, so we should check against layer 0. Components: Vulkan Affects: dEQP-VK.fragment_shading_rate.srlayered.* VK-GL-CTS issue: 3079 Change-Id: I351f880a9bdd934f773e517713839c67ad453766 --- diff --git a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp index 9186a65..273e609 100644 --- a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp +++ b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp @@ -1325,7 +1325,8 @@ tcu::TestStatus FSRTestInstance::iterate (void) 0u, // deUint32 baseMipLevel; 1u, // deUint32 levelCount; 0u, // deUint32 baseArrayLayer; - numSRLayers // deUint32 layerCount; + srViewType == VK_IMAGE_VIEW_TYPE_2D ? + 1 : numSRLayers, // deUint32 layerCount; } // VkImageSubresourceRange subresourceRange; }; srImageView = createImageView(vk, device, &imageViewCreateInfo, NULL); @@ -2196,7 +2197,7 @@ tcu::TestStatus FSRTestInstance::iterate (void) deInt32 pipelineRate = PrimIDToPipelineShadingRate(primID); deInt32 primitiveRate = m_data.shaderWritesRate ? PrimIDToPrimitiveShadingRate(primID) : 0; - deInt32 attachmentLayer = m_data.srLayered ? layer : 0; + deInt32 attachmentLayer = (m_data.srLayered && modeIdx == ATTACHMENT_MODE_2DARRAY) ? layer : 0; deInt32 attachmentRate = m_data.useAttachment() ? fillPtr[srFillBpp*((attachmentLayer * srHeight + (y / srTexelHeight)) * srWidth + (x / srTexelWidth))] : 0; // Get mask of allowed shading rates