From 7d4864a7615fafd28c3fb0b904239afd0b16c73e Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Wed, 1 Feb 2023 15:25:19 +0900 Subject: [PATCH] Pass fragment shading rate info to pre rasterization shader state [Note] This is a backporting patch, that landed already on the branch 1.3.4 and main. But the issue still exist on the branch 1.3.2/1.3.3, so I create this CL that needs to propagate only to 1.3.3. Fragment shading rate info needs to be passed both as part of the pre-rasterization shader state and as part of the fragment shader state when creating pipelines, and it needs to be consistent in both cases. The graphics pipeline library utilities were only passing that information as part of the fragment shader state. Affects: dEQP-VK.fragment_shading_rate.*.misc_tests.* dEQP-VK.fragment_shading_rate.*.basic.* dEQP-VK.pipeline.*.mixed_attachment_samples.* dEQP-VK.*.sample_locations_ext.* dEQP-VK.pipeline.*.multisample_with_fragment_shading_rate.* Components: Vulkan VK-GL-CTS issue: 4006 Change-Id: I4c01a7836ed45f513f166e787d1e709c9a612018 --- .../vulkancts/framework/vulkan/vkPipelineConstructionUtil.cpp | 10 ++++------ .../vulkancts/framework/vulkan/vkPipelineConstructionUtil.hpp | 2 +- .../fragment_shading_rate/vktFragmentShadingRateBasic.cpp | 8 ++++---- .../vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp | 2 +- .../modules/vulkan/pipeline/vktPipelineMaxVaryingsTests.cpp | 2 +- .../vktPipelineMultisampleMixedAttachmentSamplesTests.cpp | 6 +++--- .../pipeline/vktPipelineMultisampleSampleLocationsExtTests.cpp | 6 +++--- .../modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp | 6 +++--- .../vulkan/pipeline/vktPipelineSamplerBorderSwizzleTests.cpp | 1 - .../modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp | 2 +- 10 files changed, 21 insertions(+), 24 deletions(-) diff --git a/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.cpp b/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.cpp index b0ebcc7..8cae7a4 100644 --- a/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.cpp +++ b/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.cpp @@ -266,7 +266,7 @@ struct GraphicsPipelineWrapper::InternalData 0u, // VkPipelineTessellationStateCreateFlags flags 3u // deUint32 patchControlPoints } - , pFragmentShadingRateState (DE_NULL) + , pFragmentShadingRateState (nullptr) , pRenderingState (DE_NULL) , pDynamicState (DE_NULL) , useViewportState (DE_TRUE) @@ -479,6 +479,7 @@ GraphicsPipelineWrapper& GraphicsPipelineWrapper::setupPreRasterizationShaderSta const VkShaderModule tessellationEvalShaderModule, const VkShaderModule geometryShaderModule, const VkSpecializationInfo* specializationInfo, + VkPipelineFragmentShadingRateStateCreateInfoKHR* fragmentShadingRateState, VkPipelineRenderingCreateInfoKHR* rendering, const VkPipelineCache partPipelineCache, VkPipelineCreationFeedbackCreateInfoEXT* partCreationFeedback) @@ -490,9 +491,8 @@ GraphicsPipelineWrapper& GraphicsPipelineWrapper::setupPreRasterizationShaderSta DE_ASSERT(m_internalData && (m_internalData->setupStates == VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT)); m_internalData->setupStates |= VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT; - //m_internalData->pRenderingState = rendering; - m_internalData->pRenderingState = rendering; + m_internalData->pFragmentShadingRateState = fragmentShadingRateState; const bool hasTesc = (tessellationControlShaderModule != DE_NULL); const bool hasTese = (tessellationEvalShaderModule != DE_NULL); @@ -566,6 +566,7 @@ GraphicsPipelineWrapper& GraphicsPipelineWrapper::setupPreRasterizationShaderSta { auto libraryCreateInfo = makeGraphicsPipelineLibraryCreateInfo(VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT); void* firstStructInChain = reinterpret_cast(&libraryCreateInfo); + addToChain(&firstStructInChain, m_internalData->pFragmentShadingRateState); addToChain(&firstStructInChain, m_internalData->pRenderingState); addToChain(&firstStructInChain, partCreationFeedback); @@ -597,7 +598,6 @@ GraphicsPipelineWrapper& GraphicsPipelineWrapper::setupFragmentShaderState(const const VkShaderModule fragmentShaderModule, const VkPipelineDepthStencilStateCreateInfo* depthStencilState, const VkPipelineMultisampleStateCreateInfo* multisampleState, - VkPipelineFragmentShadingRateStateCreateInfoKHR* fragmentShadingRateState, const VkSpecializationInfo* specializationInfo, const VkPipelineCache partPipelineCache, VkPipelineCreationFeedbackCreateInfoEXT* partCreationFeedback) @@ -610,8 +610,6 @@ GraphicsPipelineWrapper& GraphicsPipelineWrapper::setupFragmentShaderState(const VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT))); m_internalData->setupStates |= VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT; - m_internalData->pFragmentShadingRateState = fragmentShadingRateState; - const auto pDepthStencilState = depthStencilState ? depthStencilState : (m_internalData->useDefaultDepthStencilState ? &defaultDepthStencilState : DE_NULL); const auto pMultisampleState = multisampleState ? multisampleState diff --git a/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.hpp b/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.hpp index e3b34db..af89270 100644 --- a/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.hpp +++ b/external/vulkancts/framework/vulkan/vkPipelineConstructionUtil.hpp @@ -123,6 +123,7 @@ public: const VkShaderModule tessellationEvalShaderModule = DE_NULL, const VkShaderModule geometryShaderModule = DE_NULL, const VkSpecializationInfo* specializationInfo = DE_NULL, + VkPipelineFragmentShadingRateStateCreateInfoKHR* fragmentShadingRateState = nullptr, VkPipelineRenderingCreateInfoKHR* rendering = DE_NULL, const VkPipelineCache partPipelineCache = DE_NULL, VkPipelineCreationFeedbackCreateInfoEXT* partCreationFeedback = DE_NULL); @@ -134,7 +135,6 @@ public: const VkShaderModule fragmentShaderModule, const VkPipelineDepthStencilStateCreateInfo* depthStencilState = DE_NULL, const VkPipelineMultisampleStateCreateInfo* multisampleState = DE_NULL, - VkPipelineFragmentShadingRateStateCreateInfoKHR* fragmentShadingRateState = DE_NULL, const VkSpecializationInfo* specializationInfo = DE_NULL, const VkPipelineCache partPipelineCache = DE_NULL, VkPipelineCreationFeedbackCreateInfoEXT* partCreationFeedback = DE_NULL); diff --git a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp index 7fe4fab..cbf2b41 100644 --- a/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp +++ b/external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp @@ -1972,6 +1972,7 @@ tcu::TestStatus FSRTestInstance::iterate (void) DE_NULL, *geomShader, DE_NULL, + &shadingRateStateCreateInfo, pDynamicRendering) .setupFragmentShaderState( *pipelineLayout, @@ -1979,8 +1980,7 @@ tcu::TestStatus FSRTestInstance::iterate (void) 0u, *fragShader, &depthStencilStateParams, - &multisampleStateCreateInfo, - &shadingRateStateCreateInfo) + &multisampleStateCreateInfo) .setupFragmentOutputState(*renderPass, 0u, DE_NULL, &multisampleStateCreateInfo) .setMonolithicPipelineLayout(*pipelineLayout) .buildPipeline(); @@ -2093,6 +2093,7 @@ tcu::TestStatus FSRTestInstance::iterate (void) DE_NULL, *geomShader, DE_NULL, + &shadingRateStateCreateInfo, pDynamicRendering) .setupFragmentShaderState( *pipelineLayout, @@ -2100,8 +2101,7 @@ tcu::TestStatus FSRTestInstance::iterate (void) 0u, *fragShader, &depthStencilStateParams, - &multisampleStateCreateInfo, - &shadingRateStateCreateInfo) + &multisampleStateCreateInfo) .setupFragmentOutputState(*renderPass, 0u, DE_NULL, &multisampleStateCreateInfo) .setMonolithicPipelineLayout(*pipelineLayout) .buildPipeline(); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp index 26dd473..5a3774c 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineCreationFeedbackTests.cpp @@ -643,6 +643,7 @@ void GraphicsCacheTestInstance::preparePipelineWrapper (GraphicsPipelineWrapper& teseShaderModule, geomShaderModule, DE_NULL, + nullptr, DE_NULL, *m_cache, &pipelineCreationFeedbackCreateInfo[1]) @@ -654,7 +655,6 @@ void GraphicsCacheTestInstance::preparePipelineWrapper (GraphicsPipelineWrapper& &depthStencilStateParams, DE_NULL, DE_NULL, - DE_NULL, *m_cache, &pipelineCreationFeedbackCreateInfo[2]) .setupFragmentOutputState(*m_renderPass, 0u, &colorBlendStateParams, DE_NULL, *m_cache, &pipelineCreationFeedbackCreateInfo[3]) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMaxVaryingsTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMaxVaryingsTests.cpp index 66d1616..1f806df 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMaxVaryingsTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMaxVaryingsTests.cpp @@ -1065,7 +1065,7 @@ tcu::TestStatus test(Context& context, const MaxVaryingsParam param) *teseShaderModule, *geomShaderModule, &pSpecInfo) - .setupFragmentShaderState(*pipelineLayout, *renderPass, 0u, *fragShaderModule, DE_NULL, DE_NULL, DE_NULL, &pSpecInfo) + .setupFragmentShaderState(*pipelineLayout, *renderPass, 0u, *fragShaderModule, DE_NULL, DE_NULL, &pSpecInfo) .setupFragmentOutputState(*renderPass) .setMonolithicPipelineLayout(*pipelineLayout) .buildPipeline(); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleMixedAttachmentSamplesTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleMixedAttachmentSamplesTests.cpp index 57cf5c4..6ac44ad 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleMixedAttachmentSamplesTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleMixedAttachmentSamplesTests.cpp @@ -304,14 +304,14 @@ void preparePipelineWrapper(GraphicsPipelineWrapper& gpw, pipelineLayout, renderPass, subpassNdx, - vertexModule) + vertexModule, DE_NULL, DE_NULL, DE_NULL, DE_NULL, DE_NULL, + (useFragmentShadingRate ? &shadingRateStateCreateInfo : nullptr)) .setupFragmentShaderState(pipelineLayout, renderPass, subpassNdx, fragmentModule, &pipelineDepthStencilStateInfo, - &pipelineMultisampleStateInfo, - (useFragmentShadingRate ? &shadingRateStateCreateInfo : DE_NULL)) + &pipelineMultisampleStateInfo) .setupFragmentOutputState(renderPass, subpassNdx, &pipelineColorBlendStateInfo, &pipelineMultisampleStateInfo) .setMonolithicPipelineLayout(pipelineLayout) .buildPipeline(); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleSampleLocationsExtTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleSampleLocationsExtTests.cpp index daacb21..67ea110 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleSampleLocationsExtTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleSampleLocationsExtTests.cpp @@ -697,14 +697,14 @@ void preparePipelineWrapper (GraphicsPipelineWrapper& gpw, pipelineLayout, renderPass, subpassIndex, - vertexModule) + vertexModule, DE_NULL, DE_NULL, DE_NULL, DE_NULL, DE_NULL, + (useFragmentShadingRate ? &shadingRateStateCreateInfo : nullptr)) .setupFragmentShaderState(pipelineLayout, renderPass, subpassIndex, fragmentModule, &pipelineDepthStencilStateInfo, - &pipelineMultisampleStateInfo, - (useFragmentShadingRate ? &shadingRateStateCreateInfo : DE_NULL)) + &pipelineMultisampleStateInfo) .setupFragmentOutputState(renderPass, subpassIndex, &colorBlendStateCreateInfoDefault, &pipelineMultisampleStateInfo) .setMonolithicPipelineLayout(pipelineLayout) .buildPipeline(); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp index 20dfb27..28edb5b 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp @@ -4151,14 +4151,14 @@ void MultisampleRenderer::initialize (Context& context, *m_renderPass, subpassIdx, *m_vertexShaderModule, - &rasterizationStateCreateInfo) + &rasterizationStateCreateInfo, DE_NULL, DE_NULL, DE_NULL, DE_NULL, + m_useFragmentShadingRate ? &shadingRateStateCreateInfo : nullptr) .setupFragmentShaderState(*m_pipelineLayout, *m_renderPass, subpassIdx, *m_fragmentShaderModule, &depthStencilStateParams, - &m_multisampleStateParams, - m_useFragmentShadingRate ? &shadingRateStateCreateInfo : DE_NULL) + &m_multisampleStateParams) .setupFragmentOutputState(*m_renderPass, subpassIdx, &colorBlendStateParams, &m_multisampleStateParams) .setMonolithicPipelineLayout(*m_pipelineLayout) .buildPipeline(); diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerBorderSwizzleTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerBorderSwizzleTests.cpp index 9aadf6a..cf425f6 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerBorderSwizzleTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineSamplerBorderSwizzleTests.cpp @@ -931,7 +931,6 @@ tcu::TestStatus BorderSwizzleInstance::iterate (void) *fragShader, DE_NULL, DE_NULL, - DE_NULL, &specializationInfo) .setupFragmentOutputState(*renderPass, 0u, &colorBlendInfo) .setMonolithicPipelineLayout(*pipelineLayout) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp index 4e015cc..fe33b8f 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineSpecConstantTests.cpp @@ -723,7 +723,7 @@ tcu::TestStatus GraphicsTestInstance::iterate (void) *teseShaderModule, *geomShaderModule, pSpecInfo) - .setupFragmentShaderState(*pipelineLayout, *renderPass, 0u, *fragShaderModule, DE_NULL, DE_NULL, DE_NULL, pSpecInfo) + .setupFragmentShaderState(*pipelineLayout, *renderPass, 0u, *fragShaderModule, DE_NULL, DE_NULL, pSpecInfo) .setupFragmentOutputState(*renderPass) .setMonolithicPipelineLayout(*pipelineLayout) .buildPipeline(); -- 2.7.4