external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureMipmapTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureShadowTests.cpp \
+ external/vulkancts/modules/vulkan/texture/vktTextureSubgroupLodTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureSwizzleTests.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp \
external/vulkancts/modules/vulkan/texture/vktTextureTests.cpp \
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_yx
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_xx
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_yy
+dEQP-VK.texture.subgroup_lod.texturelod
+dEQP-VK.texture.subgroup_lod.texturegrad
+dEQP-VK.texture.subgroup_lod.texelfetch
dEQP-VK.geometry.input.basic_primitive.points
dEQP-VK.geometry.input.basic_primitive.lines
dEQP-VK.geometry.input.basic_primitive.line_strip
GitRepo(
"https://github.com/google/amber.git",
None,
- "0556811aeaad846f4bacbbd03e05e61fbfe1e545",
+ "ed3e05c945aa7a3559ef616f63a798fede19f363",
"amber"),
]
--- /dev/null
+#!amber
+
+# Copyright 2019 Google LLC.
+# Copyright 2019 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
+#
+# https://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.
+
+SHADER vertex vert_shader_mipclear PASSTHROUGH
+
+SHADER vertex vert_shader_lod GLSL
+#version 430
+
+layout(location = 0) in vec3 position_in;
+layout(location = 0) out vec4 color_out;
+layout(set = 0, binding = 0) uniform highp sampler2D tex;
+
+void main() {
+ gl_Position = vec4(position_in, 1.0);
+ // Pick a color from the center of a mipmap. Each corner point gets its own mip level.
+ int lod = gl_VertexIndex % 4;
+ int center = 256 >> lod;
+ color_out = texelFetch(tex, ivec2(center), lod);
+}
+END
+
+SHADER fragment frag_shader GLSL
+#version 430
+
+layout(location = 0) in vec4 color_in;
+layout(location = 0) out vec4 color_out;
+
+void main() {
+ color_out = color_in;
+}
+END
+
+BUFFER texture FORMAT B8G8R8A8_UNORM MIP_LEVELS 4
+BUFFER framebuffer FORMAT B8G8R8A8_UNORM
+SAMPLER sampler MAX_LOD 4.0
+
+PIPELINE graphics mipclear_pipeline0
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 0
+ FRAMEBUFFER_SIZE 512 512
+END
+
+PIPELINE graphics mipclear_pipeline1
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 1
+ FRAMEBUFFER_SIZE 256 256
+END
+
+PIPELINE graphics mipclear_pipeline2
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 2
+ FRAMEBUFFER_SIZE 128 128
+END
+
+PIPELINE graphics mipclear_pipeline3
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 3
+ FRAMEBUFFER_SIZE 64 64
+END
+
+PIPELINE graphics lod_pipeline
+ ATTACH vert_shader_lod
+ ATTACH frag_shader
+ BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
+ BIND BUFFER framebuffer AS color LOCATION 0
+ FRAMEBUFFER_SIZE 512 512
+END
+
+# Clear all mip levels to different color.
+CLEAR_COLOR mipclear_pipeline0 255 0 0 255
+CLEAR mipclear_pipeline0
+CLEAR_COLOR mipclear_pipeline1 0 255 0 255
+CLEAR mipclear_pipeline1
+CLEAR_COLOR mipclear_pipeline2 0 0 255 255
+CLEAR mipclear_pipeline2
+CLEAR_COLOR mipclear_pipeline3 255 255 0 255
+CLEAR mipclear_pipeline3
+
+CLEAR_COLOR lod_pipeline 0 0 0 255
+CLEAR lod_pipeline
+RUN lod_pipeline DRAW_RECT POS 0 0 SIZE 512 512
+
+# Check corners of the frame buffer: each should have a color from a different mip level.
+EXPECT framebuffer IDX 0 511 SIZE 1 1 EQ_RGBA 255 0 0 255
+EXPECT framebuffer IDX 511 0 SIZE 1 1 EQ_RGBA 255 255 0 255
+EXPECT framebuffer IDX 511 511 SIZE 1 1 EQ_RGBA 0 0 255 255
+EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+
+# Copyright 2019 Google LLC.
+# Copyright 2019 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
+#
+# https://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.
+
+SHADER vertex vert_shader_mipclear PASSTHROUGH
+
+SHADER vertex vert_shader_lod GLSL
+#version 430
+
+layout(location = 0) in vec3 position_in;
+layout(location = 0) out vec4 color_out;
+layout(set = 0, binding = 0) uniform highp sampler2D tex;
+
+void main() {
+ gl_Position = vec4(position_in, 1.0);
+ // Vary dPdx and dPdy based on vertex index to force
+ // LOD 0 or LOD 1.
+ vec2 v = vec2(0);
+ if (gl_VertexIndex % 2 != 0)
+ v = vec2(1);
+
+ color_out = vec4(textureGrad(tex, vec2(0.5), v, v));
+}
+END
+
+SHADER fragment frag_shader GLSL
+#version 430
+
+layout(location = 0) in vec4 color_in;
+layout(location = 0) out vec4 color_out;
+
+void main() {
+ color_out = color_in;
+}
+END
+
+BUFFER texture FORMAT B8G8R8A8_UNORM MIP_LEVELS 2
+BUFFER framebuffer FORMAT B8G8R8A8_UNORM
+SAMPLER sampler MAX_LOD 2.0
+
+PIPELINE graphics mipclear_pipeline0
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 0
+ FRAMEBUFFER_SIZE 512 512
+END
+
+PIPELINE graphics mipclear_pipeline1
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 1
+ FRAMEBUFFER_SIZE 256 256
+END
+
+PIPELINE graphics lod_pipeline
+ ATTACH vert_shader_lod
+ ATTACH frag_shader
+ BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
+ BIND BUFFER framebuffer AS color LOCATION 0
+ FRAMEBUFFER_SIZE 512 512
+END
+
+# Clear all mip levels to different color.
+CLEAR_COLOR mipclear_pipeline0 255 0 0 255
+CLEAR mipclear_pipeline0
+CLEAR_COLOR mipclear_pipeline1 0 255 0 255
+CLEAR mipclear_pipeline1
+
+CLEAR_COLOR lod_pipeline 0 0 0 255
+CLEAR lod_pipeline
+RUN lod_pipeline DRAW_RECT POS 0 0 SIZE 512 512
+
+# Check corners of the frame buffer: even vertices should have LOD 0 and odd ones LOD 1.
+EXPECT framebuffer IDX 0 511 SIZE 1 1 EQ_RGBA 255 0 0 255
+EXPECT framebuffer IDX 511 0 SIZE 1 1 EQ_RGBA 0 255 0 255
+EXPECT framebuffer IDX 511 511 SIZE 1 1 EQ_RGBA 255 0 0 255
+EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 255
--- /dev/null
+#!amber
+
+# Copyright 2019 Google LLC.
+# Copyright 2019 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
+#
+# https://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.
+
+SHADER vertex vert_shader_mipclear PASSTHROUGH
+
+SHADER vertex vert_shader_lod GLSL
+#version 430
+
+layout(location = 0) in vec3 position_in;
+layout(location = 0) out vec4 color_out;
+layout(set = 0, binding = 0) uniform highp sampler2D tex;
+
+void main() {
+ gl_Position = vec4(position_in, 1.0);
+ // Pick a color from the center of a mipmap. Each corner point gets its own mip level.
+ color_out = vec4(textureLod(tex, vec2(0.5), float(gl_VertexIndex % 4)));
+}
+END
+
+SHADER fragment frag_shader GLSL
+#version 430
+
+layout(location = 0) in vec4 color_in;
+layout(location = 0) out vec4 color_out;
+
+void main() {
+ color_out = color_in;
+}
+END
+
+BUFFER texture FORMAT B8G8R8A8_UNORM MIP_LEVELS 4
+BUFFER framebuffer FORMAT B8G8R8A8_UNORM
+SAMPLER sampler MAX_LOD 4.0
+
+PIPELINE graphics mipclear_pipeline0
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 0
+ FRAMEBUFFER_SIZE 512 512
+END
+
+PIPELINE graphics mipclear_pipeline1
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 1
+ FRAMEBUFFER_SIZE 256 256
+END
+
+PIPELINE graphics mipclear_pipeline2
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 2
+ FRAMEBUFFER_SIZE 128 128
+END
+
+PIPELINE graphics mipclear_pipeline3
+ ATTACH vert_shader_mipclear
+ ATTACH frag_shader
+ BIND BUFFER texture AS color LOCATION 0 BASE_MIP_LEVEL 3
+ FRAMEBUFFER_SIZE 64 64
+END
+
+PIPELINE graphics lod_pipeline
+ ATTACH vert_shader_lod
+ ATTACH frag_shader
+ BIND BUFFER texture AS combined_image_sampler SAMPLER sampler DESCRIPTOR_SET 0 BINDING 0
+ BIND BUFFER framebuffer AS color LOCATION 0
+ FRAMEBUFFER_SIZE 512 512
+END
+
+# Clear all mip levels to different color.
+CLEAR_COLOR mipclear_pipeline0 255 0 0 255
+CLEAR mipclear_pipeline0
+CLEAR_COLOR mipclear_pipeline1 0 255 0 255
+CLEAR mipclear_pipeline1
+CLEAR_COLOR mipclear_pipeline2 0 0 255 255
+CLEAR mipclear_pipeline2
+CLEAR_COLOR mipclear_pipeline3 255 255 0 255
+CLEAR mipclear_pipeline3
+
+CLEAR_COLOR lod_pipeline 0 0 0 255
+CLEAR lod_pipeline
+RUN lod_pipeline DRAW_RECT POS 0 0 SIZE 512 512
+
+# Check corners of the frame buffer: each should have a color from a different mip level.
+EXPECT framebuffer IDX 0 511 SIZE 1 1 EQ_RGBA 255 0 0 255
+EXPECT framebuffer IDX 511 0 SIZE 1 1 EQ_RGBA 255 255 0 255
+EXPECT framebuffer IDX 511 511 SIZE 1 1 EQ_RGBA 0 0 255 255
+EXPECT framebuffer IDX 0 0 SIZE 1 1 EQ_RGBA 0 255 0 255
include_directories(
..
../shaderexecutor
+ ../amber
)
set(DEQP_VK_TEXTURE_SRCS
vktTextureMipmapTests.hpp
vktTextureShadowTests.cpp
vktTextureShadowTests.hpp
+ vktTextureSubgroupLodTests.cpp
+ vktTextureSubgroupLodTests.hpp
vktTextureFilteringAnisotropyTests.cpp
vktTextureFilteringAnisotropyTests.hpp
vktTextureCompressedFormatTests.cpp
--- /dev/null
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2019 The Khronos Group Inc.
+ * Copyright (c) 2019 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 Subgroup LOD tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "vktTextureSubgroupLodTests.hpp"
+#include "vktAmberTestCase.hpp"
+#include "vktTestGroupUtil.hpp"
+
+using namespace vk;
+
+namespace vkt
+{
+namespace texture
+{
+namespace
+{
+
+void populateSubgroupLodTests (tcu::TestCaseGroup* group)
+{
+ tcu::TestContext& testCtx = group->getTestContext();
+ cts_amber::AmberTestCase* testCaseLod = cts_amber::createAmberTestCase(testCtx, "texturelod", "", "texture_subgroup_lod", "texture_lod.amber");
+ cts_amber::AmberTestCase* testCaseGrad = cts_amber::createAmberTestCase(testCtx, "texturegrad", "", "texture_subgroup_lod", "texture_grad.amber");
+ cts_amber::AmberTestCase* testCaseFetch = cts_amber::createAmberTestCase(testCtx, "texelfetch", "", "texture_subgroup_lod", "texel_fetch.amber");
+
+ group->addChild(testCaseLod);
+ group->addChild(testCaseGrad);
+ group->addChild(testCaseFetch);
+}
+
+} // anonymous
+
+tcu::TestCaseGroup* createTextureSubgroupLodTests (tcu::TestContext& testCtx)
+{
+ return createTestGroup(testCtx, "subgroup_lod", "Texture subgroup LOD tests.", populateSubgroupLodTests);
+}
+
+} // texture
+} // vkt
--- /dev/null
+#ifndef _VKTTEXTURESUBGROUPLODTESTS_HPP
+#define _VKTTEXTURESUBGROUPLODTESTS_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2019 The Khronos Group Inc.
+ * Copyright (c) 2019 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 Subgroup LOD tests.
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+#include "vktTestCase.hpp"
+
+namespace vkt
+{
+namespace texture
+{
+
+tcu::TestCaseGroup* createTextureSubgroupLodTests (tcu::TestContext& testCtx);
+
+} // texture
+} // vkt
+
+#endif // _VKTTEXTURESUBGROUPLODTESTS_HPP
#include "vktTextureFilteringAnisotropyTests.hpp"
#include "vktTextureCompressedFormatTests.hpp"
#include "vktTextureSwizzleTests.hpp"
+#include "vktTextureSubgroupLodTests.hpp"
namespace vkt
{
textureTests->addChild(createFilteringAnisotropyTests (testCtx));
textureTests->addChild(createTextureCompressedFormatTests (testCtx));
textureTests->addChild(createTextureSwizzleTests (testCtx));
+ textureTests->addChild(createTextureSubgroupLodTests (testCtx));
}
} // anonymous
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_yx
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_xx
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_yy
+dEQP-VK.texture.subgroup_lod.texturelod
+dEQP-VK.texture.subgroup_lod.texturegrad
+dEQP-VK.texture.subgroup_lod.texelfetch
dEQP-VK.geometry.input.basic_primitive.points
dEQP-VK.geometry.input.basic_primitive.lines
dEQP-VK.geometry.input.basic_primitive.line_strip
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_yx
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_xx
dEQP-VK.texture.swizzle.texture_coordinate.astc_12x12_srgb_block_2d_npot_sparse_yy
+dEQP-VK.texture.subgroup_lod.texturelod
+dEQP-VK.texture.subgroup_lod.texturegrad
+dEQP-VK.texture.subgroup_lod.texelfetch
dEQP-VK.geometry.input.basic_primitive.points
dEQP-VK.geometry.input.basic_primitive.lines
dEQP-VK.geometry.input.basic_primitive.line_strip