dEQP-VK.texture.texel_buffer.uniform.snorm.r8g8b8a8-snorm
dEQP-VK.texture.multisample.atomic.storage_image_r32i
dEQP-VK.texture.multisample.atomic.storage_image_r32ui
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_2
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_4
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_8
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_16
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_32
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_64
dEQP-VK.texture.texel_offset.texel_offset
dEQP-VK.texture.texel_buffer.uniform.snorm.r8g8b8a8-snorm
dEQP-VK.texture.multisample.atomic.storage_image_r32i
dEQP-VK.texture.multisample.atomic.storage_image_r32ui
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_2
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_4
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_8
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_16
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_32
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_64
dEQP-VK.texture.texel_offset.texel_offset
--- /dev/null
+#!amber
+# Copyright 2021 Google LLC.
+# Copyright 2021 The Khronos Group 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.
+
+# Write to an invalid sample index test
+# Sample Count: 16
+# Tested Sample Min: -256
+# Tested Sample Max: 256
+# Description: All writes to invalid sample numbers should be discarded.
+
+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, rgba8) image2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+
+void main()
+{
+ int numSamples = 16;
+ int distortion = 256;
+ vec4 ndxColors[4];
+
+ ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
+ ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
+ ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
+ ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
+
+ ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
+
+ // Initialize texture
+ for (int s = -distortion; s < distortion; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ imageStore(texture, uv, s, color);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ // Verification
+ bool imageOk = true;
+
+ for (int s = 0; s < numSamples; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ if (imageLoad(texture, uv, s) != color)
+ imageOk = false;
+ }
+
+ vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, uv, resultColor);
+}
+END
+
+IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 16
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 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 1 1 1
+
+EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+# Copyright 2021 Google LLC.
+# Copyright 2021 The Khronos Group 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.
+
+# Write to an invalid sample index test
+# Sample Count: 2
+# Tested Sample Min: -256
+# Tested Sample Max: 256
+# Description: All writes to invalid sample numbers should be discarded.
+
+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, rgba8) image2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+
+void main()
+{
+ int numSamples = 2;
+ int distortion = 256;
+ vec4 ndxColors[2];
+
+ ndxColors[0] = vec4(1.0, 0.0, 1.0, 1.0);
+ ndxColors[1] = vec4(0.0, 1.0, 1.0, 1.0);
+
+ ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
+
+ // Initialize texture
+ for (int s = -distortion; s < distortion; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 2];
+
+ imageStore(texture, uv, s, color);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ // Verification
+ bool imageOk = true;
+
+ for (int s = 0; s < numSamples; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 2];
+
+ if (imageLoad(texture, uv, s) != color)
+ imageOk = false;
+ }
+
+ vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, uv, resultColor);
+}
+END
+
+IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 2
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 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 1 1 1
+
+EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+# Copyright 2021 Google LLC.
+# Copyright 2021 The Khronos Group 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.
+
+# Write to an invalid sample number test
+# Sample Count: 32
+# Tested Sample Min: -256
+# Tested Sample Max: 256
+# Description: All writes to invalid sample numbers should be discarded.
+
+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, rgba8) image2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+
+void main()
+{
+ int numSamples = 32;
+ int distortion = 256;
+ vec4 ndxColors[4];
+
+ ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
+ ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
+ ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
+ ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
+
+ ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
+
+ // Initialize texture
+ for (int s = -distortion; s < distortion; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ imageStore(texture, uv, s, color);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ // Verification
+ bool imageOk = true;
+
+ for (int s = 0; s < numSamples; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ if (imageLoad(texture, uv, s) != color)
+ imageOk = false;
+ }
+
+ vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, uv, resultColor);
+}
+END
+
+IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 32
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 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 1 1 1
+
+EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+# Copyright 2021 Google LLC.
+# Copyright 2021 The Khronos Group 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.
+
+# Write to an invalid sample index test
+# Sample Count: 4
+# Tested Sample Min: -256
+# Tested Sample Max: 256
+# Description: All writes to invalid sample numbers should be discarded.
+
+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, rgba8) image2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+
+void main()
+{
+ int numSamples = 4;
+ int distortion = 256;
+ vec4 ndxColors[4];
+
+ ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
+ ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
+ ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
+ ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
+
+ ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
+
+ // Initialize texture
+ for (int s = -distortion; s < distortion; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ imageStore(texture, uv, s, color);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ // Verification
+ bool imageOk = true;
+
+ for (int s = 0; s < numSamples; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ if (imageLoad(texture, uv, s) != color)
+ imageOk = false;
+ }
+
+ vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, uv, resultColor);
+}
+END
+
+IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 4
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 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 1 1 1
+
+EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+# Copyright 2021 Google LLC.
+# Copyright 2021 The Khronos Group 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.
+
+# Write to an invalid sample number test
+# Sample Count: 64
+# Tested Sample Min: -256
+# Tested Sample Max: 256
+# Description: All writes to invalid sample numbers should be discarded.
+
+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, rgba8) image2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+
+void main()
+{
+ int numSamples = 64;
+ int distortion = 256;
+ vec4 ndxColors[4];
+
+ ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
+ ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
+ ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
+ ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
+
+ ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
+
+ // Initialize texture
+ for (int s = -distortion; s < distortion; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ imageStore(texture, uv, s, color);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ // Verification
+ bool imageOk = true;
+
+ for (int s = 0; s < numSamples; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ if (imageLoad(texture, uv, s) != color)
+ imageOk = false;
+ }
+
+ vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, uv, resultColor);
+}
+END
+
+IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 64
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 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 1 1 1
+
+EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+# Copyright 2021 Google LLC.
+# Copyright 2021 The Khronos Group 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.
+
+# Write to an invalid sample index test
+# Sample Count: 8
+# Tested Sample Min: -256
+# Tested Sample Max: 256
+# Description: All writes to invalid sample numbers should be discarded.
+
+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, rgba8) image2DMS texture;
+uniform layout(set=0, binding=1, rgba8) image2D result;
+
+
+void main()
+{
+ int numSamples = 8;
+ int distortion = 256;
+ vec4 ndxColors[4];
+
+ ndxColors[0] = vec4(1.0, 0.0, 0.0, 1.0);
+ ndxColors[1] = vec4(0.0, 1.0, 0.0, 1.0);
+ ndxColors[2] = vec4(0.0, 0.0, 1.0, 1.0);
+ ndxColors[3] = vec4(0.0, 1.0, 1.0, 1.0);
+
+ ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
+
+ // Initialize texture
+ for (int s = -distortion; s < distortion; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ imageStore(texture, uv, s, color);
+ }
+
+ memoryBarrierImage();
+ barrier();
+
+ // Verification
+ bool imageOk = true;
+
+ for (int s = 0; s < numSamples; s++)
+ {
+ vec4 color = vec4(1);
+
+ if (s >= 0 && s < numSamples) color = ndxColors[s % 4];
+
+ if (imageLoad(texture, uv, s) != color)
+ imageOk = false;
+ }
+
+ vec4 resultColor = imageOk ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+ imageStore(result, uv, resultColor);
+}
+END
+
+IMAGE texture FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 SAMPLES 8
+IMAGE result FORMAT R8G8B8A8_UNORM DIM_2D WIDTH 16 HEIGHT 16 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 1 1 1
+
+EXPECT result IDX 0 0 SIZE 16 16 EQ_RGBA 0 255 0 255
return atomic.release();
}
+tcu::TestCaseGroup* createInvalidSampleIndexTests(tcu::TestContext& testCtx)
+{
+ std::pair <std::string, VkSampleCountFlagBits> cases[] =
+ {
+ { "sample_count_2", VK_SAMPLE_COUNT_2_BIT },
+ { "sample_count_4", VK_SAMPLE_COUNT_4_BIT },
+ { "sample_count_8", VK_SAMPLE_COUNT_8_BIT },
+ { "sample_count_16", VK_SAMPLE_COUNT_16_BIT },
+ { "sample_count_32", VK_SAMPLE_COUNT_32_BIT },
+ { "sample_count_64", VK_SAMPLE_COUNT_64_BIT }
+ };
+
+ de::MovePtr<tcu::TestCaseGroup> invalidWrites (new tcu::TestCaseGroup(testCtx, "invalid_sample_index", "Writes to invalid sample indices should be discarded."));
+ static const char dataDir[] = "texture/multisample/invalidsampleindex";
+ std::vector<std::string> requirements = { "Features.shaderStorageImageMultisample" };
+
+ for (const auto& testCase : cases)
+ {
+ const VkImageCreateInfo vkImageCreateInfo =
+ {
+ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, // sType
+ DE_NULL, // pNext
+ 0, // flags
+ VK_IMAGE_TYPE_2D, // imageType
+ VK_FORMAT_R8G8B8A8_UNORM, // format
+ { 16, 16, 1 }, // extent
+ 1, // mipLevels
+ 1, // arrayLayers
+ testCase.second, // samples
+ VK_IMAGE_TILING_OPTIMAL, // tiling
+ VK_IMAGE_USAGE_SAMPLED_BIT, // usage
+ VK_SHARING_MODE_EXCLUSIVE, // sharingMode
+ 0, // queueFamilyIndexCount
+ DE_NULL, // pQueueFamilyIndices
+ VK_IMAGE_LAYOUT_UNDEFINED, // initialLayout
+ };
+
+ std::vector<VkImageCreateInfo> imageRequirements = { vkImageCreateInfo };
+ const std::string fileName = testCase.first + ".amber";
+
+ invalidWrites->addChild(cts_amber::createAmberTestCase(testCtx, testCase.first.c_str(), "", dataDir, fileName, requirements, imageRequirements));
+ }
+
+ return invalidWrites.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));
+ multisample->addChild(createInvalidSampleIndexTests(testCtx));
return multisample.release();
}
dEQP-VK.texture.texel_buffer.uniform.snorm.r8g8b8a8-snorm
dEQP-VK.texture.multisample.atomic.storage_image_r32i
dEQP-VK.texture.multisample.atomic.storage_image_r32ui
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_2
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_4
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_8
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_16
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_32
+dEQP-VK.texture.multisample.invalid_sample_index.sample_count_64
dEQP-VK.texture.texel_offset.texel_offset