external/vulkancts/modules/vulkan/texture/vktTextureFilteringExplicitLodTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureMipmapTests.cpp \
+ external/vulkancts/modules/vulkan/texture/vktTextureMultisampleTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureSubgroupLodTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureSwizzleTests.cpp \
dEQP-VK.texture.conversion.snorm_clamp.r8g8b8_snorm
dEQP-VK.texture.conversion.snorm_clamp.r8g8_snorm
dEQP-VK.texture.conversion.snorm_clamp.r8_snorm
+dEQP-VK.texture.multisample.atomic.storage_image_r32i
+dEQP-VK.texture.multisample.atomic.storage_image_r32ui
dEQP-VK.geometry.layered.1d_array.64_1_4.render_to_default_layer
dEQP-VK.geometry.layered.1d_array.64_1_4.render_to_one
dEQP-VK.geometry.layered.1d_array.64_1_4.render_to_all
dEQP-VK.texture.conversion.snorm_clamp.r8g8b8_snorm
dEQP-VK.texture.conversion.snorm_clamp.r8g8_snorm
dEQP-VK.texture.conversion.snorm_clamp.r8_snorm
+dEQP-VK.texture.multisample.atomic.storage_image_r32i
+dEQP-VK.texture.multisample.atomic.storage_image_r32ui
dEQP-VK.geometry.input.basic_primitive.points
dEQP-VK.geometry.input.basic_primitive.lines
dEQP-VK.geometry.input.basic_primitive.line_strip
--- /dev/null
+#!amber
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DEVICE_FEATURE shaderStorageImageMultisample
+
+SHADER compute compute_shader GLSL
+#version 430
+
+layout(local_size_x = 16, local_size_y = 16) in;
+uniform layout(set=0, binding=0, r32i) iimage2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+void main()
+{
+ ivec2 loc = ivec2(gl_LocalInvocationID.xy);
+ // Partner location is a mirror in local workgroup space.
+ ivec2 partnerLoc = ivec2(15) - loc;
+ int id = loc.y * 16 + loc.x;
+ int partnerId = partnerLoc.y * 16 + partnerLoc.x;
+ ivec2 workGroupOffset = ivec2(gl_WorkGroupID.xy) * ivec2(16);
+
+ // Initialize texture with id + sample id
+ for (int s = 0; s < 4; s++)
+ imageStore(texture, loc + workGroupOffset, s, ivec4(s + id));
+
+ memoryBarrierImage();
+ barrier();
+
+ for (int s = 0; s < 4; s++)
+ {
+ // Add id to both location and partner location.
+ imageAtomicAdd(texture, loc + workGroupOffset, s, id);
+ imageAtomicAdd(texture, partnerLoc + workGroupOffset, s, id);
+
+ // Set MSB for location and the second MSB for partner.
+ imageAtomicOr(texture, loc + workGroupOffset, s, 1 << 31);
+ imageAtomicOr(texture, partnerLoc + workGroupOffset, s, 1 << 30);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ for (int s = 0; s < 4; s++)
+ {
+ // XOR with two patterns in the second highest byte. Should set this
+ // byte to 0xc. The order of XOR operations don't matter.
+ imageAtomicXor(texture, loc + workGroupOffset, s, 0x0a000000);
+ imageAtomicXor(texture, partnerLoc + workGroupOffset, s, 0x06000000);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ for (int s = 0; s < 4; s++)
+ {
+ // Finally mask out one of LSBs based on sample
+ imageAtomicAnd(texture, loc + workGroupOffset, s, ~(1 << s));
+ }
+
+ // Verification
+ bool ok = true;
+
+ for (int s = 0; s < 4; s++)
+ {
+ if (imageLoad(texture, loc + workGroupOffset, s).r != (((s + id * 2 + partnerId) | 0xcc000000) & ~(1 << s)))
+ ok = false;
+ }
+
+ vec4 color = ok ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, loc + workGroupOffset, color);
+}
+END
+
+IMAGE texture FORMAT R32_SINT DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 FILL 0
+
+PIPELINE compute pipeline
+ ATTACH compute_shader
+
+ BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
+ BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
+END
+
+RUN pipeline 4 4 1
+
+EXPECT result IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DEVICE_FEATURE shaderStorageImageMultisample
+
+SHADER compute compute_shader GLSL
+#version 430
+
+layout(local_size_x = 16, local_size_y = 16) in;
+uniform layout(set=0, binding=0, r32ui) uimage2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+void main()
+{
+ ivec2 loc = ivec2(gl_LocalInvocationID.xy);
+ // Partner location is a mirror in local workgroup space.
+ ivec2 partnerLoc = ivec2(15) - loc;
+ uint id = loc.y * 16 + loc.x;
+ uint partnerId = partnerLoc.y * 16 + partnerLoc.x;
+ ivec2 workGroupOffset = ivec2(gl_WorkGroupID.xy) * ivec2(16);
+
+ // Initialize texture with id + sample id
+ for (int s = 0; s < 4; s++)
+ imageStore(texture, loc + workGroupOffset, s, uvec4(s + id));
+
+ memoryBarrierImage();
+ barrier();
+
+ for (int s = 0; s < 4; s++)
+ {
+ // Add id to both location and partner location.
+ imageAtomicAdd(texture, loc + workGroupOffset, s, id);
+ imageAtomicAdd(texture, partnerLoc + workGroupOffset, s, id);
+
+ // Set MSB for location and the second MSB for partner.
+ imageAtomicOr(texture, loc + workGroupOffset, s, 1u << 31);
+ imageAtomicOr(texture, partnerLoc + workGroupOffset, s, 1u << 30);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ for (int s = 0; s < 4; s++)
+ {
+ // XOR with two patterns in the second highest byte. Should set this
+ // byte to 0xc. The order of XOR operations don't matter.
+ imageAtomicXor(texture, loc + workGroupOffset, s, 0x0a000000);
+ imageAtomicXor(texture, partnerLoc + workGroupOffset, s, 0x06000000);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ for (int s = 0; s < 4; s++)
+ {
+ // Finally mask out one of LSBs based on sample
+ imageAtomicAnd(texture, loc + workGroupOffset, s, ~(1u << s));
+ }
+
+ // Verification
+ bool ok = true;
+
+ for (int s = 0; s < 4; s++)
+ {
+ if (imageLoad(texture, loc + workGroupOffset, s).r != (((s + id * 2 + partnerId) | 0xcc000000) & ~(1u << s)))
+ ok = false;
+ }
+
+ vec4 color = ok ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, loc + workGroupOffset, color);
+}
+END
+
+IMAGE texture FORMAT R32_UINT DIM_2D WIDTH 64 HEIGHT 64 SAMPLES 4
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 64 HEIGHT 64 FILL 0
+
+PIPELINE compute pipeline
+ ATTACH compute_shader
+
+ BIND BUFFER texture AS storage_image DESCRIPTOR_SET 0 BINDING 0
+ BIND BUFFER result AS storage_image DESCRIPTOR_SET 0 BINDING 1
+END
+
+RUN pipeline 4 4 1
+
+EXPECT result IDX 0 0 SIZE 64 64 EQ_RGBA 0 255 0 255
return ctx.getDeviceFeatures().vertexPipelineStoresAndAtomics;
if (feature == "Features.fillModeNonSolid")
return ctx.getDeviceFeatures().fillModeNonSolid;
+ if (feature == "Features.shaderStorageImageMultisample")
+ return ctx.getDeviceFeatures().shaderStorageImageMultisample;
if (feature == "VariablePointerFeatures.variablePointersStorageBuffer")
return ctx.getVariablePointersFeatures().variablePointersStorageBuffer;
if (feature == "VariablePointerFeatures.variablePointers")
vktTextureFilteringTests.hpp
vktTextureMipmapTests.cpp
vktTextureMipmapTests.hpp
+ vktTextureMultisampleTests.cpp
+ vktTextureMultisampleTests.hpp
vktTextureShadowTests.cpp
vktTextureShadowTests.hpp
vktTextureSubgroupLodTests.cpp
--- /dev/null
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2020 The Khronos Group Inc.
+ * Copyright (c) 2020 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Texture multisample tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "vktTextureMultisampleTests.hpp"
+#include "vktAmberTestCase.hpp"
+#include "vktTestGroupUtil.hpp"
+
+using namespace vk;
+
+namespace vkt
+{
+namespace texture
+{
+namespace
+{
+
+tcu::TestCaseGroup* createAtomicTests (tcu::TestContext& testCtx)
+{
+ de::MovePtr<tcu::TestCaseGroup> atomic (new tcu::TestCaseGroup(testCtx, "atomic", "Test atomic oprerations on multisample textures"));
+ static const char dataDir[] = "texture/multisample/atomic";
+
+ static const std::string cases[] =
+ {
+ "storage_image_r32i",
+ "storage_image_r32ui"
+ };
+
+ std::vector<std::string> requirements;
+
+ requirements.push_back("Features.shaderStorageImageMultisample");
+
+ for (int i = 0; i < DE_LENGTH_OF_ARRAY(cases); ++i)
+ {
+ const std::string fileName = cases[i] + ".amber";
+ cts_amber::AmberTestCase* testCase = cts_amber::createAmberTestCase(testCtx, cases[i].c_str(), "", dataDir, fileName, requirements);
+
+ atomic->addChild(testCase);
+ }
+
+ return atomic.release();
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createTextureMultisampleTests (tcu::TestContext& testCtx)
+{
+ de::MovePtr<tcu::TestCaseGroup> multisample (new tcu::TestCaseGroup(testCtx, "multisample", "Multisample texture tests"));
+
+ multisample->addChild(createAtomicTests(testCtx));
+
+ return multisample.release();
+}
+
+} // texture
+} // vkt
--- /dev/null
+#ifndef _VKTTEXTUREMULTISAMPLETESTS_HPP
+#define _VKTTEXTUREMULTISAMPLETESTS_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2020 The Khronos Group Inc.
+ * Copyright (c) 2020 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *//*!
+ * \file
+ * \brief Texture multisample tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+#include "vktTestCase.hpp"
+
+namespace vkt
+{
+namespace texture
+{
+
+tcu::TestCaseGroup* createTextureMultisampleTests (tcu::TestContext& testCtx);
+
+} // texture
+} // vkt
+
+#endif // _VKTTEXTUREMULTISAMPLETESTS_HPP
#include "vktTextureSwizzleTests.hpp"
#include "vktTextureSubgroupLodTests.hpp"
#include "vktTextureConversionTests.hpp"
+#include "vktTextureMultisampleTests.hpp"
namespace vkt
{
textureTests->addChild(createTextureSwizzleTests (testCtx));
textureTests->addChild(createTextureSubgroupLodTests (testCtx));
textureTests->addChild(createTextureConversionTests (testCtx));
+ textureTests->addChild(createTextureMultisampleTests (testCtx));
}
} // anonymous
dEQP-VK.texture.conversion.snorm_clamp.r8g8b8_snorm
dEQP-VK.texture.conversion.snorm_clamp.r8g8_snorm
dEQP-VK.texture.conversion.snorm_clamp.r8_snorm
+dEQP-VK.texture.multisample.atomic.storage_image_r32i
+dEQP-VK.texture.multisample.atomic.storage_image_r32ui
dEQP-VK.geometry.input.basic_primitive.points
dEQP-VK.geometry.input.basic_primitive.lines
dEQP-VK.geometry.input.basic_primitive.line_strip