Commit f34ba646 by Amy Liu Committed by Commit Bot

Fix maxShaderAtomicCounters value.

Set maxShaderAtomicCounters to zero when atomic operation is not supported. Some cts tests will only check maxShaderAtomicCounters instead of vertexPipelineStoresAndAtomics before run. Test: dEQP-GLES31.functional.shaders.opaque_type_indexing.atomic_counter.*vertex Bug: angleproject:5272 Change-Id: Iceb4fc13eb26548ccbfaa430501d88f5ba3dfcc3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2507280 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent a7bb6a9b
...@@ -604,6 +604,17 @@ void RendererVk::ensureCapsInitialized() const ...@@ -604,6 +604,17 @@ void RendererVk::ensureCapsInitialized() const
{ {
mNativeCaps.maxShaderAtomicCounters[shaderType] = maxAtomicCounters; mNativeCaps.maxShaderAtomicCounters[shaderType] = maxAtomicCounters;
} }
// Set maxShaderAtomicCounters to zero if atomic is not supported.
if (!mPhysicalDeviceFeatures.vertexPipelineStoresAndAtomics)
{
mNativeCaps.maxShaderAtomicCounters[gl::ShaderType::Vertex] = 0;
}
if (!mPhysicalDeviceFeatures.fragmentStoresAndAtomics)
{
mNativeCaps.maxShaderAtomicCounters[gl::ShaderType::Fragment] = 0;
}
mNativeCaps.maxCombinedAtomicCounters = maxAtomicCounters; mNativeCaps.maxCombinedAtomicCounters = maxAtomicCounters;
// GL Images correspond to Vulkan Storage Images. // GL Images correspond to Vulkan Storage Images.
......
...@@ -347,9 +347,11 @@ TEST_P(ProgramInterfaceTestES31, GetProgramInterface) ...@@ -347,9 +347,11 @@ TEST_P(ProgramInterfaceTestES31, GetProgramInterface)
// Tests the resource property query for uniform can be done correctly. // Tests the resource property query for uniform can be done correctly.
TEST_P(ProgramInterfaceTestES31, GetUniformProperties) TEST_P(ProgramInterfaceTestES31, GetUniformProperties)
{ {
// TODO(jiajia.qin@intel.com): Don't skip this test once atomic counter is supported on d3d // Check atomic support.
// backend. http://anglebug.com/1729 GLint numSupported;
ANGLE_SKIP_TEST_IF(IsD3D11()); glGetIntegerv(GL_MAX_VERTEX_ATOMIC_COUNTERS, &numSupported);
EXPECT_GL_NO_ERROR();
ANGLE_SKIP_TEST_IF(numSupported < 1);
constexpr char kVS[] = constexpr char kVS[] =
"#version 310 es\n" "#version 310 es\n"
...@@ -540,9 +542,13 @@ TEST_P(ProgramInterfaceTestES31, GetUniformBlockProperties) ...@@ -540,9 +542,13 @@ TEST_P(ProgramInterfaceTestES31, GetUniformBlockProperties)
// Tests atomic counter buffer qeury works correctly. // Tests atomic counter buffer qeury works correctly.
TEST_P(ProgramInterfaceTestES31, QueryAtomicCounteBuffer) TEST_P(ProgramInterfaceTestES31, QueryAtomicCounteBuffer)
{ {
// TODO(jiajia.qin@intel.com): Don't skip this test once atomic counter is supported on d3d // Check atomic support.
// backend. http://anglebug.com/1729 GLint numSupportedInVertex;
ANGLE_SKIP_TEST_IF(IsD3D11()); GLint numSupportedInFragment;
glGetIntegerv(GL_MAX_VERTEX_ATOMIC_COUNTERS, &numSupportedInVertex);
glGetIntegerv(GL_MAX_FRAGMENT_ATOMIC_COUNTERS, &numSupportedInFragment);
EXPECT_GL_NO_ERROR();
ANGLE_SKIP_TEST_IF(numSupportedInVertex < 1 || numSupportedInFragment < 1);
constexpr char kVS[] = constexpr char kVS[] =
"#version 310 es\n" "#version 310 es\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment