Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derivate subgroup fix #442

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include "vktShaderRenderDerivateTests.hpp"
#include "vktShaderRender.hpp"
#include "subgroups/vktSubgroupsTestsUtils.hpp"
#include "vkImageUtil.hpp"
#include "vkQueryUtil.hpp"

Expand Down Expand Up @@ -807,22 +808,14 @@ void TriangleDerivateCase::checkSupport (Context& context) const
? "Derivatives in dynamic control flow"
: "Manual derivatives with subgroup operations";

if (!context.contextSupports(vk::ApiVersion(0, 1, 1, 0)))
throw tcu::NotSupportedError(errorPrefix + " require Vulkan 1.1");

const auto& subgroupProperties = context.getSubgroupProperties();
if (!subgroups::areQuadOperationsSupportedForStages(context, VK_SHADER_STAGE_FRAGMENT_BIT))
throw tcu::NotSupportedError(errorPrefix + " tests require VK_SUBGROUP_FEATURE_QUAD_BIT");

if (subgroupProperties.subgroupSize < 4)
if (subgroups::getSubgroupSize(context) < 4)
throw tcu::NotSupportedError(errorPrefix + " require subgroupSize >= 4");

if ((subgroupProperties.supportedOperations & VK_SUBGROUP_FEATURE_BALLOT_BIT) == 0)
if (!subgroups::isSubgroupFeatureSupportedForDevice(context, VK_SUBGROUP_FEATURE_BALLOT_BIT))
throw tcu::NotSupportedError(errorPrefix + " tests require VK_SUBGROUP_FEATURE_BALLOT_BIT");

if ((subgroupProperties.supportedStages & VK_SHADER_STAGE_FRAGMENT_BIT) == 0)
throw tcu::NotSupportedError(errorPrefix + " tests require subgroup supported stage including VK_SHADER_STAGE_FRAGMENT_BIT");

if (subgroupFunc && (subgroupProperties.supportedOperations & VK_SUBGROUP_FEATURE_QUAD_BIT) == 0)
throw tcu::NotSupportedError(errorPrefix + " tests require VK_SUBGROUP_FEATURE_QUAD_BIT");
}
}

Expand Down Expand Up @@ -1221,6 +1214,13 @@ LinearDerivateCase::~LinearDerivateCase (void)
TestInstance* LinearDerivateCase::createInstance (Context& context) const
{
DE_ASSERT(m_uniformSetup != DE_NULL);
if (m_fragmentTmpl.find("gl_SubgroupInvocationID") != std::string::npos) {
if (!subgroups::areQuadOperationsSupportedForStages(context, VK_SHADER_STAGE_FRAGMENT_BIT))
throw tcu::NotSupportedError("test requires VK_SUBGROUP_FEATURE_QUAD_BIT");

if (subgroups::getSubgroupSize(context) < 4)
throw tcu::NotSupportedError("test requires subgroupSize >= 4");
}
return new LinearDerivateCaseInstance(context, *m_uniformSetup, m_definitions, m_values);
}

Expand Down