Merge gerrit/vulkan-cts-1.0.2 into gerrit/vulkan-cts-1.0-dev
authorPyry Haulos <phaulos@google.com>
Tue, 10 Jan 2017 20:18:34 +0000 (12:18 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 10 Jan 2017 20:18:34 +0000 (12:18 -0800)
Change-Id: I74387a3ed98feb4162b3d49a411cb220d0f050e9

53 files changed:
Android.mk
android/cts/master/egl-master.txt
android/cts/master/gles31-master.txt
android/cts/master/src/gles31-test-issues.txt
android/cts/master/vk-master.txt
android/cts/runner/src/com/drawelements/deqp/runner/DeqpTestRunner.java
android/scripts/common.py
android/scripts/install.py
external/vulkancts/modules/vulkan/api/CMakeLists.txt
external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp
external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.cpp [new file with mode: 0644]
external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.hpp [new file with mode: 0644]
external/vulkancts/modules/vulkan/api/vktApiTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderCase.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmComputeShaderTestUtil.hpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp
external/vulkancts/mustpass/1.0.2/vk-default.txt
framework/egl/egluCallLogWrapper.inl
framework/egl/egluCallLogWrapperApi.inl
framework/egl/egluConfigFilter.cpp
framework/egl/egluConfigFilter.hpp
framework/egl/egluConfigInfo.cpp
framework/egl/egluConfigInfo.hpp
framework/egl/egluStrUtil.inl
framework/egl/egluStrUtilPrototypes.inl
framework/egl/wrapper/eglwEnums.inl
framework/egl/wrapper/eglwFuncPtrLibraryDecl.inl
framework/egl/wrapper/eglwFuncPtrLibraryImpl.inl
framework/egl/wrapper/eglwFunctionTypes.inl
framework/egl/wrapper/eglwFunctions.inl
framework/egl/wrapper/eglwInitCore.inl
framework/egl/wrapper/eglwInitExtensions.inl
framework/egl/wrapper/eglwLibrary.inl
framework/egl/wrapper/eglwStaticLibrary14.inl
framework/egl/wrapper/eglwStaticLibrary15.inl
modules/egl/teglChooseConfigReference.cpp
modules/egl/teglGetProcAddressTests.inl
modules/egl/teglRenderCase.cpp
modules/egl/teglSimpleConfigCase.cpp
modules/gles3/performance/es3pBufferDataUploadTests.cpp
modules/gles31/functional/CMakeLists.txt
modules/gles31/functional/es31fCopyImageTests.cpp
modules/gles31/functional/es31fDebugTests.cpp
modules/gles31/functional/es31fNegativeBufferApiTests.cpp
modules/gles31/functional/es31fNegativeShaderApiTests.cpp
modules/gles31/functional/es31fNegativeShaderDirectiveTests.cpp
modules/gles31/functional/es31fNegativeShaderStorageTests.cpp [new file with mode: 0644]
modules/gles31/functional/es31fNegativeShaderStorageTests.hpp [new file with mode: 0644]
modules/gles31/functional/es31fNegativeStateApiTests.cpp
modules/gles31/functional/es31fTessellationTests.cpp
modules/glshared/glsFboCompletenessTests.cpp
scripts/egl/common.py
scripts/egl/str_util.py

index 253f085..52c027d 100644 (file)
@@ -589,6 +589,7 @@ LOCAL_SRC_FILES := \
        modules/gles31/functional/es31fNegativeShaderDirectiveTests.cpp \
        modules/gles31/functional/es31fNegativeShaderFunctionTests.cpp \
        modules/gles31/functional/es31fNegativeShaderImageLoadStoreTests.cpp \
+       modules/gles31/functional/es31fNegativeShaderStorageTests.cpp \
        modules/gles31/functional/es31fNegativeStateApiTests.cpp \
        modules/gles31/functional/es31fNegativeTestShared.cpp \
        modules/gles31/functional/es31fNegativeTextureApiTests.cpp \
index 74f28a9..60e5a14 100644 (file)
@@ -2364,11 +2364,14 @@ dEQP-EGL.functional.multithread.pbuffer_context
 dEQP-EGL.functional.multithread.single_window_context
 dEQP-EGL.functional.multithread.pbuffer_single_window_context
 dEQP-EGL.functional.get_proc_address.extension.egl_android_blob_cache
+dEQP-EGL.functional.get_proc_address.extension.egl_android_create_native_client_buffer
 dEQP-EGL.functional.get_proc_address.extension.egl_android_native_fence_sync
+dEQP-EGL.functional.get_proc_address.extension.egl_android_presentation_time
 dEQP-EGL.functional.get_proc_address.extension.egl_angle_query_surface_pointer
 dEQP-EGL.functional.get_proc_address.extension.egl_ext_device_base
 dEQP-EGL.functional.get_proc_address.extension.egl_ext_device_enumeration
 dEQP-EGL.functional.get_proc_address.extension.egl_ext_device_query
+dEQP-EGL.functional.get_proc_address.extension.egl_ext_image_dma_buf_import_modifiers
 dEQP-EGL.functional.get_proc_address.extension.egl_ext_output_base
 dEQP-EGL.functional.get_proc_address.extension.egl_ext_platform_base
 dEQP-EGL.functional.get_proc_address.extension.egl_ext_stream_consumer_egloutput
@@ -2384,6 +2387,7 @@ dEQP-EGL.functional.get_proc_address.extension.egl_khr_lock_surface3
 dEQP-EGL.functional.get_proc_address.extension.egl_khr_partial_update
 dEQP-EGL.functional.get_proc_address.extension.egl_khr_reusable_sync
 dEQP-EGL.functional.get_proc_address.extension.egl_khr_stream
+dEQP-EGL.functional.get_proc_address.extension.egl_khr_stream_attrib
 dEQP-EGL.functional.get_proc_address.extension.egl_khr_stream_consumer_gltexture
 dEQP-EGL.functional.get_proc_address.extension.egl_khr_stream_cross_process_fd
 dEQP-EGL.functional.get_proc_address.extension.egl_khr_stream_fifo
@@ -2398,6 +2402,7 @@ dEQP-EGL.functional.get_proc_address.extension.egl_nv_native_query
 dEQP-EGL.functional.get_proc_address.extension.egl_nv_post_sub_buffer
 dEQP-EGL.functional.get_proc_address.extension.egl_nv_stream_consumer_gltexture_yuv
 dEQP-EGL.functional.get_proc_address.extension.egl_nv_stream_metadata
+dEQP-EGL.functional.get_proc_address.extension.egl_nv_stream_reset
 dEQP-EGL.functional.get_proc_address.extension.egl_nv_stream_sync
 dEQP-EGL.functional.get_proc_address.extension.egl_nv_sync
 dEQP-EGL.functional.get_proc_address.extension.egl_nv_system_time
index 8204cb8..7671af2 100644 (file)
@@ -15875,7 +15875,6 @@ dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_explicit_loca
 dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_implicit_explicit_location_1
 dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_implicit_explicit_location_2
 dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_implicit_explicit_location_3
-dEQP-GLES31.functional.separate_shader.validation.varying.match_different_struct_names
 dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_struct_member_name
 dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_struct_member_type
 dEQP-GLES31.functional.separate_shader.validation.varying.mismatch_struct_member_precision
@@ -15897,7 +15896,6 @@ dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_member_name
 dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_member_precision
 dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_different_member_interpolation
 dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_member_array_size
-dEQP-GLES31.functional.separate_shader.validation.io_blocks.match_different_member_struct_names
 dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_member_struct_member_name
 dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_member_struct_member_type
 dEQP-GLES31.functional.separate_shader.validation.io_blocks.mismatch_member_struct_member_precision
@@ -16763,6 +16761,8 @@ dEQP-GLES31.functional.debug.negative_coverage.callbacks.precise.precise_as_func
 dEQP-GLES31.functional.debug.negative_coverage.callbacks.precise.precise_as_function_argument
 dEQP-GLES31.functional.debug.negative_coverage.callbacks.advanced_blend.blend_qualifier_mismatch
 dEQP-GLES31.functional.debug.negative_coverage.callbacks.advanced_blend.attachment_advanced_equation
+dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader_storage.block_number_limits
+dEQP-GLES31.functional.debug.negative_coverage.callbacks.shader_storage.max_combined_block_number_limit
 dEQP-GLES31.functional.debug.negative_coverage.log.buffer.bind_buffer
 dEQP-GLES31.functional.debug.negative_coverage.log.buffer.delete_buffers
 dEQP-GLES31.functional.debug.negative_coverage.log.buffer.gen_buffers
@@ -17209,6 +17209,8 @@ dEQP-GLES31.functional.debug.negative_coverage.log.precise.precise_as_function_n
 dEQP-GLES31.functional.debug.negative_coverage.log.precise.precise_as_function_argument
 dEQP-GLES31.functional.debug.negative_coverage.log.advanced_blend.blend_qualifier_mismatch
 dEQP-GLES31.functional.debug.negative_coverage.log.advanced_blend.attachment_advanced_equation
+dEQP-GLES31.functional.debug.negative_coverage.log.shader_storage.block_number_limits
+dEQP-GLES31.functional.debug.negative_coverage.log.shader_storage.max_combined_block_number_limit
 dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.bind_buffer
 dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.delete_buffers
 dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.gen_buffers
@@ -17653,6 +17655,8 @@ dEQP-GLES31.functional.debug.negative_coverage.get_error.precise.precise_as_func
 dEQP-GLES31.functional.debug.negative_coverage.get_error.precise.precise_as_function_argument
 dEQP-GLES31.functional.debug.negative_coverage.get_error.advanced_blend.blend_qualifier_mismatch
 dEQP-GLES31.functional.debug.negative_coverage.get_error.advanced_blend.attachment_advanced_equation
+dEQP-GLES31.functional.debug.negative_coverage.get_error.shader_storage.block_number_limits
+dEQP-GLES31.functional.debug.negative_coverage.get_error.shader_storage.max_combined_block_number_limit
 dEQP-GLES31.functional.debug.externally_generated.application_messages
 dEQP-GLES31.functional.debug.externally_generated.third_party_messages
 dEQP-GLES31.functional.debug.externally_generated.push_pop_stack
index 545ba85..f391068 100644 (file)
@@ -49,3 +49,7 @@ dEQP-GLES31.functional.shaders.builtin_functions.precision.reflect.lowp_compute.
 dEQP-GLES31.functional.shaders.builtin_functions.precision.reflect.mediump_compute.vec3
 dEQP-GLES31.functional.shaders.builtin_functions.precision.reflect.mediump_compute.vec4
 dEQP-GLES31.functional.shaders.builtin_functions.precision.reflect.highp_compute.vec3
+
+# Bug 33457655
+dEQP-GLES31.functional.separate_shader.validation.varying.match_different_struct_names
+dEQP-GLES31.functional.separate_shader.validation.io_blocks.match_different_member_struct_names
index e020cf9..1d15f53 100644 (file)
@@ -17254,6 +17254,8 @@ dEQP-VK.api.granularity.in_render_pass.s8_uint
 dEQP-VK.api.granularity.in_render_pass.d16_unorm_s8_uint
 dEQP-VK.api.granularity.in_render_pass.d24_unorm_s8_uint
 dEQP-VK.api.granularity.in_render_pass.d32_sfloat_s8_uint
+dEQP-VK.api.get_memory_commitment.memory_commitment
+dEQP-VK.api.get_memory_commitment.memory_commitment_allocate_only
 dEQP-VK.memory.allocation.basic.size_64.forward.count_1
 dEQP-VK.memory.allocation.basic.size_64.forward.count_10
 dEQP-VK.memory.allocation.basic.size_64.forward.count_100
@@ -94749,6 +94751,10 @@ dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero
 dEQP-VK.spirv_assembly.instruction.compute.opquantize.exact
 dEQP-VK.spirv_assembly.instruction.compute.opquantize.rounded
 dEQP-VK.spirv_assembly.instruction.compute.opfrem.all
+dEQP-VK.spirv_assembly.instruction.compute.opsrem.positive
+dEQP-VK.spirv_assembly.instruction.compute.opsrem.all
+dEQP-VK.spirv_assembly.instruction.compute.opsmod.positive
+dEQP-VK.spirv_assembly.instruction.compute.opsmod.all
 dEQP-VK.spirv_assembly.instruction.compute.sconvert.int16_to_int32
 dEQP-VK.spirv_assembly.instruction.compute.sconvert.int16_to_int64
 dEQP-VK.spirv_assembly.instruction.compute.sconvert.int32_to_int64
@@ -95634,6 +95640,26 @@ dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_tessc
 dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_tesse
 dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_geom
 dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_frag
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_vert
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_geom
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_frag
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_vert
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_geom
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_frag
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_vert
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_geom
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_frag
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_vert
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_geom
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_frag
 dEQP-VK.glsl.arrays.constructor.float3_vertex
 dEQP-VK.glsl.arrays.constructor.float3_fragment
 dEQP-VK.glsl.arrays.constructor.float4_vertex
index cbcec16..465d2da 100644 (file)
@@ -2116,6 +2116,7 @@ public class DeqpTestRunner implements IBuildReceiver, IDeviceTest,
         destination.mExcludeFilters = new ArrayList<>(source.mExcludeFilters);
         destination.mAbi = source.mAbi;
         destination.mLogData = source.mLogData;
+        destination.mCollectTestsOnly = source.mCollectTestsOnly;
     }
 
     /**
index 16b5276..87aad8a 100644 (file)
@@ -110,7 +110,7 @@ def execArgs (args):
        if retcode != 0:
                raise Exception("Failed to execute '%s', got %d" % (str(args), retcode))
 
-def execArgsInDirectory (args, cwd, linePrefix=""):
+def execArgsInDirectory (args, cwd, linePrefix="", failOnNonZeroExit=True):
 
        def readApplyPrefixAndPrint (source, prefix, sink):
                while True:
@@ -125,7 +125,7 @@ def execArgsInDirectory (args, cwd, linePrefix=""):
        stdoutJob.start()
        stderrJob.start()
        retcode = process.wait()
-       if retcode != 0:
+       if failOnNonZeroExit and retcode != 0:
                raise Exception("Failed to execute '%s', got %d" % (str(args), retcode))
 
 def serialApply(f, argsList):
@@ -173,7 +173,7 @@ def getDevices (adb):
        if proc.returncode != 0:
                raise Exception("adb devices -l failed, got %d" % proc.returncode)
 
-       ptrn = re.compile(r'^([a-zA-Z0-9:]+)\s+.*product:([^\s]+)\s+model:([^\s]+)\s+device:([^\s]+)')
+       ptrn = re.compile(r'^([a-zA-Z0-9\.:]+)\s+.*product:([^\s]+)\s+model:([^\s]+)\s+device:([^\s]+)')
        devices = []
        for line in stdout.splitlines()[1:]:
                if len(line.strip()) == 0:
index 6c9ff0f..5545cbb 100644 (file)
@@ -33,7 +33,7 @@ def install (buildRoot, extraArgs = [], printPrefix=""):
        common.execArgsInDirectory([common.ADB_BIN] + extraArgs + [
                        'uninstall',
                        'com.drawelements.deqp'
-               ], buildRoot, printPrefix)
+               ], buildRoot, printPrefix, failOnNonZeroExit=False)
        print printPrefix + "Remove complete\n",
 
        print printPrefix + "Installing dEQP Package from %s...\n" %(buildRoot),
index 55a55c0..4e85c1c 100644 (file)
@@ -37,6 +37,8 @@ set(DEQP_VK_API_SRCS
        vktApiNullHandleTests.hpp
        vktApiGranularityTests.cpp
        vktApiGranularityTests.hpp
+    vktApiGetMemoryCommitment.cpp
+    vktApiGetMemoryCommitment.hpp
        )
 
 set(DEQP_VK_API_LIBS
index 8e14bfa..b54a532 100644 (file)
@@ -2022,12 +2022,28 @@ tcu::TestStatus imageFormatProperties (Context& context, ImageFormatPropertyCase
                                results.check(imageType != VK_IMAGE_TYPE_3D || (properties.maxExtent.width >= 1 && properties.maxExtent.height >= 1 && properties.maxExtent.depth >= 1), "Invalid dimensions for 3D image");
                                results.check(imageType != VK_IMAGE_TYPE_3D || properties.maxArrayLayers == 1, "Invalid maxArrayLayers for 3D image");
 
-                               if (tiling == VK_IMAGE_TILING_OPTIMAL && imageType == VK_IMAGE_TYPE_2D && !(curCreateFlags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) &&
-                                        ((supportedFeatures & (VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) ||
-                                        ((supportedFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) && deviceFeatures.shaderStorageImageMultisample)))
+                               if (tiling == VK_IMAGE_TILING_OPTIMAL)
                                {
-                                       const VkSampleCountFlags        requiredSampleCounts    = getRequiredOptimalTilingSampleCounts(deviceLimits, format, curUsageFlags);
-                                       results.check((properties.sampleCounts & requiredSampleCounts) == requiredSampleCounts, "Required sample counts not supported");
+                                       // Vulkan API specification has changed since initial Android Nougat release.
+                                       // For NYC CTS we need to tolerate old behavior as well and issue compatibility
+                                       // warning instead.
+                                       //
+                                       // See spec issues 272, 282, 302, 445 and CTS issues 369, 440.
+                                       const bool      requiredByNewSpec       = (imageType == VK_IMAGE_TYPE_2D && !(curCreateFlags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) &&
+                                                                                                         ((supportedFeatures & (VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT)) ||
+                                                                                                         ((supportedFeatures & VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT) && deviceFeatures.shaderStorageImageMultisample)));
+
+                                       if (requiredByNewSpec)
+                                       {
+                                               const VkSampleCountFlags        requiredSampleCounts    = getRequiredOptimalTilingSampleCounts(deviceLimits, format, curUsageFlags);
+
+                                               results.check((properties.sampleCounts & requiredSampleCounts) == requiredSampleCounts, "Required sample counts not supported");
+                                       }
+                                       else if (properties.sampleCounts != VK_SAMPLE_COUNT_1_BIT)
+                                       {
+                                               results.addResult(QP_TEST_RESULT_COMPATIBILITY_WARNING,
+                                                                             "Implementation supports more sample counts than allowed by the spec");
+                                       }
                                }
                                else
                                        results.check(properties.sampleCounts == VK_SAMPLE_COUNT_1_BIT, "sampleCounts != VK_SAMPLE_COUNT_1_BIT");
diff --git a/external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.cpp b/external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.cpp
new file mode 100644 (file)
index 0000000..44d1a17
--- /dev/null
@@ -0,0 +1,788 @@
+/*-------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2016 The Khronos Group Inc.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * 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 Memory Commitment tests
+ *//*--------------------------------------------------------------------*/
+
+#include "vktApiGetMemoryCommitment.hpp"
+
+#include "vkDeviceUtil.cpp"
+#include "vkImageUtil.hpp"
+#include "vkMemUtil.hpp"
+#include "vkPrograms.hpp"
+#include "vktTestCase.hpp"
+#include "vkTypeUtil.cpp"
+
+using namespace vk;
+using tcu::TestLog;
+
+namespace vkt
+{
+namespace api
+{
+
+struct MemoryCommitmentCaseParams
+{
+       deUint32        bufferSize;
+       deUint32        bufferViewSize;
+       deUint32        elementOffset;
+};
+
+class MemoryCommitmentTestInstance : public vkt::TestInstance
+{
+public:
+                                                                       MemoryCommitmentTestInstance    (Context& context, MemoryCommitmentCaseParams testCase);
+       tcu::TestStatus                                 iterate                                                 (void);
+       deUint32                                                getMemoryTypeIndex                              (VkMemoryPropertyFlags propertyFlag, VkPhysicalDeviceMemoryProperties pMemoryProperties);
+       Move<VkCommandPool>                             createCommandPool                               () const;
+       Move<VkCommandBuffer>                   allocatePrimaryCommandBuffer    (VkCommandPool commandPool) const;
+       void                                                    submitCommandsAndWait                   (const DeviceInterface& vkd,
+                                                                                                                                        const VkDevice                 device,
+                                                                                                                                        const VkQueue                  queue,
+                                                                                                                                        const VkCommandBuffer& cmdBuffer);
+       bool                                                    isDeviceMemoryCommitmentOk              (const VkMemoryRequirements memoryRequirements);
+
+private:
+       const tcu::IVec2                                m_renderSize;
+};
+
+MemoryCommitmentTestInstance::MemoryCommitmentTestInstance(Context& context, MemoryCommitmentCaseParams testCase)
+       : vkt::TestInstance             (context)
+       , m_renderSize                  (testCase.bufferViewSize, testCase.bufferViewSize)
+{
+}
+
+class MemoryCommitmentTestCase : public vkt::TestCase
+{
+public:
+                                                       MemoryCommitmentTestCase        (tcu::TestContext&                              testCtx,
+                                                                                                               const std::string&                              name,
+                                                                                                               const std::string&                              description,
+                                                                                                               MemoryCommitmentCaseParams              memoryCommitmentTestInfo)
+                                                       : vkt::TestCase                                 (testCtx, name, description)
+                                                       , m_memoryCommitmentTestInfo    (memoryCommitmentTestInfo)
+                                                       {}
+       virtual                                 ~MemoryCommitmentTestCase(void){}
+       virtual void                    initPrograms    (SourceCollections&     programCollection)      const;
+       virtual TestInstance*   createInstance  (Context&                       context)                        const
+                                                       {
+                                                               return new MemoryCommitmentTestInstance(context, m_memoryCommitmentTestInfo);
+                                                       }
+private:
+       MemoryCommitmentCaseParams m_memoryCommitmentTestInfo;
+};
+
+tcu::TestStatus MemoryCommitmentTestInstance::iterate(void)
+{
+       const VkMemoryPropertyFlags                             propertyFlag                    = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
+       const VkPhysicalDevice                                  physicalDevice                  = m_context.getPhysicalDevice();
+       const InstanceInterface&                                vki                                             = m_context.getInstanceInterface();
+       const VkPhysicalDeviceMemoryProperties  pMemoryProperties               = getPhysicalDeviceMemoryProperties(vki,physicalDevice);
+       const deUint32                                                  memoryTypeIndex                 = getMemoryTypeIndex(propertyFlag, pMemoryProperties);
+       Allocator&                                                              memAlloc                                = m_context.getDefaultAllocator();
+       bool                                                                    isMemoryAllocationOK    = false;
+       const deUint32                                                  queueFamilyIndex                = m_context.getUniversalQueueFamilyIndex();
+       const VkComponentMapping                                componentMappingRGBA    = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
+       const DeviceInterface&                                  vkd                                             = m_context.getDeviceInterface();
+       const Move<VkCommandPool>                               cmdPool                                 = createCommandPool();
+       const Move<VkCommandBuffer>                             cmdBuffer                               = allocatePrimaryCommandBuffer(*cmdPool);
+       const VkDevice                                                  device                                  = m_context.getDevice();
+       Move<VkImageView>                                               colorAttachmentView;
+       Move<VkRenderPass>                                              renderPass;
+       Move<VkFramebuffer>                                             framebuffer;
+       Move<VkDescriptorSetLayout>                             descriptorSetLayout;
+       Move<VkPipelineLayout>                                  pipelineLayout;
+       Move<VkShaderModule>                                    vertexShaderModule;
+       Move<VkShaderModule>                                    fragmentShaderModule;
+       Move<VkPipeline>                                                graphicsPipelines;
+
+       if(memoryTypeIndex == -1u)
+               TCU_THROW(NotSupportedError, "Lazily allocated bit is not supported");
+
+       const VkImageCreateInfo imageParams                     =
+       {
+               VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,                    // VkStructureType              sType;
+               DE_NULL,                                                                                // const void*                  pNext;
+               0u,                                                                                             // VkImageCreateFlags   flags;
+               VK_IMAGE_TYPE_2D,                                                               // VkImageType                  imageType;
+               VK_FORMAT_R32_UINT,                                                             // VkFormat                             format;
+               {256u, 256u, 1},                                                                // VkExtent3D                   extent;
+               1u,                                                                                             // deUint32                             mipLevels;
+               1u,                                                                                             // deUint32                             arraySize;
+               VK_SAMPLE_COUNT_1_BIT,                                                  // deUint32                             samples;
+               VK_IMAGE_TILING_OPTIMAL,                                                // VkImageTiling                tiling;
+               VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
+                       VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT,        // VkImageUsageFlags    usage;
+               VK_SHARING_MODE_EXCLUSIVE,                                              // VkSharingMode                sharingMode;
+               1u,                                                                                             // deUint32                             queueFamilyCount;
+               &queueFamilyIndex,                                                              // const deUint32*              pQueueFamilyIndices;
+               VK_IMAGE_LAYOUT_UNDEFINED,                                              // VkImageLayout                initialLayout;
+       };
+
+       Move<VkImage>                           image                           = createImage(vkd, device, &imageParams);
+       const VkMemoryRequirements      memoryRequirements      = getImageMemoryRequirements(vkd, device, *image);
+       de::MovePtr<Allocation>         imageAlloc                      = memAlloc.allocate(memoryRequirements, MemoryRequirement::LazilyAllocated);
+
+       VK_CHECK(vkd.bindImageMemory(device, *image, imageAlloc->getMemory(), imageAlloc->getOffset()));
+
+       const VkImageViewCreateInfo colorAttachmentViewParams   =
+       {
+               VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,                       // VkStructureType                      sType;
+               DE_NULL,                                                                                        // const void*                          pNext;
+               0u,                                                                                                     // VkImageViewCreateFlags       flags;
+               *image,                                                                                         // VkImage                                      image;
+               VK_IMAGE_VIEW_TYPE_2D,                                                          // VkImageViewType                      viewType;
+               VK_FORMAT_R32_UINT,                                                                     // VkFormat                                     format;
+               componentMappingRGBA,                                                           // VkComponentMapping           components;
+               { VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }           // VkImageSubresourceRange      subresourceRange;
+       };
+
+       colorAttachmentView = createImageView(vkd, device, &colorAttachmentViewParams);
+
+       // Create render pass
+       {
+               const VkAttachmentDescription colorAttachmentDescription =
+               {
+                       0u,                                                                                                     // VkAttachmentDescriptionFlags         flags;
+                       VK_FORMAT_R32_UINT,                                                                     // VkFormat                                                     format;
+                       VK_SAMPLE_COUNT_1_BIT,                                                          // VkSampleCountFlagBits                        samples;
+                       VK_ATTACHMENT_LOAD_OP_CLEAR,                                            // VkAttachmentLoadOp                           loadOp;
+                       VK_ATTACHMENT_STORE_OP_STORE,                                           // VkAttachmentStoreOp                          storeOp;
+                       VK_ATTACHMENT_LOAD_OP_DONT_CARE,                                        // VkAttachmentLoadOp                           stencilLoadOp;
+                       VK_ATTACHMENT_STORE_OP_DONT_CARE,                                       // VkAttachmentStoreOp                          stencilStoreOp;
+                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,                       // VkImageLayout                                        initialLayout;
+                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout                                        finalLayout;
+               };
+
+               const VkAttachmentReference colorAttachmentReference =
+               {
+                       0u,                                                                                                     // deUint32                     attachment;
+                       VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL                        // VkImageLayout        layout;
+               };
+
+               const VkSubpassDescription subpassDescription =
+               {
+                       0u,                                                                                                     // VkSubpassDescriptionFlags    flags;
+                       VK_PIPELINE_BIND_POINT_GRAPHICS,                                        // VkPipelineBindPoint                  pipelineBindPoint;
+                       0u,                                                                                                     // deUint32                                             inputAttachmentCount;
+                       DE_NULL,                                                                                        // const VkAttachmentReference* pInputAttachments;
+                       1u,                                                                                                     // deUint32                                             colorAttachmentCount;
+                       &colorAttachmentReference,                                                      // const VkAttachmentReference* pColorAttachments;
+                       DE_NULL,                                                                                        // const VkAttachmentReference* pResolveAttachments;
+                       DE_NULL,                                                                                        // const VkAttachmentReference* pDepthStencilAttachment;
+                       0u,                                                                                                     // deUint32                                             preserveAttachmentCount;
+                       DE_NULL                                                                                         // const VkAttachmentReference* pPreserveAttachments;
+               };
+
+               const VkRenderPassCreateInfo renderPassParams =
+               {
+                       VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,                      // VkStructureType                                      sType;
+                       DE_NULL,                                                                                        // const void*                                          pNext;
+                       0u,                                                                                                     // VkRenderPassCreateFlags                      flags;
+                       1u,                                                                                                     // deUint32                                                     attachmentCount;
+                       &colorAttachmentDescription,                                            // const VkAttachmentDescription*       pAttachments;
+                       1u,                                                                                                     // deUint32                                                     subpassCount;
+                       &subpassDescription,                                                            // const VkSubpassDescription*          pSubpasses;
+                       0u,                                                                                                     // deUint32                                                     dependencyCount;
+                       DE_NULL                                                                                         // const VkSubpassDependency*           pDependencies;
+               };
+
+               renderPass = createRenderPass(vkd, device, &renderPassParams);
+       }
+
+       // Create framebuffer
+       {
+               const VkImageView attachmentBindInfos[1] =
+               {
+                       *colorAttachmentView,
+               };
+
+               const VkFramebufferCreateInfo framebufferParams =
+               {
+                       VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,                      // VkStructureType                              sType;
+                       DE_NULL,                                                                                        // const void*                                  pNext;
+                       (VkFramebufferCreateFlags)0,
+                       *renderPass,                                                                            // VkRenderPass                                 renderPass;
+                       1u,                                                                                                     // deUint32                                             attachmentCount;
+                       attachmentBindInfos,                                                            // const VkImageView*                   pAttachments;
+                       (deUint32)m_renderSize.x(),                                                     // deUint32                                             width;
+                       (deUint32)m_renderSize.y(),                                                     // deUint32                                             height;
+                       1u                                                                                                      // deUint32                                             layers;
+               };
+
+               framebuffer = createFramebuffer(vkd, device, &framebufferParams);
+       }
+
+       // Create descriptors
+       {
+               const VkDescriptorSetLayoutBinding layoutBindings[1] =
+               {
+                       {
+                               0u,                                                                                     // deUint32                             binding;
+                               VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER,        // VkDescriptorType             descriptorType;
+                               1u,                                                                                     // deUint32                             arraySize;
+                               VK_SHADER_STAGE_ALL,                                            // VkShaderStageFlags   stageFlags;
+                               DE_NULL                                                                         // const VkSampler*             pImmutableSamplers;
+                       },
+               };
+
+               const VkDescriptorSetLayoutCreateInfo descriptorLayoutParams =
+               {
+                       VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,    // VkStructureType                                              sType;
+                       DE_NULL,                                                                                                // cost void*                                                   pNexŧ;
+                       (VkDescriptorSetLayoutCreateFlags)0,
+                       DE_LENGTH_OF_ARRAY(layoutBindings),                                             // deUint32                                                             count;
+                       layoutBindings                                                                                  // const VkDescriptorSetLayoutBinding   pBinding;
+               };
+
+               descriptorSetLayout = createDescriptorSetLayout(vkd, device, &descriptorLayoutParams);
+       }
+
+       // Create pipeline layout
+       {
+               const VkPipelineLayoutCreateInfo pipelineLayoutParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,          // VkStructureType                              sType;
+                       DE_NULL,                                                                                        // const void*                                  pNext;
+                       (VkPipelineLayoutCreateFlags)0,
+                       1u,                                                                                                     // deUint32                                             descriptorSetCount;
+                       &*descriptorSetLayout,                                                          // const VkDescriptorSetLayout* pSetLayouts;
+                       0u,                                                                                                     // deUint32                                             pushConstantRangeCount;
+                       DE_NULL                                                                                         // const VkPushConstantRange*   pPushConstantRanges;
+               };
+
+               pipelineLayout = createPipelineLayout(vkd, device, &pipelineLayoutParams);
+       }
+
+       // Create shaders
+       {
+               vertexShaderModule      = createShaderModule(vkd, device, m_context.getBinaryCollection().get("vert"), 0);
+               fragmentShaderModule    = createShaderModule(vkd, device, m_context.getBinaryCollection().get("frag"), 0);
+       }
+
+       // Create pipeline
+       {
+               const VkPipelineShaderStageCreateInfo shaderStageParams[2] =
+               {
+                       {
+                               VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,            // VkStructureType                              sType;
+                               DE_NULL,                                                                                                        // const void*                                  pNext;
+                               (VkPipelineShaderStageCreateFlags)0,
+                               VK_SHADER_STAGE_VERTEX_BIT,                                                                     // VkShaderStage                                stage;
+                               *vertexShaderModule,                                                                            // VkShader                                             shader;
+                               "main",
+                               DE_NULL                                                                                                         // const VkSpecializationInfo*  pSpecializationInfo;
+                       },
+                       {
+                               VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,            // VkStructureType                              sType;
+                               DE_NULL,                                                                                                        // const void*                                  pNext;
+                               (VkPipelineShaderStageCreateFlags)0,
+                               VK_SHADER_STAGE_FRAGMENT_BIT,                                                           // VkShaderStage                                stage;
+                               *fragmentShaderModule,                                                                  // VkShader                                             shader;
+                               "main",
+                               DE_NULL                                                                                                         // const VkSpecializationInfo*  pSpecializationInfo;
+                       }
+               };
+
+               const VkVertexInputBindingDescription vertexInputBindingDescription =
+               {
+                       0u,                                                             // deUint32                                     binding;
+                       sizeof(tcu::Vec4),                              // deUint32                                     strideInBytes;
+                       VK_VERTEX_INPUT_RATE_VERTEX             // VkVertexInputStepRate        stepRate;
+               };
+
+               const VkVertexInputAttributeDescription vertexInputAttributeDescriptions[1] =
+               {
+                       {
+                               0u,                                                                     // deUint32     location;
+                               0u,                                                                     // deUint32     binding;
+                               VK_FORMAT_R32G32B32A32_SFLOAT,          // VkFormat     format;
+                               0u                                                                      // deUint32     offsetInBytes;
+                       }
+               };
+
+               const VkPipelineVertexInputStateCreateInfo vertexInputStateParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO,              // VkStructureType                                                      sType;
+                       DE_NULL,                                                                                                                // const void*                                                          pNext;
+                       (VkPipelineVertexInputStateCreateFlags)0,
+                       1u,                                                                                                                             // deUint32                                                                     bindingCount;
+                       &vertexInputBindingDescription,                                                                 // const VkVertexInputBindingDescription*       pVertexBindingDescriptions;
+                       1u,                                                                                                                             // deUint32                                                                     attributeCount;
+                       vertexInputAttributeDescriptions                                                                // const VkVertexInputAttributeDescription*     pVertexAttributeDescriptions;
+               };
+
+               const VkPipelineInputAssemblyStateCreateInfo inputAssemblyStateParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,    // VkStructureType              sType;
+                       DE_NULL,                                                                                                                // const void*                  pNext;
+                       (VkPipelineInputAssemblyStateCreateFlags)0,
+                       VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,                                                    // VkPrimitiveTopology  topology;
+                       false                                                                                                                   // VkBool32                             primitiveRestartEnable;
+               };
+
+               const VkViewport viewport =
+               {
+                       0.0f,                                           // float        originX;
+                       0.0f,                                           // float        originY;
+                       (float)m_renderSize.x(),        // float        width;
+                       (float)m_renderSize.y(),        // float        height;
+                       0.0f,                                           // float        minDepth;
+                       1.0f                                            // float        maxDepth;
+               };
+
+               const VkRect2D scissor =
+               {
+                       { 0, 0 },                                                                                                       // VkOffset2D  offset;
+                       { (deUint32)m_renderSize.x(), (deUint32)m_renderSize.y() }      // VkExtent2D  extent;
+               };
+
+               const VkPipelineViewportStateCreateInfo viewportStateParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,                  // VkStructureType              sType;
+                       DE_NULL,                                                                                                                // const void*                  pNext;
+                       (VkPipelineViewportStateCreateFlags)0,
+                       1u,                                                                                                                             // deUint32                             viewportCount;
+                       &viewport,                                                                                                              // const VkViewport*    pViewports;
+                       1u,                                                                                                                             // deUint32                             scissorCount;
+                       &scissor                                                                                                                // const VkRect2D*              pScissors;
+               };
+
+               const VkPipelineRasterizationStateCreateInfo rasterStateParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,             // VkStructureType      sType;
+                       DE_NULL,                                                                                                                // const void*          pNext;
+                       (VkPipelineRasterizationStateCreateFlags)0,
+                       false,                                                                                                                  // VkBool32                     depthClipEnable;
+                       false,                                                                                                                  // VkBool32                     rasterizerDiscardEnable;
+                       VK_POLYGON_MODE_FILL,                                                                                   // VkFillMode           fillMode;
+                       VK_CULL_MODE_NONE,                                                                                              // VkCullMode           cullMode;
+                       VK_FRONT_FACE_COUNTER_CLOCKWISE,                                                                // VkFrontFace          frontFace;
+                       VK_FALSE,                                                                                                               // VkBool32                     depthBiasEnable;
+                       0.0f,                                                                                                                   // float                        depthBias;
+                       0.0f,                                                                                                                   // float                        depthBiasClamp;
+                       0.0f,                                                                                                                   // float                        slopeScaledDepthBias;
+                       1.0f,                                                                                                                   // float                        lineWidth;
+               };
+
+               const VkPipelineMultisampleStateCreateInfo              multisampleStateParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,               // VkStructureType                                                      sType;
+                       DE_NULL,                                                                                                                // const void*                                                          pNext;
+                       0u,                                                                                                                             // VkPipelineMultisampleStateCreateFlags        flags;
+                       VK_SAMPLE_COUNT_1_BIT,                                                                                  // VkSampleCountFlagBits                                        rasterizationSamples;
+                       VK_FALSE,                                                                                                               // VkBool32                                                                     sampleShadingEnable;
+                       0.0f,                                                                                                                   // float                                                                        minSampleShading;
+                       DE_NULL,                                                                                                                // const VkSampleMask*                                          pSampleMask;
+                       VK_FALSE,                                                                                                               // VkBool32                                                                     alphaToCoverageEnable;
+                       VK_FALSE                                                                                                                // VkBool32                                                                     alphaToOneEnable;
+               };
+
+               const VkPipelineColorBlendAttachmentState colorBlendAttachmentState =
+               {
+                       false,                                                                                                          // VkBool32                     blendEnable;
+                       VK_BLEND_FACTOR_ONE,                                                                            // VkBlend                      srcBlendColor;
+                       VK_BLEND_FACTOR_ZERO,                                                                           // VkBlend                      destBlendColor;
+                       VK_BLEND_OP_ADD,                                                                                        // VkBlendOp            blendOpColor;
+                       VK_BLEND_FACTOR_ONE,                                                                            // VkBlend                      srcBlendAlpha;
+                       VK_BLEND_FACTOR_ZERO,                                                                           // VkBlend                      destBlendAlpha;
+                       VK_BLEND_OP_ADD,                                                                                        // VkBlendOp            blendOpAlpha;
+                       (VK_COLOR_COMPONENT_R_BIT |
+                        VK_COLOR_COMPONENT_G_BIT |
+                        VK_COLOR_COMPONENT_B_BIT |
+                        VK_COLOR_COMPONENT_A_BIT)                                                                      // VkChannelFlags       channelWriteMask;
+               };
+
+               const VkPipelineColorBlendStateCreateInfo colorBlendStateParams =
+               {
+                       VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,       // VkStructureType                                                              sType;
+                       DE_NULL,                                                                                                        // const void*                                                                  pNext;
+                       (VkPipelineColorBlendStateCreateFlags)0,
+                       false,                                                                                                          // VkBool32                                                                             logicOpEnable;
+                       VK_LOGIC_OP_COPY,                                                                                       // VkLogicOp                                                                    logicOp;
+                       1u,                                                                                                                     // deUint32                                                                             attachmentCount;
+                       &colorBlendAttachmentState,                                                                     // const VkPipelineColorBlendAttachmentState*   pAttachments;
+                       { 0.0f, 0.0f, 0.0f, 0.0f },                                                                     // float                                                                                blendConst[4];
+               };
+
+               const VkGraphicsPipelineCreateInfo graphicsPipelineParams =
+               {
+                       VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,        // VkStructureType                                                                      sType;
+                       DE_NULL,                                                                                        // const void*                                                                          pNext;
+                       0u,                                                                                                     // VkPipelineCreateFlags                                                        flags;
+                       2u,                                                                                                     // deUint32                                                                                     stageCount;
+                       shaderStageParams,                                                                      // const VkPipelineShaderStageCreateInfo*                       pStages;
+                       &vertexInputStateParams,                                                        // const VkPipelineVertexInputStateCreateInfo*          pVertexInputState;
+                       &inputAssemblyStateParams,                                                      // const VkPipelineInputAssemblyStateCreateInfo*        pInputAssemblyState;
+                       DE_NULL,                                                                                        // const VkPipelineTessellationStateCreateInfo*         pTessellationState;
+                       &viewportStateParams,                                                           // const VkPipelineViewportStateCreateInfo*                     pViewportState;
+                       &rasterStateParams,                                                                     // const VkPipelineRasterStateCreateInfo*                       pRasterState;
+                       &multisampleStateParams,                                                        // const VkPipelineMultisampleStateCreateInfo*          pMultisampleState;
+                       DE_NULL,                                                                                        // const VkPipelineDepthStencilStateCreateInfo*         pDepthStencilState;
+                       &colorBlendStateParams,                                                         // const VkPipelineColorBlendStateCreateInfo*           pColorBlendState;
+                       DE_NULL,                                                                                        // const VkPipelineDynamicStateCreateInfo*                      pDynamicState;
+                       *pipelineLayout,                                                                        // VkPipelineLayout                                                                     layout;
+                       *renderPass,                                                                            // VkRenderPass                                                                         renderPass;
+                       0u,                                                                                                     // deUint32                                                                                     subpass;
+                       0u,                                                                                                     // VkPipeline                                                                           basePipelineHandle;
+                       0u                                                                                                      // deInt32                                                                                      basePipelineIndex;
+               };
+
+               graphicsPipelines               = createGraphicsPipeline(vkd, device, DE_NULL, &graphicsPipelineParams);
+       }
+
+       // getMemoryCommitment
+       isMemoryAllocationOK = isDeviceMemoryCommitmentOk(memoryRequirements);
+
+       const deUint32                  clearColor[4]   = { 1u, 1u, 1u, 1u };
+       const VkClearAttachment clearAttachment =
+       {
+               VK_IMAGE_ASPECT_COLOR_BIT,                                                                      // VkImageAspectFlags   aspectMask;
+               0u,                                                                                                                     // deUint32                             colorAttachment;
+               makeClearValueColorU32(clearColor[0],
+                                                          clearColor[1],
+                                                          clearColor[2],
+                                                          clearColor[3])                                               // VkClearValue                 clearValue;
+       };
+
+       const VkOffset2D offset =
+       {
+               0,
+               0
+       };
+
+       const VkExtent2D extent =
+       {
+               256u,
+               256u
+       };
+
+       const VkRect2D rect =
+       {
+               offset,
+               extent
+       };
+
+       const VkClearRect clearRect =
+       {
+               rect,
+               1u, // baseArrayLayer
+               1u      // layerCount
+       };
+
+       const VkCommandBufferBeginInfo  commandBufferBeginInfo  =
+       {
+               VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,                    // VkStructureType                                      sType;
+               DE_NULL,                                                                                                // const void*                                          pNext;
+               VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,                    // VkCommandBufferUsageFlags            flags;
+               (const VkCommandBufferInheritanceInfo*)DE_NULL,
+       };
+
+       // beginCommandBuffer
+       VK_CHECK(vkd.beginCommandBuffer(*cmdBuffer, &commandBufferBeginInfo));
+
+       const VkExtent3D                extent3D =
+       {
+               256u,   // width
+               256u,   // height
+               1u              // depth
+       };
+
+       const VkClearValue clearValues[1] =
+       {
+               makeClearValueColorF32(0.0f, 0.0f, 1.0f, 1.0f),
+       };
+
+       const VkRenderPassBeginInfo renderPassBeginInfo =
+       {
+               VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,                               // VkStructureType              sType;
+               DE_NULL,                                                                                                // const void*                  pNext;
+               *renderPass,                                                                                    // VkRenderPass                 renderPass;
+               *framebuffer,                                                                                   // VkFramebuffer                framebuffer;
+               {
+                       { 0, 0 },
+                       { extent3D.width, extent3D.height }
+               },                                                                                                              // VkRect2D                             renderArea;
+               1u,                                                                                                             // deUint32                             clearValueCount;
+               clearValues                                                                                             // const VkClearValue*  pClearValues;
+       };
+
+       const VkImageMemoryBarrier initialImageBarrier =
+       {
+               VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,         // VkStructureType                      sType;
+               DE_NULL,                                                                        // const void*                          pNext;
+               0,                                                                                      // VkMemoryOutputFlags          outputMask;
+               VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,           // VkMemoryInputFlags           inputMask;
+               VK_IMAGE_LAYOUT_UNDEFINED,                                      // VkImageLayout                        oldLayout;
+               VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,       // VkImageLayout                        newLayout;
+               VK_QUEUE_FAMILY_IGNORED,                                        // deUint32                                     srcQueueFamilyIndex;
+               VK_QUEUE_FAMILY_IGNORED,                                        // deUint32                                     destQueueFamilyIndex;
+               image.get(),                                                            // VkImage                                      image;
+               {                                                                                       // VkImageSubresourceRange      subresourceRange;
+                       VK_IMAGE_ASPECT_COLOR_BIT,                              // VkImageAspectFlags   aspectMask;
+                       0u,                                                                             // deUint32                             baseMipLevel;
+                       1u,                                                                             // deUint32                             mipLevels;
+                       0u,                                                                             // deUint32                             baseArraySlice;
+                       1u                                                                              // deUint32                             arraySize;
+               }
+       };
+
+       vkd.cmdPipelineBarrier(*cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, (VkDependencyFlags)0, 0, (const VkMemoryBarrier*)DE_NULL, 0, (const VkBufferMemoryBarrier*)DE_NULL, 1, &initialImageBarrier);
+       vkd.cmdBeginRenderPass(*cmdBuffer, &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
+       vkd.cmdBindPipeline(*cmdBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipelines);
+       // clearAttachments
+       vkd.cmdClearAttachments(*cmdBuffer, 1, &clearAttachment, 1u, &clearRect);
+       vkd.cmdEndRenderPass(*cmdBuffer);
+       vkd.endCommandBuffer(*cmdBuffer);
+
+       // queueSubmit
+       const VkQueue   queue   = m_context.getUniversalQueue();
+       submitCommandsAndWait(vkd, device, queue, *cmdBuffer);
+
+       // getMemoryCommitment
+       isMemoryAllocationOK = (isMemoryAllocationOK && isDeviceMemoryCommitmentOk(memoryRequirements)) ? true : false;
+
+       if (isMemoryAllocationOK)
+               return tcu::TestStatus::pass("Pass");
+
+       return tcu::TestStatus::fail("Fail");
+}
+
+class MemoryCommitmentAllocateOnlyTestInstance : public vkt::TestInstance
+{
+public:
+                                                                       MemoryCommitmentAllocateOnlyTestInstance        (Context& context);
+       tcu::TestStatus                                 iterate                                                                         (void);
+};
+
+class MemoryCommitmentAllocateOnlyTestCase : public vkt::TestCase
+{
+public:
+                                                       MemoryCommitmentAllocateOnlyTestCase    (tcu::TestContext&                              testCtx,
+                                                                                                                                       const std::string&                              name,
+                                                                                                                                       const std::string&                              description)
+                                                       : vkt::TestCase                                                 (testCtx, name, description)
+                                                       {}
+       virtual                                 ~MemoryCommitmentAllocateOnlyTestCase(void){}
+       virtual TestInstance*   createInstance  (Context&                       context)                        const
+                                                       {
+                                                               return new MemoryCommitmentAllocateOnlyTestInstance(context);
+                                                       }
+};
+
+MemoryCommitmentAllocateOnlyTestInstance::MemoryCommitmentAllocateOnlyTestInstance(Context& context)
+       : vkt::TestInstance             (context)
+{
+}
+
+tcu::TestStatus MemoryCommitmentAllocateOnlyTestInstance::iterate(void)
+{
+       const VkPhysicalDevice                                  physicalDevice                  = m_context.getPhysicalDevice();
+       const VkDevice                                                  device                                  = m_context.getDevice();
+       const InstanceInterface&                                vki                                             = m_context.getInstanceInterface();
+       const DeviceInterface&                                  vkd                                             = m_context.getDeviceInterface();
+       const VkPhysicalDeviceMemoryProperties  pMemoryProperties               = getPhysicalDeviceMemoryProperties(vki,physicalDevice);
+       const VkMemoryPropertyFlags                             propertyFlag                    = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
+       const int                                                               arrayLength                             = 10;
+       VkDeviceSize                                                    pCommittedMemoryInBytes = 0u;
+       VkDeviceSize                                                    allocSize[arrayLength];
+
+       // generating random allocation sizes
+       for (int i = 0; i < arrayLength; ++i)
+       {
+               allocSize[i] = rand() % 1000 + 1;
+       }
+
+       for (deUint32 memoryTypeIndex = 0u; memoryTypeIndex < VK_MAX_MEMORY_TYPES; ++memoryTypeIndex) //for memoryTypes
+       {
+               if((pMemoryProperties.memoryTypes[memoryTypeIndex].propertyFlags & propertyFlag) == propertyFlag) //if supports Lazy allocation
+               {
+                       for (int i = 0; i < arrayLength; ++i)
+                       {
+                               const VkMemoryAllocateInfo      memAllocInfo =
+                               {
+                                       VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, //      VkStructureType         sType
+                                       NULL,                                                                   //      const void*                     pNext
+                                       allocSize[i],                                                   //      VkDeviceSize            allocationSize
+                                       memoryTypeIndex                                                 //      deUint32                        memoryTypeIndex
+                               };
+
+                               Move<VkDeviceMemory> memory = allocateMemory(vkd, device, &memAllocInfo, (const VkAllocationCallbacks*)DE_NULL);
+
+                               vkd.getDeviceMemoryCommitment(device, memory.get(), &pCommittedMemoryInBytes);
+                               if(pCommittedMemoryInBytes != 0)
+                               {
+                                       tcu::TestLog& log = m_context.getTestContext().getLog();
+                                       log << TestLog::Message << "Warning: Memory commitment not null before binding." << TestLog::EndMessage;
+                               }
+                               if(pCommittedMemoryInBytes > allocSize[i])
+                                       return tcu::TestStatus::fail("Fail");
+
+                       }
+               }
+       }
+       return tcu::TestStatus::pass("Pass");
+}
+
+void MemoryCommitmentTestInstance::submitCommandsAndWait (const DeviceInterface& vkd, const VkDevice device, const VkQueue queue, const VkCommandBuffer& cmdBuffer)
+{
+       const VkFenceCreateInfo fenceParams =
+       {
+               VK_STRUCTURE_TYPE_FENCE_CREATE_INFO,    // VkStructureType              sType;
+               DE_NULL,                                                                // const void*                  pNext;
+               0u                                                                              // VkFenceCreateFlags   flags;
+       };
+
+       Move<VkFence> fence = createFence(vkd, device, &fenceParams);
+
+       const VkSubmitInfo      submitInfo      =
+       {
+               VK_STRUCTURE_TYPE_SUBMIT_INFO,                  // VkStructureType                      sType;
+               DE_NULL,                                                                // const void*                          pNext;
+               0u,                                                                             // deUint32                                     waitSemaphoreCount;
+               DE_NULL,                                                                // const VkSemaphore*           pWaitSemaphores;
+               (const VkPipelineStageFlags*)DE_NULL,
+               1u,                                                                             // deUint32                                     commandBufferCount;
+               &cmdBuffer,                                                             // const VkCommandBuffer*       pCommandBuffers;
+               0u,                                                                             // deUint32                                     signalSemaphoreCount;
+               DE_NULL                                                                 // const VkSemaphore*           pSignalSemaphores;
+       };
+
+       VK_CHECK(vkd.queueSubmit(queue, 1, &submitInfo, *fence));
+       VK_CHECK(vkd.waitForFences(device, 1, &fence.get(), true, ~(0ull) /* infinity */));
+}
+
+deUint32 MemoryCommitmentTestInstance::getMemoryTypeIndex(VkMemoryPropertyFlags propertyFlag, VkPhysicalDeviceMemoryProperties pMemoryProperties)
+{
+       for (deUint32 memoryTypeIndex = 0u; memoryTypeIndex < VK_MAX_MEMORY_TYPES; ++memoryTypeIndex)
+       {
+               if((pMemoryProperties.memoryTypes[memoryTypeIndex].propertyFlags & propertyFlag) == propertyFlag)
+                       return memoryTypeIndex;
+       }
+       return -1u;
+}
+
+void MemoryCommitmentTestCase::initPrograms (SourceCollections& programCollection) const
+{
+       programCollection.glslSources.add("vert") << glu::VertexSource(
+               "#version 310 es\n"
+               "layout (location = 0) in highp vec4 a_position;\n"
+               "void main()\n"
+               "{\n"
+               "       gl_Position = a_position;\n"
+               "}\n");
+
+       programCollection.glslSources.add("frag") << glu::FragmentSource(
+               "#version 310 es\n"
+               "#extension GL_EXT_texture_buffer : enable\n"
+               "layout (set=0, binding=0) uniform highp usamplerBuffer u_buffer;\n"
+               "layout (location = 0) out highp uint o_color;\n"
+               "void main()\n"
+               "{\n"
+               "       o_color = texelFetch(u_buffer, int(gl_FragCoord.x)).x;\n"
+               "}\n");
+}
+
+Move<VkCommandPool> MemoryCommitmentTestInstance::createCommandPool() const
+{
+       const VkDevice                                  device                          = m_context.getDevice();
+       const DeviceInterface&                  vkd                                     = m_context.getDeviceInterface();
+       const deUint32                                  queueFamilyIndex        = m_context.getUniversalQueueFamilyIndex();
+       const VkCommandPoolCreateInfo   cmdPoolCreateInfo       =
+       {
+               VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,             // VkStructureType             sType;
+               DE_NULL,                                                                                // const void*                 pNext;
+               VK_COMMAND_POOL_CREATE_TRANSIENT_BIT,                   // VkCommandPoolCreateFlags    flags;
+               queueFamilyIndex                                                                // deUint32                    queueFamilyIndex;
+       };
+
+       return vk::createCommandPool(vkd, device, &cmdPoolCreateInfo, DE_NULL);
+}
+
+Move<VkCommandBuffer> MemoryCommitmentTestInstance::allocatePrimaryCommandBuffer (VkCommandPool commandPool) const
+{
+       const VkDevice                                          device                                  = m_context.getDevice();
+       const DeviceInterface&                          vkd                                             = m_context.getDeviceInterface();
+       const VkCommandBufferAllocateInfo       cmdBufferAllocateInfo   =
+       {
+               VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO, // VkStructureType             sType;
+               DE_NULL,                                                                                // const void*                 pNext;
+               commandPool,                                                                    // VkCommandPool               commandPool;
+               VK_COMMAND_BUFFER_LEVEL_PRIMARY,                                // VkCommandBufferLevel        level;
+               1                                                                                               // deUint32                    commandBufferCount;
+       };
+
+       return vk::allocateCommandBuffer(vkd, device, &cmdBufferAllocateInfo);
+}
+
+bool MemoryCommitmentTestInstance::isDeviceMemoryCommitmentOk(const VkMemoryRequirements memoryRequirements)
+{
+       const VkFormat                                                  colorFormat                     = VK_FORMAT_R32_UINT;
+       const VkPhysicalDevice                                  physicalDevice          = m_context.getPhysicalDevice();
+       const InstanceInterface&                                vki                                     = m_context.getInstanceInterface();
+       const VkMemoryPropertyFlags                             propertyFlag            = VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT;
+       const VkPhysicalDeviceMemoryProperties  pMemoryProperties       = getPhysicalDeviceMemoryProperties(vki,physicalDevice);
+       const VkDeviceSize                                              pixelDataSize           = m_renderSize.x() * m_renderSize.y() * mapVkFormat(colorFormat).getPixelSize();
+
+       for (deUint32 memTypeNdx = 0u; memTypeNdx < VK_MAX_MEMORY_TYPES; ++memTypeNdx)
+       {
+               if((pMemoryProperties.memoryTypes[memTypeNdx].propertyFlags & propertyFlag) == propertyFlag) //if supports Lazy allocation
+               {
+                       const VkMemoryAllocateInfo      memAllocInfo =
+                       {
+                               VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,         //      VkStructureType         sType
+                               NULL,                                                                           //      const void*                     pNext
+                               pixelDataSize,                                                          //      VkDeviceSize            allocationSize
+                               memTypeNdx                                                                      //      deUint32                        memoryTypeIndex
+                       };
+                       const VkDevice                  device                                  = m_context.getDevice();
+                       const DeviceInterface&  vkd                                             = m_context.getDeviceInterface();
+                       Move<VkDeviceMemory>    memory                                  = allocateMemory(vkd, device, &memAllocInfo, (const VkAllocationCallbacks*)DE_NULL);
+                       VkDeviceSize                    pCommittedMemoryInBytes = 0u;
+                       vkd.getDeviceMemoryCommitment(device, memory.get(), &pCommittedMemoryInBytes);
+                       if(pCommittedMemoryInBytes <= memoryRequirements.size)
+                               return true;
+               }
+       }
+       return false;
+}
+
+tcu::TestCaseGroup* createMemoryCommitmentTests (tcu::TestContext& testCtx)
+{
+       static const MemoryCommitmentCaseParams info =
+       {
+               2048u,  // deUint32     bufferSize
+               256u,   // deUint32     bufferViewSize
+               0u,             // deUint32     elementOffset
+       };
+
+       de::MovePtr<tcu::TestCaseGroup> getMemoryCommitmentTests        (new tcu::TestCaseGroup(testCtx, "get_memory_commitment", "Memory Commitment Tests"));
+
+       {
+               getMemoryCommitmentTests->addChild(new MemoryCommitmentTestCase(testCtx, "memory_commitment", "memory_commitment_test", info));
+               getMemoryCommitmentTests->addChild(new MemoryCommitmentAllocateOnlyTestCase(testCtx, "memory_commitment_allocate_only", "memory_commitment_allocate_only_test"));
+       }
+
+       return getMemoryCommitmentTests.release();
+}
+
+} //api
+} //vkt
diff --git a/external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.hpp b/external/vulkancts/modules/vulkan/api/vktApiGetMemoryCommitment.hpp
new file mode 100644 (file)
index 0000000..5c2d69a
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef _VKTAPIGETMEMORYCOMMITMENT_HPP
+#define _VKTAPIGETMEMORYCOMMITMENT_HPP
+/*------------------------------------------------------------------------
+ * Vulkan Conformance Tests
+ * ------------------------
+ *
+ * Copyright (c) 2016 The Khronos Group Inc.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ *
+ * 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 Vulkan Memory Commitment Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "tcuTestCase.hpp"
+
+namespace vkt
+{
+
+namespace api
+{
+
+tcu::TestCaseGroup*            createMemoryCommitmentTests     (tcu::TestContext& testCtx);
+
+} // api
+} // vkt
+
+#endif // _VKTAPIGETMEMORYCOMMITMENT_HPP
index d1df659..dd9e47e 100644 (file)
@@ -38,6 +38,7 @@
 #include "vktApiDescriptorPoolTests.hpp"
 #include "vktApiNullHandleTests.hpp"
 #include "vktApiGranularityTests.hpp"
+#include "vktApiGetMemoryCommitment.hpp"
 
 namespace vkt
 {
@@ -72,6 +73,7 @@ void createApiTests (tcu::TestCaseGroup* apiTests)
        apiTests->addChild(createDescriptorPoolTests            (testCtx));
        apiTests->addChild(createNullHandleTests                        (testCtx));
        apiTests->addChild(createGranularityQueryTests          (testCtx));
+       apiTests->addChild(createMemoryCommitmentTests          (testCtx));
 }
 
 } // anonymous
index 8a560ad..b2247ca 100644 (file)
@@ -404,7 +404,7 @@ tcu::TestStatus SpvAsmComputeShaderInstance::iterate (void)
        if (m_shaderSpec.verifyIO)
        {
                if (!(*m_shaderSpec.verifyIO)(m_shaderSpec.inputs, outputAllocs, m_shaderSpec.outputs, m_context.getTestContext().getLog()))
-                       return tcu::TestStatus::fail("Output doesn't match with expected");
+                       return tcu::TestStatus(m_shaderSpec.failResult, m_shaderSpec.failMessage);
        }
        else
        {
@@ -412,11 +412,11 @@ tcu::TestStatus SpvAsmComputeShaderInstance::iterate (void)
                {
                        const BufferSp& expectedOutput = m_shaderSpec.outputs[outputNdx];
                        if (deMemCmp(expectedOutput->data(), outputAllocs[outputNdx]->getHostPtr(), expectedOutput->getNumBytes()))
-                               return tcu::TestStatus::fail("Output doesn't match with expected");
+                               return tcu::TestStatus(m_shaderSpec.failResult, m_shaderSpec.failMessage);
                }
        }
 
-       return tcu::TestStatus::pass("Ouput match with expected");
+       return tcu::TestStatus::pass("Output match with expected");
 }
 
 class ConvertTestInstance : public SpvAsmComputeShaderInstance
index 4c6b644..1f0551d 100644 (file)
@@ -95,16 +95,20 @@ struct ComputeShaderSpec
        std::vector<BufferSp>   outputs;
        tcu::IVec3                              numWorkGroups;
        std::vector<deUint32>   specConstants;
+       qpTestResult                    failResult;
+       std::string                             failMessage;
        // If null, a default verification will be performed by comparing the memory pointed to by outputAllocations
        // and the contents of expectedOutputs. Otherwise the function pointed to by verifyIO will be called.
        // If true is returned, then the test case is assumed to have passed, if false is returned, then the test
-       // case is assumed to have failed.
+       // case is assumed to have failed. Exact meaning of failure can be customized with failResult.
        bool                                    (*verifyIO)(const std::vector<BufferSp>& inputs, const std::vector<AllocationSp>& outputAllocations, const std::vector<BufferSp>& expectedOutputs, tcu::TestLog& log);
-                                                       ComputeShaderSpec()
+
+                                                       ComputeShaderSpec (void)
                                                                : entryPoint    ("main")
+                                                               , failResult    (QP_TEST_RESULT_FAIL)
+                                                               , failMessage   ("Output doesn't match with expected")
                                                                , verifyIO              (DE_NULL)
                                                        {}
-
 };
 
 } // SpirVAssembly
index 3887f80..1df4a02 100644 (file)
@@ -3,6 +3,7 @@
  * ------------------------
  *
  * Copyright (c) 2015 Google Inc.
+ * Copyright (c) 2016 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.
@@ -47,7 +48,6 @@
 #include "deUniquePtr.hpp"
 #include "tcuStringTemplate.hpp"
 
-#include <cmath>
 #include "vktSpvAsmComputeShaderCase.hpp"
 #include "vktSpvAsmComputeShaderTestUtil.hpp"
 #include "vktTestCaseUtil.hpp"
@@ -57,6 +57,7 @@
 #include <map>
 #include <string>
 #include <sstream>
+#include <utility>
 
 namespace vkt
 {
@@ -95,6 +96,27 @@ static void fillRandomScalars (de::Random& rnd, T minValue, T maxValue, void* ds
                typedPtr[offset + ndx] = randomScalar<T>(rnd, minValue, maxValue);
 }
 
+// Filter is a function that returns true if a value should pass, false otherwise.
+template<typename T, typename FilterT>
+static void fillRandomScalars (de::Random& rnd, T minValue, T maxValue, void* dst, int numValues, FilterT filter, int offset = 0)
+{
+       T* const typedPtr = (T*)dst;
+       T value;
+       for (int ndx = 0; ndx < numValues; ndx++)
+       {
+               do
+                       value = randomScalar<T>(rnd, minValue, maxValue);
+               while (!filter(value));
+
+               typedPtr[offset + ndx] = value;
+       }
+}
+
+inline bool filterNotZero (const deInt32 value)
+{
+       return value != 0;
+}
+
 static void floorAll (vector<float>& values)
 {
        for (size_t i = 0; i < values.size(); i++)
@@ -840,6 +862,212 @@ tcu::TestCaseGroup* createOpFRemGroup (tcu::TestContext& testCtx)
        return group.release();
 }
 
+tcu::TestCaseGroup* createOpSRemGroup (tcu::TestContext& testCtx)
+{
+       de::MovePtr<tcu::TestCaseGroup> group                   (new tcu::TestCaseGroup(testCtx, "opsrem", "Test the OpSRem instruction"));
+       de::Random                                              rnd                             (deStringHash(group->getName()));
+       const int                                               numElements             = 200;
+
+       const struct CaseParams
+       {
+               const char*             name;
+               const char*             failMessage;            // customized status message
+               qpTestResult    failResult;                     // override status on failure
+               int                             op1Min, op1Max;         // operand ranges
+               int                             op2Min, op2Max;
+       } cases[] =
+       {
+               { "positive",   "Output doesn't match with expected",                           QP_TEST_RESULT_FAIL,    0,              65536,  0,              100 },
+               { "all",                "Inconsistent results, but within specification",       QP_TEST_RESULT_PASS,    -65536, 65536,  -100,   100 },  // see below
+       };
+       // If either operand is negative the result is undefined. Some implementations may still return correct values.
+
+       for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
+       {
+               const CaseParams&       params          = cases[caseNdx];
+               ComputeShaderSpec       spec;
+               vector<deInt32>         inputInts1      (numElements, 0);
+               vector<deInt32>         inputInts2      (numElements, 0);
+               vector<deInt32>         outputInts      (numElements, 0);
+
+               fillRandomScalars(rnd, params.op1Min, params.op1Max, &inputInts1[0], numElements);
+               fillRandomScalars(rnd, params.op2Min, params.op2Max, &inputInts2[0], numElements, filterNotZero);
+
+               for (int ndx = 0; ndx < numElements; ++ndx)
+               {
+                       // The return value of std::fmod() has the same sign as its first operand, which is how OpFRem spec'd.
+                       outputInts[ndx] = inputInts1[ndx] % inputInts2[ndx];
+               }
+
+               spec.assembly =
+                       string(s_ShaderPreamble) +
+
+                       "OpName %main           \"main\"\n"
+                       "OpName %id             \"gl_GlobalInvocationID\"\n"
+
+                       "OpDecorate %id BuiltIn GlobalInvocationId\n"
+
+                       "OpDecorate %buf BufferBlock\n"
+                       "OpDecorate %indata1 DescriptorSet 0\n"
+                       "OpDecorate %indata1 Binding 0\n"
+                       "OpDecorate %indata2 DescriptorSet 0\n"
+                       "OpDecorate %indata2 Binding 1\n"
+                       "OpDecorate %outdata DescriptorSet 0\n"
+                       "OpDecorate %outdata Binding 2\n"
+                       "OpDecorate %i32arr ArrayStride 4\n"
+                       "OpMemberDecorate %buf 0 Offset 0\n"
+
+                       + string(s_CommonTypes) +
+
+                       "%buf        = OpTypeStruct %i32arr\n"
+                       "%bufptr     = OpTypePointer Uniform %buf\n"
+                       "%indata1    = OpVariable %bufptr Uniform\n"
+                       "%indata2    = OpVariable %bufptr Uniform\n"
+                       "%outdata    = OpVariable %bufptr Uniform\n"
+
+                       "%id        = OpVariable %uvec3ptr Input\n"
+                       "%zero      = OpConstant %i32 0\n"
+
+                       "%main      = OpFunction %void None %voidf\n"
+                       "%label     = OpLabel\n"
+                       "%idval     = OpLoad %uvec3 %id\n"
+                       "%x         = OpCompositeExtract %u32 %idval 0\n"
+                       "%inloc1    = OpAccessChain %i32ptr %indata1 %zero %x\n"
+                       "%inval1    = OpLoad %i32 %inloc1\n"
+                       "%inloc2    = OpAccessChain %i32ptr %indata2 %zero %x\n"
+                       "%inval2    = OpLoad %i32 %inloc2\n"
+                       "%rem       = OpSRem %i32 %inval1 %inval2\n"
+                       "%outloc    = OpAccessChain %i32ptr %outdata %zero %x\n"
+                       "             OpStore %outloc %rem\n"
+                       "             OpReturn\n"
+                       "             OpFunctionEnd\n";
+
+               spec.inputs.push_back   (BufferSp(new Int32Buffer(inputInts1)));
+               spec.inputs.push_back   (BufferSp(new Int32Buffer(inputInts2)));
+               spec.outputs.push_back  (BufferSp(new Int32Buffer(outputInts)));
+               spec.numWorkGroups              = IVec3(numElements, 1, 1);
+               spec.failResult                 = params.failResult;
+               spec.failMessage                = params.failMessage;
+
+               group->addChild(new SpvAsmComputeShaderCase(testCtx, params.name, "", spec));
+       }
+
+       return group.release();
+}
+
+tcu::TestCaseGroup* createOpSModGroup (tcu::TestContext& testCtx)
+{
+       de::MovePtr<tcu::TestCaseGroup> group                   (new tcu::TestCaseGroup(testCtx, "opsmod", "Test the OpSMod instruction"));
+       de::Random                                              rnd                             (deStringHash(group->getName()));
+       const int                                               numElements             = 200;
+
+       const struct CaseParams
+       {
+               const char*             name;
+               const char*             failMessage;            // customized status message
+               qpTestResult    failResult;                     // override status on failure
+               int                             op1Min, op1Max;         // operand ranges
+               int                             op2Min, op2Max;
+       } cases[] =
+       {
+               { "positive",   "Output doesn't match with expected",                           QP_TEST_RESULT_FAIL,    0,              65536,  0,              100 },
+               { "all",                "Inconsistent results, but within specification",       QP_TEST_RESULT_PASS,    -65536, 65536,  -100,   100 },  // see below
+       };
+       // If either operand is negative the result is undefined. Some implementations may still return correct values.
+
+       for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
+       {
+               const CaseParams&       params          = cases[caseNdx];
+
+               ComputeShaderSpec       spec;
+               vector<deInt32>         inputInts1      (numElements, 0);
+               vector<deInt32>         inputInts2      (numElements, 0);
+               vector<deInt32>         outputInts      (numElements, 0);
+
+               fillRandomScalars(rnd, params.op1Min, params.op1Max, &inputInts1[0], numElements);
+               fillRandomScalars(rnd, params.op2Min, params.op2Max, &inputInts2[0], numElements, filterNotZero);
+
+               for (int ndx = 0; ndx < numElements; ++ndx)
+               {
+                       deInt32 rem = inputInts1[ndx] % inputInts2[ndx];
+                       if (rem == 0)
+                       {
+                               outputInts[ndx] = 0;
+                       }
+                       else if ((inputInts1[ndx] >= 0) == (inputInts2[ndx] >= 0))
+                       {
+                               // They have the same sign
+                               outputInts[ndx] = rem;
+                       }
+                       else
+                       {
+                               // They have opposite sign.  The remainder operation takes the
+                               // sign inputInts1[ndx] but OpSMod is supposed to take ths sign
+                               // of inputInts2[ndx].  Adding inputInts2[ndx] will ensure that
+                               // the result has the correct sign and that it is still
+                               // congruent to inputInts1[ndx] modulo inputInts2[ndx]
+                               //
+                               // See also http://mathforum.org/library/drmath/view/52343.html
+                               outputInts[ndx] = rem + inputInts2[ndx];
+                       }
+               }
+
+               spec.assembly =
+                       string(s_ShaderPreamble) +
+
+                       "OpName %main           \"main\"\n"
+                       "OpName %id             \"gl_GlobalInvocationID\"\n"
+
+                       "OpDecorate %id BuiltIn GlobalInvocationId\n"
+
+                       "OpDecorate %buf BufferBlock\n"
+                       "OpDecorate %indata1 DescriptorSet 0\n"
+                       "OpDecorate %indata1 Binding 0\n"
+                       "OpDecorate %indata2 DescriptorSet 0\n"
+                       "OpDecorate %indata2 Binding 1\n"
+                       "OpDecorate %outdata DescriptorSet 0\n"
+                       "OpDecorate %outdata Binding 2\n"
+                       "OpDecorate %i32arr ArrayStride 4\n"
+                       "OpMemberDecorate %buf 0 Offset 0\n"
+
+                       + string(s_CommonTypes) +
+
+                       "%buf        = OpTypeStruct %i32arr\n"
+                       "%bufptr     = OpTypePointer Uniform %buf\n"
+                       "%indata1    = OpVariable %bufptr Uniform\n"
+                       "%indata2    = OpVariable %bufptr Uniform\n"
+                       "%outdata    = OpVariable %bufptr Uniform\n"
+
+                       "%id        = OpVariable %uvec3ptr Input\n"
+                       "%zero      = OpConstant %i32 0\n"
+
+                       "%main      = OpFunction %void None %voidf\n"
+                       "%label     = OpLabel\n"
+                       "%idval     = OpLoad %uvec3 %id\n"
+                       "%x         = OpCompositeExtract %u32 %idval 0\n"
+                       "%inloc1    = OpAccessChain %i32ptr %indata1 %zero %x\n"
+                       "%inval1    = OpLoad %i32 %inloc1\n"
+                       "%inloc2    = OpAccessChain %i32ptr %indata2 %zero %x\n"
+                       "%inval2    = OpLoad %i32 %inloc2\n"
+                       "%rem       = OpSMod %i32 %inval1 %inval2\n"
+                       "%outloc    = OpAccessChain %i32ptr %outdata %zero %x\n"
+                       "             OpStore %outloc %rem\n"
+                       "             OpReturn\n"
+                       "             OpFunctionEnd\n";
+
+               spec.inputs.push_back   (BufferSp(new Int32Buffer(inputInts1)));
+               spec.inputs.push_back   (BufferSp(new Int32Buffer(inputInts2)));
+               spec.outputs.push_back  (BufferSp(new Int32Buffer(outputInts)));
+               spec.numWorkGroups              = IVec3(numElements, 1, 1);
+               spec.failResult                 = params.failResult;
+               spec.failMessage                = params.failMessage;
+
+               group->addChild(new SpvAsmComputeShaderCase(testCtx, params.name, "", spec));
+       }
+
+       return group.release();
+}
+
 // Copy contents in the input buffer to the output buffer.
 tcu::TestCaseGroup* createOpCopyMemoryGroup (tcu::TestContext& testCtx)
 {
@@ -3496,12 +3724,16 @@ struct InstanceContext
        StageToSpecConstantMap  specConstants;
        bool                                    hasTessellation;
        VkShaderStageFlagBits   requiredStages;
+       qpTestResult                    failResult;
+       string                                  failMessageTemplate;    //!< ${reason} in the template will be replaced with a detailed failure message
 
        InstanceContext (const RGBA (&inputs)[4], const RGBA (&outputs)[4], const map<string, string>& testCodeFragments_, const StageToSpecConstantMap& specConstants_)
                : testCodeFragments             (testCodeFragments_)
                , specConstants                 (specConstants_)
                , hasTessellation               (false)
                , requiredStages                (static_cast<VkShaderStageFlagBits>(0))
+               , failResult                    (QP_TEST_RESULT_FAIL)
+               , failMessageTemplate   ("${reason}")
        {
                inputColors[0]          = inputs[0];
                inputColors[1]          = inputs[1];
@@ -3515,11 +3747,13 @@ struct InstanceContext
        }
 
        InstanceContext (const InstanceContext& other)
-               : moduleMap                     (other.moduleMap)
-               , testCodeFragments     (other.testCodeFragments)
-               , specConstants         (other.specConstants)
-               , hasTessellation       (other.hasTessellation)
-               , requiredStages    (other.requiredStages)
+               : moduleMap                             (other.moduleMap)
+               , testCodeFragments             (other.testCodeFragments)
+               , specConstants                 (other.specConstants)
+               , hasTessellation               (other.hasTessellation)
+               , requiredStages                (other.requiredStages)
+               , failResult                    (other.failResult)
+               , failMessageTemplate   (other.failMessageTemplate)
        {
                inputColors[0]          = other.inputColors[0];
                inputColors[1]          = other.inputColors[1];
@@ -3531,6 +3765,13 @@ struct InstanceContext
                outputColors[2]         = other.outputColors[2];
                outputColors[3]         = other.outputColors[3];
        }
+
+       string getSpecializedFailMessage (const string& failureReason)
+       {
+               map<string, string> parameters;
+               parameters["reason"] = failureReason;
+               return StringTemplate(failMessageTemplate).specialize(parameters);
+       }
 };
 
 // A description of a shader to be used for a single stage of the graphics pipeline.
@@ -3581,7 +3822,13 @@ void getInvertedDefaultColors (RGBA (&colors)[4])
 // by setting up the mapping of modules to their contained shaders and stages.
 // The inputs and expected outputs are given by inputColors and outputColors
 template<size_t N>
-InstanceContext createInstanceContext (const ShaderElement (&elements)[N], const RGBA (&inputColors)[4], const RGBA (&outputColors)[4], const map<string, string>& testCodeFragments, const StageToSpecConstantMap& specConstants)
+InstanceContext createInstanceContext (const ShaderElement                             (&elements)[N],
+                                                                          const RGBA                                           (&inputColors)[4],
+                                                                          const RGBA                                           (&outputColors)[4],
+                                                                          const map<string, string>&           testCodeFragments,
+                                                                          const StageToSpecConstantMap&        specConstants,
+                                                                          const qpTestResult                           failResult                      = QP_TEST_RESULT_FAIL,
+                                                                          const string&                                        failMessageTemplate     = string())
 {
        InstanceContext ctx (inputColors, outputColors, testCodeFragments, specConstants);
        for (size_t i = 0; i < N; ++i)
@@ -3589,18 +3836,25 @@ InstanceContext createInstanceContext (const ShaderElement (&elements)[N], const
                ctx.moduleMap[elements[i].moduleName].push_back(std::make_pair(elements[i].entryName, elements[i].stage));
                ctx.requiredStages = static_cast<VkShaderStageFlagBits>(ctx.requiredStages | elements[i].stage);
        }
+       ctx.failResult                          = failResult;
+       if (!failMessageTemplate.empty())
+               ctx.failMessageTemplate = failMessageTemplate;
        return ctx;
 }
 
 template<size_t N>
-inline InstanceContext createInstanceContext (const ShaderElement (&elements)[N], RGBA (&inputColors)[4], const RGBA (&outputColors)[4], const map<string, string>& testCodeFragments)
+inline InstanceContext createInstanceContext (const ShaderElement                      (&elements)[N],
+                                                                                         RGBA                                                  (&inputColors)[4],
+                                                                                         const RGBA                                    (&outputColors)[4],
+                                                                                         const map<string, string>&    testCodeFragments)
 {
        return createInstanceContext(elements, inputColors, outputColors, testCodeFragments, StageToSpecConstantMap());
 }
 
 // The same as createInstanceContext above, but with default colors.
 template<size_t N>
-InstanceContext createInstanceContext (const ShaderElement (&elements)[N], const map<string, string>& testCodeFragments)
+InstanceContext createInstanceContext (const ShaderElement                     (&elements)[N],
+                                                                          const map<string, string>&   testCodeFragments)
 {
        RGBA defaultColors[4];
        getDefaultColors(defaultColors);
@@ -3641,6 +3895,7 @@ void createPipelineShaderStages (const DeviceInterface& vk, const VkDevice vkDev
                                                                                                                                                                                                \
        "%f32 = OpTypeFloat 32\n"                                                                                                                                       \
        "%v3f32 = OpTypeVector %f32 3\n"                                                                                                                        \
+       "%v4i32 = OpTypeVector %i32 4\n"                                                                                                                        \
        "%v4f32 = OpTypeVector %f32 4\n"                                                                                                                        \
        "%v4bool = OpTypeVector %bool 4\n"                                                                                                                      \
                                                                                                                                                                                                \
@@ -5589,24 +5844,31 @@ TestStatus runAndVerifyDefaultPipeline (Context& context, InstanceContext instan
        const RGBA threshold(1, 1, 1, 1);
        const RGBA upperLeft(pixelBuffer.getPixel(1, 1));
        if (!tcu::compareThreshold(upperLeft, instance.outputColors[0], threshold))
-               return TestStatus::fail("Upper left corner mismatch");
+               return TestStatus(instance.failResult, instance.getSpecializedFailMessage("Upper left corner mismatch"));
 
        const RGBA upperRight(pixelBuffer.getPixel(pixelBuffer.getWidth() - 1, 1));
        if (!tcu::compareThreshold(upperRight, instance.outputColors[1], threshold))
-               return TestStatus::fail("Upper right corner mismatch");
+               return TestStatus(instance.failResult, instance.getSpecializedFailMessage("Upper right corner mismatch"));
 
        const RGBA lowerLeft(pixelBuffer.getPixel(1, pixelBuffer.getHeight() - 1));
        if (!tcu::compareThreshold(lowerLeft, instance.outputColors[2], threshold))
-               return TestStatus::fail("Lower left corner mismatch");
+               return TestStatus(instance.failResult, instance.getSpecializedFailMessage("Lower left corner mismatch"));
 
        const RGBA lowerRight(pixelBuffer.getPixel(pixelBuffer.getWidth() - 1, pixelBuffer.getHeight() - 1));
        if (!tcu::compareThreshold(lowerRight, instance.outputColors[3], threshold))
-               return TestStatus::fail("Lower right corner mismatch");
+               return TestStatus(instance.failResult, instance.getSpecializedFailMessage("Lower right corner mismatch"));
 
        return TestStatus::pass("Rendered output matches input");
 }
 
-void createTestsForAllStages (const std::string& name, const RGBA (&inputColors)[4], const RGBA (&outputColors)[4], const map<string, string>& testCodeFragments, const vector<deInt32>& specConstants, tcu::TestCaseGroup* tests)
+void createTestsForAllStages (const std::string&                       name,
+                                                         const RGBA                                    (&inputColors)[4],
+                                                         const RGBA                                    (&outputColors)[4],
+                                                         const map<string, string>&    testCodeFragments,
+                                                         const vector<deInt32>&                specConstants,
+                                                         tcu::TestCaseGroup*                   tests,
+                                                         const qpTestResult                    failResult                      = QP_TEST_RESULT_FAIL,
+                                                         const string&                                 failMessageTemplate     = string())
 {
        const ShaderElement             vertFragPipelineStages[]                =
        {
@@ -5633,33 +5895,39 @@ void createTestsForAllStages (const std::string& name, const RGBA (&inputColors)
 
        specConstantMap[VK_SHADER_STAGE_VERTEX_BIT] = specConstants;
        addFunctionCaseWithPrograms<InstanceContext>(tests, name + "_vert", "", addShaderCodeCustomVertex, runAndVerifyDefaultPipeline,
-                                                                                                createInstanceContext(vertFragPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap));
+                                                                                                createInstanceContext(vertFragPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap, failResult, failMessageTemplate));
 
        specConstantMap.clear();
        specConstantMap[VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT] = specConstants;
        addFunctionCaseWithPrograms<InstanceContext>(tests, name + "_tessc", "", addShaderCodeCustomTessControl, runAndVerifyDefaultPipeline,
-                                                                                                createInstanceContext(tessPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap));
+                                                                                                createInstanceContext(tessPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap, failResult, failMessageTemplate));
 
        specConstantMap.clear();
        specConstantMap[VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT] = specConstants;
        addFunctionCaseWithPrograms<InstanceContext>(tests, name + "_tesse", "", addShaderCodeCustomTessEval, runAndVerifyDefaultPipeline,
-                                                                                                createInstanceContext(tessPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap));
+                                                                                                createInstanceContext(tessPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap, failResult, failMessageTemplate));
 
        specConstantMap.clear();
        specConstantMap[VK_SHADER_STAGE_GEOMETRY_BIT] = specConstants;
        addFunctionCaseWithPrograms<InstanceContext>(tests, name + "_geom", "", addShaderCodeCustomGeometry, runAndVerifyDefaultPipeline,
-                                                                                                createInstanceContext(geomPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap));
+                                                                                                createInstanceContext(geomPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap, failResult, failMessageTemplate));
 
        specConstantMap.clear();
        specConstantMap[VK_SHADER_STAGE_FRAGMENT_BIT] = specConstants;
        addFunctionCaseWithPrograms<InstanceContext>(tests, name + "_frag", "", addShaderCodeCustomFragment, runAndVerifyDefaultPipeline,
-                                                                                                createInstanceContext(vertFragPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap));
+                                                                                                createInstanceContext(vertFragPipelineStages, inputColors, outputColors, testCodeFragments, specConstantMap, failResult, failMessageTemplate));
 }
 
-inline void createTestsForAllStages (const std::string& name, const RGBA (&inputColors)[4], const RGBA (&outputColors)[4], const map<string, string>& testCodeFragments, tcu::TestCaseGroup* tests)
+inline void createTestsForAllStages (const string&                             name,
+                                                                        const RGBA                                     (&inputColors)[4],
+                                                                        const RGBA                                     (&outputColors)[4],
+                                                                        const map<string, string>&     testCodeFragments,
+                                                                        tcu::TestCaseGroup*            tests,
+                                                                        const qpTestResult                     failResult                      = QP_TEST_RESULT_FAIL,
+                                                                        const string&                          failMessageTemplate     = string())
 {
        vector<deInt32> noSpecConstants;
-       createTestsForAllStages(name, inputColors, outputColors, testCodeFragments, noSpecConstants, tests);
+       createTestsForAllStages(name, inputColors, outputColors, testCodeFragments, noSpecConstants, tests, failResult, failMessageTemplate);
 }
 
 } // anonymous
@@ -7916,6 +8184,172 @@ tcu::TestCaseGroup* createFRemTests(tcu::TestContext& testCtx)
        return testGroup.release();
 }
 
+// Test for the OpSRem instruction.
+tcu::TestCaseGroup* createSRemTests(tcu::TestContext& testCtx)
+{
+       de::MovePtr<tcu::TestCaseGroup>         testGroup(new tcu::TestCaseGroup(testCtx, "srem", "OpSRem"));
+       map<string, string>                                     fragments;
+
+       fragments["pre_main"]                            =
+               "%c_f32_255 = OpConstant %f32 255.0\n"
+               "%c_i32_128 = OpConstant %i32 128\n"
+               "%c_i32_255 = OpConstant %i32 255\n"
+               "%c_v4f32_255 = OpConstantComposite %v4f32 %c_f32_255 %c_f32_255 %c_f32_255 %c_f32_255 \n"
+               "%c_v4f32_0_5 = OpConstantComposite %v4f32 %c_f32_0_5 %c_f32_0_5 %c_f32_0_5 %c_f32_0_5 \n"
+               "%c_v4i32_128 = OpConstantComposite %v4i32 %c_i32_128 %c_i32_128 %c_i32_128 %c_i32_128 \n";
+
+       // The test does the following.
+       // ivec4 ints = int(param1 * 255.0 + 0.5) - 128;
+       // ivec4 result = ivec4(srem(ints.x, ints.y), srem(ints.y, ints.z), srem(ints.z, ints.x), 255);
+       // return float(result + 128) / 255.0;
+       fragments["testfun"]                             =
+               "%test_code = OpFunction %v4f32 None %v4f32_function\n"
+               "%param1 = OpFunctionParameter %v4f32\n"
+               "%label_testfun = OpLabel\n"
+               "%div255 = OpFMul %v4f32 %param1 %c_v4f32_255\n"
+               "%add0_5 = OpFAdd %v4f32 %div255 %c_v4f32_0_5\n"
+               "%uints_in = OpConvertFToS %v4i32 %add0_5\n"
+               "%ints_in = OpISub %v4i32 %uints_in %c_v4i32_128\n"
+               "%x_in = OpCompositeExtract %i32 %ints_in 0\n"
+               "%y_in = OpCompositeExtract %i32 %ints_in 1\n"
+               "%z_in = OpCompositeExtract %i32 %ints_in 2\n"
+               "%x_out = OpSRem %i32 %x_in %y_in\n"
+               "%y_out = OpSRem %i32 %y_in %z_in\n"
+               "%z_out = OpSRem %i32 %z_in %x_in\n"
+               "%ints_out = OpCompositeConstruct %v4i32 %x_out %y_out %z_out %c_i32_255\n"
+               "%ints_offset = OpIAdd %v4i32 %ints_out %c_v4i32_128\n"
+               "%f_ints_offset = OpConvertSToF %v4f32 %ints_offset\n"
+               "%float_out = OpFDiv %v4f32 %f_ints_offset %c_v4f32_255\n"
+               "OpReturnValue %float_out\n"
+               "OpFunctionEnd\n";
+
+       const struct CaseParams
+       {
+               const char*             name;
+               const char*             failMessageTemplate;    // customized status message
+               qpTestResult    failResult;                             // override status on failure
+               int                             operands[4][3];                 // four (x, y, z) vectors of operands
+               int                             results[4][3];                  // four (x, y, z) vectors of results
+       } cases[] =
+       {
+               {
+                       "positive",
+                       "${reason}",
+                       QP_TEST_RESULT_FAIL,
+                       { { 5, 12, 17 }, { 5, 5, 7 }, { 75, 8, 81 }, { 25, 60, 100 } },                 // operands
+                       { { 5, 12,  2 }, { 0, 5, 2 }, {  3, 8,  6 }, { 25, 60,   0 } },                 // results
+               },
+               {
+                       "all",
+                       "Inconsistent results, but within specification: ${reason}",
+                       QP_TEST_RESULT_PASS,                                                                                                    // negative operands, not required by the spec
+                       { { 5, 12, -17 }, { -5, -5, 7 }, { 75, 8, -81 }, { 25, -60, 100 } },    // operands
+                       { { 5, 12,  -2 }, {  0, -5, 2 }, {  3, 8,  -6 }, { 25, -60,   0 } },    // results
+               },
+       };
+       // If either operand is negative the result is undefined. Some implementations may still return correct values.
+
+       for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
+       {
+               const CaseParams&       params                  = cases[caseNdx];
+               RGBA                            inputColors[4];
+               RGBA                            outputColors[4];
+
+               for (int i = 0; i < 4; ++i)
+               {
+                       inputColors [i] = RGBA(params.operands[i][0] + 128, params.operands[i][1] + 128, params.operands[i][2] + 128, 255);
+                       outputColors[i] = RGBA(params.results [i][0] + 128, params.results [i][1] + 128, params.results [i][2] + 128, 255);
+               }
+
+               createTestsForAllStages(params.name, inputColors, outputColors, fragments, testGroup.get(), params.failResult, params.failMessageTemplate);
+       }
+
+       return testGroup.release();
+}
+
+// Test for the OpSMod instruction.
+tcu::TestCaseGroup* createSModTests(tcu::TestContext& testCtx)
+{
+       de::MovePtr<tcu::TestCaseGroup>         testGroup(new tcu::TestCaseGroup(testCtx, "smod", "OpSMod"));
+       map<string, string>                                     fragments;
+
+       fragments["pre_main"]                            =
+               "%c_f32_255 = OpConstant %f32 255.0\n"
+               "%c_i32_128 = OpConstant %i32 128\n"
+               "%c_i32_255 = OpConstant %i32 255\n"
+               "%c_v4f32_255 = OpConstantComposite %v4f32 %c_f32_255 %c_f32_255 %c_f32_255 %c_f32_255 \n"
+               "%c_v4f32_0_5 = OpConstantComposite %v4f32 %c_f32_0_5 %c_f32_0_5 %c_f32_0_5 %c_f32_0_5 \n"
+               "%c_v4i32_128 = OpConstantComposite %v4i32 %c_i32_128 %c_i32_128 %c_i32_128 %c_i32_128 \n";
+
+       // The test does the following.
+       // ivec4 ints = int(param1 * 255.0 + 0.5) - 128;
+       // ivec4 result = ivec4(smod(ints.x, ints.y), smod(ints.y, ints.z), smod(ints.z, ints.x), 255);
+       // return float(result + 128) / 255.0;
+       fragments["testfun"]                             =
+               "%test_code = OpFunction %v4f32 None %v4f32_function\n"
+               "%param1 = OpFunctionParameter %v4f32\n"
+               "%label_testfun = OpLabel\n"
+               "%div255 = OpFMul %v4f32 %param1 %c_v4f32_255\n"
+               "%add0_5 = OpFAdd %v4f32 %div255 %c_v4f32_0_5\n"
+               "%uints_in = OpConvertFToS %v4i32 %add0_5\n"
+               "%ints_in = OpISub %v4i32 %uints_in %c_v4i32_128\n"
+               "%x_in = OpCompositeExtract %i32 %ints_in 0\n"
+               "%y_in = OpCompositeExtract %i32 %ints_in 1\n"
+               "%z_in = OpCompositeExtract %i32 %ints_in 2\n"
+               "%x_out = OpSMod %i32 %x_in %y_in\n"
+               "%y_out = OpSMod %i32 %y_in %z_in\n"
+               "%z_out = OpSMod %i32 %z_in %x_in\n"
+               "%ints_out = OpCompositeConstruct %v4i32 %x_out %y_out %z_out %c_i32_255\n"
+               "%ints_offset = OpIAdd %v4i32 %ints_out %c_v4i32_128\n"
+               "%f_ints_offset = OpConvertSToF %v4f32 %ints_offset\n"
+               "%float_out = OpFDiv %v4f32 %f_ints_offset %c_v4f32_255\n"
+               "OpReturnValue %float_out\n"
+               "OpFunctionEnd\n";
+
+       const struct CaseParams
+       {
+               const char*             name;
+               const char*             failMessageTemplate;    // customized status message
+               qpTestResult    failResult;                             // override status on failure
+               int                             operands[4][3];                 // four (x, y, z) vectors of operands
+               int                             results[4][3];                  // four (x, y, z) vectors of results
+       } cases[] =
+       {
+               {
+                       "positive",
+                       "${reason}",
+                       QP_TEST_RESULT_FAIL,
+                       { { 5, 12, 17 }, { 5, 5, 7 }, { 75, 8, 81 }, { 25, 60, 100 } },                         // operands
+                       { { 5, 12,  2 }, { 0, 5, 2 }, {  3, 8,  6 }, { 25, 60,   0 } },                         // results
+               },
+               {
+                       "all",
+                       "Inconsistent results, but within specification: ${reason}",
+                       QP_TEST_RESULT_PASS,                                                                                                            // negative operands, not required by the spec
+                       { { 5, 12, -17 }, { -5, -5,  7 }, { 75,   8, -81 }, {  25, -60, 100 } },        // operands
+                       { { 5, -5,   3 }, {  0,  2, -3 }, {  3, -73,  69 }, { -35,  40,   0 } },        // results
+               },
+       };
+       // If either operand is negative the result is undefined. Some implementations may still return correct values.
+
+       for (int caseNdx = 0; caseNdx < DE_LENGTH_OF_ARRAY(cases); ++caseNdx)
+       {
+               const CaseParams&       params                  = cases[caseNdx];
+               RGBA                            inputColors[4];
+               RGBA                            outputColors[4];
+
+               for (int i = 0; i < 4; ++i)
+               {
+                       inputColors [i] = RGBA(params.operands[i][0] + 128, params.operands[i][1] + 128, params.operands[i][2] + 128, 255);
+                       outputColors[i] = RGBA(params.results [i][0] + 128, params.results [i][1] + 128, params.results [i][2] + 128, 255);
+               }
+
+               createTestsForAllStages(params.name, inputColors, outputColors, fragments, testGroup.get(), params.failResult, params.failMessageTemplate);
+       }
+
+       return testGroup.release();
+}
+
 enum IntegerType
 {
        INTEGER_TYPE_SIGNED_16,
@@ -8962,6 +9396,8 @@ tcu::TestCaseGroup* createInstructionTests (tcu::TestContext& testCtx)
        computeTests->addChild(createOpUnreachableGroup(testCtx));
        computeTests ->addChild(createOpQuantizeToF16Group(testCtx));
        computeTests ->addChild(createOpFRemGroup(testCtx));
+       computeTests->addChild(createOpSRemGroup(testCtx));
+       computeTests->addChild(createOpSModGroup(testCtx));
        computeTests->addChild(createSConvertTests(testCtx));
        computeTests->addChild(createUConvertTests(testCtx));
        computeTests->addChild(createOpCompositeInsertGroup(testCtx));
@@ -9019,6 +9455,8 @@ tcu::TestCaseGroup* createInstructionTests (tcu::TestContext& testCtx)
        graphicsTests->addChild(createBarrierTests(testCtx));
        graphicsTests->addChild(createDecorationGroupTests(testCtx));
        graphicsTests->addChild(createFRemTests(testCtx));
+       graphicsTests->addChild(createSRemTests(testCtx));
+       graphicsTests->addChild(createSModTests(testCtx));
 
        instructionTests->addChild(computeTests.release());
        instructionTests->addChild(graphicsTests.release());
index 26ecbbe..8d38d77 100644 (file)
@@ -11995,6 +11995,8 @@ dEQP-VK.api.granularity.in_render_pass.s8_uint
 dEQP-VK.api.granularity.in_render_pass.d16_unorm_s8_uint
 dEQP-VK.api.granularity.in_render_pass.d24_unorm_s8_uint
 dEQP-VK.api.granularity.in_render_pass.d32_sfloat_s8_uint
+dEQP-VK.api.get_memory_commitment.memory_commitment
+dEQP-VK.api.get_memory_commitment.memory_commitment_allocate_only
 dEQP-VK.memory.allocation.basic.size_64.forward.count_1
 dEQP-VK.memory.allocation.basic.size_64.forward.count_10
 dEQP-VK.memory.allocation.basic.size_64.forward.count_100
@@ -89497,6 +89499,10 @@ dEQP-VK.spirv_assembly.instruction.compute.opquantize.flush_to_zero
 dEQP-VK.spirv_assembly.instruction.compute.opquantize.exact
 dEQP-VK.spirv_assembly.instruction.compute.opquantize.rounded
 dEQP-VK.spirv_assembly.instruction.compute.opfrem.all
+dEQP-VK.spirv_assembly.instruction.compute.opsrem.positive
+dEQP-VK.spirv_assembly.instruction.compute.opsrem.all
+dEQP-VK.spirv_assembly.instruction.compute.opsmod.positive
+dEQP-VK.spirv_assembly.instruction.compute.opsmod.all
 dEQP-VK.spirv_assembly.instruction.compute.sconvert.int16_to_int32
 dEQP-VK.spirv_assembly.instruction.compute.sconvert.int16_to_int64
 dEQP-VK.spirv_assembly.instruction.compute.sconvert.int32_to_int64
@@ -90382,6 +90388,26 @@ dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_tessc
 dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_tesse
 dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_geom
 dEQP-VK.spirv_assembly.instruction.graphics.frem.frem_frag
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_vert
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_geom
+dEQP-VK.spirv_assembly.instruction.graphics.srem.positive_frag
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_vert
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_geom
+dEQP-VK.spirv_assembly.instruction.graphics.srem.all_frag
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_vert
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_geom
+dEQP-VK.spirv_assembly.instruction.graphics.smod.positive_frag
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_vert
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_tessc
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_tesse
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_geom
+dEQP-VK.spirv_assembly.instruction.graphics.smod.all_frag
 dEQP-VK.glsl.arrays.constructor.float3_vertex
 dEQP-VK.glsl.arrays.constructor.float3_fragment
 dEQP-VK.glsl.arrays.constructor.float4_vertex
index 57041bd..ee49459 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 
 eglw::EGLBoolean CallLogWrapper::eglBindAPI (eglw::EGLenum api)
index 69be6e9..99df24b 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 eglw::EGLBoolean                                                               eglBindAPI                                                      (eglw::EGLenum api);
 eglw::EGLBoolean                                                               eglBindTexImage                                         (eglw::EGLDisplay dpy, eglw::EGLSurface surface, eglw::EGLint buffer);
index c6d06ad..bd1a5c7 100644 (file)
@@ -25,6 +25,7 @@
 #include "egluUtil.hpp"
 #include "egluConfigInfo.hpp"
 #include "eglwEnums.hpp"
+#include "deSTLUtil.hpp"
 
 #include <algorithm>
 
@@ -55,19 +56,32 @@ int CandidateConfig::get (deUint32 attrib) const
        if (m_type == TYPE_CONFIG_INFO)
                return m_cfg.configInfo->getAttribute(attrib);
        else
-               return getConfigAttribInt(*m_cfg.object.egl, m_cfg.object.display, m_cfg.object.config, attrib);
+       {
+               if (attrib == EGL_COLOR_COMPONENT_TYPE_EXT)
+               {
+                       const std::vector<std::string>  extensions      = getDisplayExtensions(*m_cfg.object.egl, m_cfg.object.display);
+
+                       if (de::contains(extensions.begin(), extensions.end(), "EGL_EXT_pixel_format_float"))
+                               return getConfigAttribInt(*m_cfg.object.egl, m_cfg.object.display, m_cfg.object.config, attrib);
+                       else
+                               return EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
+               }
+               else
+                       return getConfigAttribInt(*m_cfg.object.egl, m_cfg.object.display, m_cfg.object.config, attrib);
+       }
 }
 
-int                    CandidateConfig::id                             (void) const { return get(EGL_CONFIG_ID);                                       }
-int                    CandidateConfig::redSize                (void) const { return get(EGL_RED_SIZE);                                        }
-int                    CandidateConfig::greenSize              (void) const { return get(EGL_GREEN_SIZE);                                      }
-int                    CandidateConfig::blueSize               (void) const { return get(EGL_BLUE_SIZE);                                       }
-int                    CandidateConfig::alphaSize              (void) const { return get(EGL_ALPHA_SIZE);                                      }
-int                    CandidateConfig::depthSize              (void) const { return get(EGL_DEPTH_SIZE);                                      }
-int                    CandidateConfig::stencilSize    (void) const { return get(EGL_STENCIL_SIZE);                            }
-int                    CandidateConfig::samples                (void) const { return get(EGL_SAMPLES);                                         }
-deUint32       CandidateConfig::renderableType (void) const { return (deUint32)get(EGL_RENDERABLE_TYPE);       }
-deUint32       CandidateConfig::surfaceType    (void) const { return (deUint32)get(EGL_SURFACE_TYPE);          }
+int                    CandidateConfig::id                                     (void) const { return get(EGL_CONFIG_ID);                                                       }
+int                    CandidateConfig::redSize                        (void) const { return get(EGL_RED_SIZE);                                                        }
+int                    CandidateConfig::greenSize                      (void) const { return get(EGL_GREEN_SIZE);                                                      }
+int                    CandidateConfig::blueSize                       (void) const { return get(EGL_BLUE_SIZE);                                                       }
+int                    CandidateConfig::alphaSize                      (void) const { return get(EGL_ALPHA_SIZE);                                                      }
+int                    CandidateConfig::depthSize                      (void) const { return get(EGL_DEPTH_SIZE);                                                      }
+int                    CandidateConfig::stencilSize            (void) const { return get(EGL_STENCIL_SIZE);                                            }
+int                    CandidateConfig::samples                        (void) const { return get(EGL_SAMPLES);                                                         }
+deUint32       CandidateConfig::renderableType         (void) const { return (deUint32)get(EGL_RENDERABLE_TYPE);                       }
+deUint32       CandidateConfig::surfaceType            (void) const { return (deUint32)get(EGL_SURFACE_TYPE);                          }
+deUint32       CandidateConfig::colorComponentType     (void) const { return (deUint32)get(EGL_COLOR_COMPONENT_TYPE_EXT);      }
 
 FilterList& FilterList::operator<< (ConfigFilter filter)
 {
index 2f316fe..baddad5 100644 (file)
@@ -59,6 +59,7 @@ public:
 
        deUint32                renderableType          (void) const;
        deUint32                surfaceType                     (void) const;
+       deUint32                colorComponentType      (void) const;
 
        tcu::RGBA               colorBits                       (void) const { return tcu::RGBA(redSize(), greenSize(), blueSize(), alphaSize());       }
 
index aed08f3..ab6081c 100644 (file)
@@ -77,6 +77,9 @@ deInt32 ConfigInfo::getAttribute (deUint32 attribute) const
                case EGL_YUV_CSC_STANDARD_EXT:          return yuvCscStandard;
                case EGL_YUV_PLANE_BPP_EXT:                     return yuvPlaneBpp;
 
+               // EGL_EXT_pixel_format_float
+               case EGL_COLOR_COMPONENT_TYPE_EXT:      return colorComponentType;
+
                default:                                                        TCU_THROW(InternalError, "Unknown attribute");
        }
 }
@@ -132,6 +135,15 @@ void queryExtConfigInfo (const eglw::Library& egl, eglw::EGLDisplay display, egl
 
                EGLU_CHECK_MSG(egl, "Failed to query EGL_EXT_yuv_surface config attribs");
        }
+
+       if (de::contains(extensions.begin(), extensions.end(), "EGL_EXT_pixel_format_float"))
+       {
+               egl.getConfigAttrib(display, config, EGL_COLOR_COMPONENT_TYPE_EXT,      (EGLint*)&dst->colorComponentType);
+
+               EGLU_CHECK_MSG(egl, "Failed to query EGL_EXT_pixel_format_float config attribs");
+       }
+       else
+               dst->colorComponentType = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
 }
 
 } // eglu
index 356c50a..2c0ae24 100644 (file)
@@ -81,6 +81,9 @@ public:
        deUint32                yuvCscStandard;
        deInt32                 yuvPlaneBpp;
 
+       // EGL_EXT_pixel_format_float
+       deUint32                colorComponentType;
+
        ConfigInfo (void)
                : bufferSize                    (0)
                , redSize                               (0)
@@ -119,6 +122,7 @@ public:
                , yuvDepthRange                 (EGL_NONE)
                , yuvCscStandard                (EGL_NONE)
                , yuvPlaneBpp                   (EGL_YUV_PLANE_BPP_0_EXT)
+               , colorComponentType    (EGL_NONE)
        {
        }
 
index 297a00c..d01e55b 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 
 const char* getBooleanName (int value)
@@ -159,6 +159,16 @@ const char* getYuvPlaneBppName (int value)
        }
 }
 
+const char* getColorComponentTypeName (int value)
+{
+       switch (value)
+       {
+               case EGL_COLOR_COMPONENT_TYPE_FIXED_EXT:        return "EGL_COLOR_COMPONENT_TYPE_FIXED_EXT";
+               case EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT:        return "EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT";
+               default:                                                                        return DE_NULL;
+       }
+}
+
 const char* getSurfaceTargetName (int value)
 {
        switch (value)
index fc2093f..839837f 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 const char*                                                    getBooleanName                          (int value);
 const char*                                                    getBoolDontCareName                     (int value);
@@ -12,6 +12,7 @@ const char*                                                   getConfigAttribName                     (int value);
 const char*                                                    getSurfaceAttribName            (int value);
 const char*                                                    getYuvOrderName                         (int value);
 const char*                                                    getYuvPlaneBppName                      (int value);
+const char*                                                    getColorComponentTypeName       (int value);
 const char*                                                    getSurfaceTargetName            (int value);
 const char*                                                    getColorBufferTypeName          (int value);
 const char*                                                    getConfigCaveatName                     (int value);
@@ -34,6 +35,7 @@ inline tcu::Format::Enum<int, 2>      getConfigAttribStr                      (int value)             { return tcu:
 inline tcu::Format::Enum<int, 2>       getSurfaceAttribStr                     (int value)             { return tcu::Format::Enum<int, 2>(getSurfaceAttribName, value); }
 inline tcu::Format::Enum<int, 2>       getYuvOrderStr                          (int value)             { return tcu::Format::Enum<int, 2>(getYuvOrderName, value); }
 inline tcu::Format::Enum<int, 2>       getYuvPlaneBppStr                       (int value)             { return tcu::Format::Enum<int, 2>(getYuvPlaneBppName, value); }
+inline tcu::Format::Enum<int, 2>       getColorComponentTypeStr        (int value)             { return tcu::Format::Enum<int, 2>(getColorComponentTypeName, value); }
 inline tcu::Format::Enum<int, 2>       getSurfaceTargetStr                     (int value)             { return tcu::Format::Enum<int, 2>(getSurfaceTargetName, value); }
 inline tcu::Format::Enum<int, 2>       getColorBufferTypeStr           (int value)             { return tcu::Format::Enum<int, 2>(getColorBufferTypeName, value); }
 inline tcu::Format::Enum<int, 2>       getConfigCaveatStr                      (int value)             { return tcu::Format::Enum<int, 2>(getConfigCaveatName, value); }
index bfa267d..edb58c5 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 #define EGL_PBUFFER_BIT                                                                                0x0001
 #define EGL_PIXMAP_BIT                                                                         0x0002
 #define EGL_YUV_PLANE_BPP_0_EXT                                                                0x331B
 #define EGL_YUV_PLANE_BPP_8_EXT                                                                0x331C
 #define EGL_YUV_PLANE_BPP_10_EXT                                                       0x331D
+#define EGL_COLOR_COMPONENT_TYPE_EXT                                           0x3339
+#define EGL_COLOR_COMPONENT_TYPE_FIXED_EXT                                     0x333A
+#define EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT                                     0x333B
index 353b6b2..e7d1327 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 EGLBoolean                                                                     bindAPI                                                 (EGLenum api) const;
 EGLBoolean                                                                     bindTexImage                                    (EGLDisplay dpy, EGLSurface surface, EGLint buffer) const;
index c1140a7..1678c71 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 
 EGLBoolean FuncPtrLibrary::bindAPI (EGLenum api) const
index b66bdfd..d57105e 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 typedef EGLW_APICALL EGLBoolean                                                                        (EGLW_APIENTRY* eglBindAPIFunc)                                                 (EGLenum api);
 typedef EGLW_APICALL EGLBoolean                                                                        (EGLW_APIENTRY* eglBindTexImageFunc)                                    (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
index 3f0ce29..af0d1b2 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 eglBindAPIFunc                                                 bindAPI;
 eglBindTexImageFunc                                            bindTexImage;
index b09f990..15f941d 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 dst->bindAPI                                           = (eglBindAPIFunc)                                                      loader->get("eglBindAPI");
 dst->bindTexImage                                      = (eglBindTexImageFunc)                                         loader->get("eglBindTexImage");
index 7ea82e4..90d00a1 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 dst->clientWaitSyncKHR                         = (eglClientWaitSyncKHRFunc)                            loader->get("eglClientWaitSyncKHR");
 dst->createImageKHR                                    = (eglCreateImageKHRFunc)                                       loader->get("eglCreateImageKHR");
index a9a42c8..a3d617d 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 virtual EGLBoolean                                                                     bindAPI                                                 (EGLenum api) const                                                                                                                                                                                             = 0;
 virtual EGLBoolean                                                                     bindTexImage                                    (EGLDisplay dpy, EGLSurface surface, EGLint buffer) const                                                                                                               = 0;
index d2d5ca0..22a2c5c 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
        { "eglBindAPI",                                                 (deFunctionPtr)eglBindAPI },
        { "eglBindTexImage",                                    (deFunctionPtr)eglBindTexImage },
index c9fafeb..a44c589 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
        { "eglBindAPI",                                                 (deFunctionPtr)eglBindAPI },
        { "eglBindTexImage",                                    (deFunctionPtr)eglBindTexImage },
index 50a2769..aab0156 100644 (file)
@@ -142,6 +142,17 @@ private:
                }
        }
 
+       static int getColorComponentTypeRank (EGLenum compType)
+       {
+               switch (compType)
+               {
+                       case EGL_COLOR_COMPONENT_TYPE_FIXED_EXT:        return 0;
+                       case EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT:        return 1;
+                       default:
+                               TCU_THROW(TestError, (std::string("Unknown color component type: ") + eglu::getColorComponentTypeStr(compType).toString()).c_str());
+               }
+       }
+
        typedef bool (*CompareFunc) (const SurfaceConfig& a, const SurfaceConfig& b);
 
        static bool compareCaveat (const SurfaceConfig& a, const SurfaceConfig& b)
@@ -159,6 +170,11 @@ private:
                return getYuvOrderRank((EGLenum)a.m_info.yuvOrder) < getYuvOrderRank((EGLenum)b.m_info.yuvOrder);
        }
 
+       static bool compareColorComponentType (const SurfaceConfig& a, const SurfaceConfig& b)
+       {
+               return getColorComponentTypeRank((EGLenum)a.m_info.colorComponentType) < getColorComponentTypeRank((EGLenum)b.m_info.colorComponentType);
+       }
+
        static bool compareColorBufferBits (const SurfaceConfig& a, const SurfaceConfig& b, const tcu::BVec4& specifiedRGBColors, const tcu::BVec2& specifiedLuminanceColors, bool yuvPlaneBppSpecified)
        {
                DE_ASSERT(a.m_info.colorBufferType == b.m_info.colorBufferType);
@@ -229,6 +245,7 @@ public:
                {
                        SurfaceConfig::compareCaveat,
                        SurfaceConfig::compareColorBufferType,
+                       SurfaceConfig::compareColorComponentType,
                        DE_NULL, // SurfaceConfig::compareColorBufferBits,
                        SurfaceConfig::compareAttributeSmaller<EGL_BUFFER_SIZE>,
                        SurfaceConfig::compareAttributeSmaller<EGL_SAMPLE_BUFFERS>,
@@ -307,6 +324,9 @@ public:
                rules[EGL_YUV_CSC_STANDARD_EXT]         = AttribRule(EGL_YUV_CSC_STANDARD_EXT,          EGL_DONT_CARE,          CRITERIA_EXACT,         SORTORDER_NONE);
                rules[EGL_YUV_PLANE_BPP_EXT]            = AttribRule(EGL_YUV_PLANE_BPP_EXT,                     EGL_DONT_CARE,          CRITERIA_AT_LEAST,      SORTORDER_SPECIAL);     //      3
 
+               // EGL_EXT_pixel_format_float
+               rules[EGL_COLOR_COMPONENT_TYPE_EXT]     = AttribRule(EGL_COLOR_COMPONENT_TYPE_EXT,      EGL_COLOR_COMPONENT_TYPE_FIXED_EXT,             CRITERIA_EXACT,         SORTORDER_SPECIAL);     //      2
+
                return rules;
        }
 private:
index 087ec0e..33fde9b 100644 (file)
@@ -1,7 +1,7 @@
 /* WARNING: This is auto-generated file. Do not modify, since changes will
  * be lost! Modify the generating script instead.
  *
- * Generated from Khronos EGL API description (egl.xml) revision 32725.
+ * Generated from Khronos EGL API description (egl.xml) revision 33315.
  */
 
 static const char* s_EGL14[] =
@@ -449,11 +449,21 @@ static const char* s_EGL_ANDROID_blob_cache[] =
        "eglSetBlobCacheFuncsANDROID",
 };
 
+static const char* s_EGL_ANDROID_create_native_client_buffer[] =
+{
+       "eglCreateNativeClientBufferANDROID",
+};
+
 static const char* s_EGL_ANDROID_native_fence_sync[] =
 {
        "eglDupNativeFenceFDANDROID",
 };
 
+static const char* s_EGL_ANDROID_presentation_time[] =
+{
+       "eglPresentationTimeANDROID",
+};
+
 static const char* s_EGL_ANGLE_query_surface_pointer[] =
 {
        "eglQuerySurfacePointerANGLE",
@@ -479,6 +489,12 @@ static const char* s_EGL_EXT_device_query[] =
        "eglQueryDisplayAttribEXT",
 };
 
+static const char* s_EGL_EXT_image_dma_buf_import_modifiers[] =
+{
+       "eglQueryDmaBufFormatsEXT",
+       "eglQueryDmaBufModifiersEXT",
+};
+
 static const char* s_EGL_EXT_output_base[] =
 {
        "eglGetOutputLayersEXT",
@@ -581,6 +597,15 @@ static const char* s_EGL_KHR_stream[] =
        "eglStreamAttribKHR",
 };
 
+static const char* s_EGL_KHR_stream_attrib[] =
+{
+       "eglCreateStreamAttribKHR",
+       "eglQueryStreamAttribKHR",
+       "eglSetStreamAttribKHR",
+       "eglStreamConsumerAcquireAttribKHR",
+       "eglStreamConsumerReleaseAttribKHR",
+};
+
 static const char* s_EGL_KHR_stream_consumer_gltexture[] =
 {
        "eglStreamConsumerAcquireKHR",
@@ -660,6 +685,11 @@ static const char* s_EGL_NV_stream_metadata[] =
        "eglSetStreamMetadataNV",
 };
 
+static const char* s_EGL_NV_stream_reset[] =
+{
+       "eglResetStreamNV",
+};
+
 static const char* s_EGL_NV_stream_sync[] =
 {
        "eglCreateStreamSyncNV",
@@ -1553,11 +1583,14 @@ static const struct
 } s_extensions[] =
 {
        { "EGL_ANDROID_blob_cache",                                                     DE_LENGTH_OF_ARRAY(s_EGL_ANDROID_blob_cache),                                           s_EGL_ANDROID_blob_cache                                                },
+       { "EGL_ANDROID_create_native_client_buffer",            DE_LENGTH_OF_ARRAY(s_EGL_ANDROID_create_native_client_buffer),          s_EGL_ANDROID_create_native_client_buffer               },
        { "EGL_ANDROID_native_fence_sync",                                      DE_LENGTH_OF_ARRAY(s_EGL_ANDROID_native_fence_sync),                            s_EGL_ANDROID_native_fence_sync                                 },
+       { "EGL_ANDROID_presentation_time",                                      DE_LENGTH_OF_ARRAY(s_EGL_ANDROID_presentation_time),                            s_EGL_ANDROID_presentation_time                                 },
        { "EGL_ANGLE_query_surface_pointer",                            DE_LENGTH_OF_ARRAY(s_EGL_ANGLE_query_surface_pointer),                          s_EGL_ANGLE_query_surface_pointer                               },
        { "EGL_EXT_device_base",                                                        DE_LENGTH_OF_ARRAY(s_EGL_EXT_device_base),                                                      s_EGL_EXT_device_base                                                   },
        { "EGL_EXT_device_enumeration",                                         DE_LENGTH_OF_ARRAY(s_EGL_EXT_device_enumeration),                                       s_EGL_EXT_device_enumeration                                    },
        { "EGL_EXT_device_query",                                                       DE_LENGTH_OF_ARRAY(s_EGL_EXT_device_query),                                                     s_EGL_EXT_device_query                                                  },
+       { "EGL_EXT_image_dma_buf_import_modifiers",                     DE_LENGTH_OF_ARRAY(s_EGL_EXT_image_dma_buf_import_modifiers),           s_EGL_EXT_image_dma_buf_import_modifiers                },
        { "EGL_EXT_output_base",                                                        DE_LENGTH_OF_ARRAY(s_EGL_EXT_output_base),                                                      s_EGL_EXT_output_base                                                   },
        { "EGL_EXT_platform_base",                                                      DE_LENGTH_OF_ARRAY(s_EGL_EXT_platform_base),                                            s_EGL_EXT_platform_base                                                 },
        { "EGL_EXT_stream_consumer_egloutput",                          DE_LENGTH_OF_ARRAY(s_EGL_EXT_stream_consumer_egloutput),                        s_EGL_EXT_stream_consumer_egloutput                             },
@@ -1573,6 +1606,7 @@ static const struct
        { "EGL_KHR_partial_update",                                                     DE_LENGTH_OF_ARRAY(s_EGL_KHR_partial_update),                                           s_EGL_KHR_partial_update                                                },
        { "EGL_KHR_reusable_sync",                                                      DE_LENGTH_OF_ARRAY(s_EGL_KHR_reusable_sync),                                            s_EGL_KHR_reusable_sync                                                 },
        { "EGL_KHR_stream",                                                                     DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream),                                                           s_EGL_KHR_stream                                                                },
+       { "EGL_KHR_stream_attrib",                                                      DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_attrib),                                            s_EGL_KHR_stream_attrib                                                 },
        { "EGL_KHR_stream_consumer_gltexture",                          DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_consumer_gltexture),                        s_EGL_KHR_stream_consumer_gltexture                             },
        { "EGL_KHR_stream_cross_process_fd",                            DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_cross_process_fd),                          s_EGL_KHR_stream_cross_process_fd                               },
        { "EGL_KHR_stream_fifo",                                                        DE_LENGTH_OF_ARRAY(s_EGL_KHR_stream_fifo),                                                      s_EGL_KHR_stream_fifo                                                   },
@@ -1587,6 +1621,7 @@ static const struct
        { "EGL_NV_post_sub_buffer",                                                     DE_LENGTH_OF_ARRAY(s_EGL_NV_post_sub_buffer),                                           s_EGL_NV_post_sub_buffer                                                },
        { "EGL_NV_stream_consumer_gltexture_yuv",                       DE_LENGTH_OF_ARRAY(s_EGL_NV_stream_consumer_gltexture_yuv),                     s_EGL_NV_stream_consumer_gltexture_yuv                  },
        { "EGL_NV_stream_metadata",                                                     DE_LENGTH_OF_ARRAY(s_EGL_NV_stream_metadata),                                           s_EGL_NV_stream_metadata                                                },
+       { "EGL_NV_stream_reset",                                                        DE_LENGTH_OF_ARRAY(s_EGL_NV_stream_reset),                                                      s_EGL_NV_stream_reset                                                   },
        { "EGL_NV_stream_sync",                                                         DE_LENGTH_OF_ARRAY(s_EGL_NV_stream_sync),                                                       s_EGL_NV_stream_sync                                                    },
        { "EGL_NV_sync",                                                                        DE_LENGTH_OF_ARRAY(s_EGL_NV_sync),                                                                      s_EGL_NV_sync                                                                   },
        { "EGL_NV_system_time",                                                         DE_LENGTH_OF_ARRAY(s_EGL_NV_system_time),                                                       s_EGL_NV_system_time                                                    },
index fc30091..a0ff8ae 100644 (file)
@@ -397,6 +397,11 @@ static bool isConformant (const eglu::CandidateConfig& c)
        return c.get(EGL_CONFIG_CAVEAT) != EGL_NON_CONFORMANT_CONFIG;
 }
 
+static bool notFloat (const eglu::CandidateConfig& c)
+{
+       return c.colorComponentType() != EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT;
+}
+
 void getDefaultRenderFilterLists (vector<RenderFilterList>& filterLists, const eglu::FilterList& baseFilters)
 {
        static const struct
@@ -450,7 +455,8 @@ void getDefaultRenderFilterLists (vector<RenderFilterList>& filterLists, const e
                                << notColorBits<4, 4, 4, 4>
                                << notColorBits<5, 5, 5, 1>
                                << notColorBits<8, 8, 8, 8>
-                               << isConformant;
+                               << isConformant
+                               << notFloat;
 
                filterLists.push_back(filters);
        }
index c528178..fc02455 100644 (file)
@@ -143,6 +143,11 @@ static bool isConformant (const eglu::CandidateConfig& c)
        return c.get(EGL_CONFIG_CAVEAT) != EGL_NON_CONFORMANT_CONFIG;
 }
 
+static bool notFloat (const eglu::CandidateConfig& c)
+{
+       return c.colorComponentType() != EGL_COLOR_COMPONENT_TYPE_FLOAT_EXT;
+}
+
 void getDefaultFilterLists (vector<NamedFilterList>& lists, const FilterList& baseFilters)
 {
        static const struct
@@ -209,7 +214,8 @@ void getDefaultFilterLists (vector<NamedFilterList>& lists, const FilterList& ba
                                << notColorBits<4, 4, 4, 4>
                                << notColorBits<5, 5, 5, 1>
                                << notColorBits<8, 8, 8, 8>
-                               << isConformant;
+                               << isConformant
+                               << notFloat;
 
                lists.push_back(filters);
        }
index bcd79a5..b8de44d 100644 (file)
@@ -6018,7 +6018,7 @@ static float sumOfRanks (const std::vector<deUint64>& testSamples, const std::ve
 template <typename Comparer>
 static DistributionCompareResult distributionCompare (const std::vector<deUint64>& orderedObservationsA, const std::vector<deUint64>& orderedObservationsB, const Comparer& comparer)
 {
-       // Mann\96Whitney U test
+       // Mann-Whitney U test
 
        const int                               n1                      = (int)orderedObservationsA.size();
        const int                               n2                      = (int)orderedObservationsB.size();
index 1f57b59..db7a8b9 100644 (file)
@@ -173,6 +173,8 @@ set(DEQP_GLES31_FUNCTIONAL_SRCS
        es31fCopyImageTests.cpp
        es31fDrawBuffersIndexedTests.hpp
        es31fDrawBuffersIndexedTests.cpp
+       es31fNegativeShaderStorageTests.cpp
+       es31fNegativeShaderStorageTests.hpp
        )
 
 add_library(deqp-gles31-functional STATIC ${DEQP_GLES31_FUNCTIONAL_SRCS})
index b4e9642..fa66729 100644 (file)
@@ -2130,11 +2130,11 @@ void addCopyTests (TestCaseGroup* root, deUint32 srcFormat, deUint32 dstFormat)
 
                        const string    targetTestName  = string(targetToName(srcTarget)) + "_to_" + targetToName(dstTarget);
 
-                       const IVec3             targetSize2D    (128, 128, 1);
-                       const IVec3             targetSize3D    (128, 128, 16);
-
-                       const IVec3             srcSize                 = getTestedSize(srcTarget, srcFormat, (srcIs3D ? targetSize3D : targetSize2D));
-                       const IVec3             dstSize                 = getTestedSize(dstTarget, dstFormat, (dstIs3D ? targetSize3D : targetSize2D));
+                       // Compressed formats require more space to fit all block size combinations.
+                       const bool              isCompressedCase        = glu::isCompressedFormat(srcFormat) || glu::isCompressedFormat(dstFormat);
+                       const IVec3             targetSize                      = isCompressedCase ? IVec3(128, 128, 16) : IVec3(64, 64, 8);
+                       const IVec3             srcSize                         = getTestedSize(srcTarget, srcFormat, targetSize);
+                       const IVec3             dstSize                         = getTestedSize(dstTarget, dstFormat, targetSize);
 
                        group->addChild(new CopyImageTest(root->getContext(),
                                                                                        ImageInfo(srcFormat, srcTarget, srcSize),
index d6dde30..b44d7e5 100644 (file)
@@ -36,6 +36,7 @@
 #include "es31fNegativeShaderDirectiveTests.hpp"
 #include "es31fNegativePreciseTests.hpp"
 #include "es31fNegativeAdvancedBlendEquationTests.hpp"
+#include "es31fNegativeShaderStorageTests.hpp"
 
 #include "deUniquePtr.hpp"
 #include "deRandom.hpp"
@@ -2954,6 +2955,7 @@ void DebugTests::init (void)
        const vector<FunctionContainer> shaderDirectiveFuncs     = wrapCoreFunctions(NegativeTestShared::getNegativeShaderDirectiveTestFunctions());
        const vector<FunctionContainer> preciseFuncs                     = wrapCoreFunctions(NegativeTestShared::getNegativePreciseTestFunctions());
        const vector<FunctionContainer> advancedBlendFuncs               = wrapCoreFunctions(NegativeTestShared::getNegativeAdvancedBlendEquationTestFunctions());
+       const vector<FunctionContainer> shaderStorageFuncs               = wrapCoreFunctions(NegativeTestShared::getNegativeShaderStorageTestFunctions());
        const vector<FunctionContainer> externalFuncs                    = getUserMessageFuncs();
 
        {
@@ -3059,6 +3061,7 @@ void DebugTests::init (void)
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "shader_directive",                       "Negative Shader Directive Cases",                                      shaderDirectiveFuncs));
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "precise",                                        "Negative Precise Cases",                                                       preciseFuncs));
                        host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "advanced_blend",                         "Negative Advanced Blend Equation Cases",                       advancedBlendFuncs));
+                       host->addChild(createChildCases(CASETYPE_CALLBACK, m_context, "shader_storage",                         "Negative Shader Storage Cases",                                        shaderStorageFuncs));
                }
 
                {
@@ -3081,6 +3084,7 @@ void DebugTests::init (void)
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "shader_directive",            "Negative Shader Directive Cases",                                      shaderDirectiveFuncs));
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "precise",                                     "Negative Precise Cases",                                                       preciseFuncs));
                        host->addChild(createChildCases(CASETYPE_LOG, m_context, "advanced_blend",                      "Negative Advanced Blend Equation Cases",                       advancedBlendFuncs));
+                       host->addChild(createChildCases(CASETYPE_LOG, m_context, "shader_storage",                      "Negative Shader Storage Cases",                                        shaderStorageFuncs));
                }
 
                {
@@ -3103,6 +3107,7 @@ void DebugTests::init (void)
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "shader_directive",                       "Negative Shader Directive Cases",                                      shaderDirectiveFuncs));
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "precise",                                        "Negative Precise Cases",                                                       preciseFuncs));
                        host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "advanced_blend",                         "Negative Advanced Blend Equation Cases",                       advancedBlendFuncs));
+                       host->addChild(createChildCases(CASETYPE_GETERROR, m_context, "shader_storage",                         "Negative Shader Storage Cases",                                        shaderStorageFuncs));
                }
        }
 
index e4b67cd..309a507 100644 (file)
@@ -446,15 +446,19 @@ void bind_buffer_range (NegativeTestContext& ctx)
                ctx.endSection();
 
                ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and offset is not multiples of 4.");
-               ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, 5, 0);
+               ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, 5, 4);
                ctx.expectError(GL_INVALID_VALUE);
                ctx.endSection();
 
-               ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and offset is not a multiple of the value of GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT.");
                ctx.glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &ssAlignment);
-               ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, 0, bufTF, ssAlignment+1, 0);
-               ctx.expectError(GL_INVALID_VALUE);
-               ctx.endSection();
+
+               if (ssAlignment != 1)
+               {
+                       ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and offset is not a multiple of the value of GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT.");
+                       ctx.glBindBufferRange(GL_SHADER_STORAGE_BUFFER, 0, bufTF, ssAlignment+1, 4);
+                       ctx.expectError(GL_INVALID_VALUE);
+                       ctx.endSection();
+               }
        }
 
        ctx.glDeleteBuffers(1, &bufU);
@@ -497,24 +501,6 @@ void bind_buffer_base (NegativeTestContext& ctx)
        ctx.expectError(GL_INVALID_VALUE);
        ctx.endSection();
 
-       if (contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)))
-       {
-               int maxACize = 0x1234;
-               int maxSSize = 0x1234;
-
-               ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_ATOMIC_COUNTER_BUFFER and index is greater than or equal to GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS.");
-               ctx.glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &maxACize);
-               ctx.glBindBufferRange(GL_ATOMIC_COUNTER_BUFFER, maxACize, bufU, 0, 4);
-               ctx.expectError(GL_INVALID_VALUE);
-               ctx.endSection();
-
-               ctx.beginSection("GL_INVALID_VALUE is generated if target is GL_SHADER_STORAGE_BUFFER and index is greater than or equal to GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS.");
-               ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxSSize);
-               ctx.glBindBufferRange(GL_SHADER_STORAGE_BUFFER, maxSSize, bufU, 0, 4);
-               ctx.expectError(GL_INVALID_VALUE);
-               ctx.endSection();
-       }
-
        ctx.glDeleteBuffers(1, &bufU);
        ctx.glDeleteBuffers(1, &bufTF);
 }
index 7c3fc0f..a80d6ca 100644 (file)
@@ -2334,7 +2334,7 @@ void link_compute_shader (NegativeTestContext& ctx)
        }
 }
 
-void compile_compute_shader_helper (NegativeTestContext& ctx, const char** computeShaderSource, GLint* compileStatus)
+void compile_compute_shader_helper (NegativeTestContext& ctx, const char* const* computeShaderSource, GLint* compileStatus)
 {
        GLuint shader = ctx.glCreateShader(GL_COMPUTE_SHADER);
 
@@ -2351,68 +2351,155 @@ void compile_compute_shader (NegativeTestContext& ctx)
        ctx.beginSection("Compile Computer Shader");
 
        {
-               const char* computeShaderSource         =       "#version 300 es\n"
-                                                                                               "void main (void)\n"
-                                                                                               "{\n"
-                                                                                               "}\n\0";
+               const char* const computeShaderSource           =       "#version 300 es\n"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
 
                compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
                if (compileStatus != GL_FALSE)
                        ctx.fail("Compute Shader should not have compiled with #version 300 es.");
        }
        {
-               const char* computeShaderSource         =       "#version 310 es\n"
-                                                                                               "buffer SSBO { vec4 data }"
-                                                                                               "void main (void)\n"
-                                                                                               "{\n"
-                                                                                               "}\n\0";
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "buffer SSBO { vec4 data }"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
 
                compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
                if (compileStatus != GL_FALSE)
                        ctx.fail("Compute Shader should not have compiled: incorrect SSBO syntax.");
        }
        {
-               const char* computeShaderSource         =       "#version 310 es\n"
-                                                                                               "buffer SSBO { vec4 data;};"
-                                                                                               "uniform mat4 data;"
-                                                                                               "void main (void)\n"
-                                                                                               "{\n"
-                                                                                               "}\n\0";
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "buffer SSBO { vec4 data;};"
+                                                                                                               "uniform mat4 data;"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
 
                compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
                if (compileStatus != GL_FALSE)
                        ctx.fail("Compute Shader should not have compiled: buffer variable redefinition.");
        }
        {
-               const char* computeShaderSource         =       "#version 310 es\n"
-                                                                                               "buffer SSBO { vec4 data[]; vec4 moreData;};"
-                                                                                               "void main (void)\n"
-                                                                                               "{\n"
-                                                                                               "}\n\0";
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "buffer SSBO { vec4 data[]; vec4 moreData;};"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
 
                compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
                if (compileStatus != GL_FALSE)
                        ctx.fail("Compute Shader should not have compiled: unspecified length buffer member not at the end.");
        }
        {
-               const char* computeShaderSource         =       "#version 310 es\n"
-                                                                                               "in vec4 data;"
-                                                                                               "void main (void)\n"
-                                                                                               "{\n"
-                                                                                               "}\n\0";
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "in vec4 data;"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
 
                compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
                if (compileStatus != GL_FALSE)
                        ctx.fail("Compute Shader should not have compiled: input qualifier used.");
        }
        {
-               const char* computeShaderSource         =       "#version 310 es\n"
-                                                                                               "shared uint data = 0;";
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "shared uint data = 0;";
 
                compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
                if (compileStatus != GL_FALSE)
                        ctx.fail("Compute Shader should not have compiled: shared-qualified variable initialized.");
        }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "buffer SSBO { vec4 data; vec4 moreData[];} ssbo;"
+                                                                                                               "void test (vec4 data[10]) {}"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "    test(ssbo.moreData);"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: unspecified length buffer member passed as argument to function.");
+       }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "buffer SSBO { vec4 data; vec4 moreData[];} ssbo;"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "    vec4 var = ssbo.moreData[-1];"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: unspecified length buffer member indexed with negative constant expression.");
+       }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "layout(binding=-1) buffer SSBO { vec4 data;};"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: binding point less than zero.");
+       }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "layout(binding=1) buffer;"
+                                                                                                               "layout(binding=2) buffer SSBO { vec4 data;};"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: binding point specified for global scope.");
+       }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "buffer SSBO {"
+                                                                                                               "       layout(binding=1) vec4 data;"
+                                                                                                               "       layout(binding=2) vec4 moreData[];"
+                                                                                                               "} ssbo;"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: binding point specified for block member declarations.");
+       }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "readonly buffer SSBO {vec4 data;} ssbo;"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                                       "ssbo.data = vec4(1, 1, 1, 1);"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: writing to buffer block qualified with readonly.");
+       }
+       {
+               const char* const computeShaderSource           =       "#version 310 es\n"
+                                                                                                               "writeonly buffer SSBO {vec4 data;} ssbo;"
+                                                                                                               "void main (void)\n"
+                                                                                                               "{\n"
+                                                                                                                       "vec4 var = ssbo.data;"
+                                                                                                               "}\n";
+
+               compile_compute_shader_helper(ctx, &computeShaderSource, &compileStatus);
+               if (compileStatus != GL_FALSE)
+                       ctx.fail("Compute Shader should not have compiled: reading from buffer block qualified with writeonly.");
+       }
+
        ctx.endSection();
 }
 
index 2b54462..f3b5ac4 100644 (file)
@@ -126,14 +126,42 @@ void primitive_bounding_box (NegativeTestContext& ctx)
        if (contextSupports(ctx.getRenderContext().getType() , glu::ApiType::es(3, 2)))
        {
                ctx.beginSection("gl_BoundingBox does not require the OES/EXT suffix in a 320 es shader.");
-               const std::string source =      "#version 320 es\n"
-                                                                       "layout(vertices = 3) out;\n"
-                                                                       "void main()\n"
-                                                                       "{\n"
-                                                                       "       gl_BoundingBox[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
-                                                                       "       gl_BoundingBox[1] = vec4(0.0, 0.0, 0.0, 0.0);\n"
-                                                                       "}\n";
-               verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_PASS);
+               {
+                       const std::string source =      "#version 320 es\n"
+                                                                               "layout(vertices = 3) out;\n"
+                                                                               "void main()\n"
+                                                                               "{\n"
+                                                                               "       gl_BoundingBox[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "       gl_BoundingBox[1] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "}\n";
+                       verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_PASS);
+               }
+               ctx.endSection();
+
+               ctx.beginSection("Invalid index used when assigning to gl_BoundingBox in 320 es shader.");
+               {
+                       const std::string source =      "#version 320 es\n"
+                                                                               "layout(vertices = 3) out;\n"
+                                                                               "void main()\n"
+                                                                               "{\n"
+                                                                               "       gl_BoundingBox[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "       gl_BoundingBox[2] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "}\n";
+                       verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_FAIL);
+               }
+               ctx.endSection();
+
+               ctx.beginSection("Invalid type assignment to per-patch output array in 320 es shader.");
+               {
+                       const std::string source =      "#version 320 es\n"
+                                                                               "layout(vertices = 3) out;\n"
+                                                                               "void main()\n"
+                                                                               "{\n"
+                                                                               "       gl_BoundingBox[0] = ivec4(0, 0, 0, 0);\n"
+                                                                               "       gl_BoundingBox[1] = ivec4(0, 0, 0, 0);\n"
+                                                                               "}\n";
+                       verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_FAIL);
+               }
                ctx.endSection();
        }
 }
diff --git a/modules/gles31/functional/es31fNegativeShaderStorageTests.cpp b/modules/gles31/functional/es31fNegativeShaderStorageTests.cpp
new file mode 100644 (file)
index 0000000..773d728
--- /dev/null
@@ -0,0 +1,324 @@
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.1 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2016 The Android Open Source Project
+ *
+ * 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 Negative Shader Storage Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "es31fNegativeShaderStorageTests.hpp"
+
+#include "gluShaderProgram.hpp"
+#include "glwDefs.hpp"
+#include "glwEnums.hpp"
+
+namespace deqp
+{
+namespace gles31
+{
+namespace Functional
+{
+namespace NegativeTestShared
+{
+namespace
+{
+
+void verifyProgram(NegativeTestContext& ctx, glu::ProgramSources sources)
+{
+       tcu::TestLog&                           log                     = ctx.getLog();
+       const glu::ShaderProgram        program         (ctx.getRenderContext(), sources);
+       bool                                            testFailed      = false;
+
+       log << program;
+
+       testFailed = program.getProgramInfo().linkOk;
+
+       if (testFailed)
+       {
+               const char* const message("Program was not expected to link.");
+               log << tcu::TestLog::Message << message << tcu::TestLog::EndMessage;
+               ctx.fail(message);
+       }
+}
+
+const char* getShaderExtensionDeclaration (glw::GLenum glShaderType)
+{
+       switch (glShaderType)
+       {
+               case GL_TESS_CONTROL_SHADER:
+               case GL_TESS_EVALUATION_SHADER: return "#extension GL_EXT_tessellation_shader : require\n";
+               case GL_GEOMETRY_SHADER:                return "#extension GL_EXT_geometry_shader : require\n";
+               default:
+                       return "";
+       }
+}
+
+glu::ShaderType getGLUShaderType (glw::GLenum glShaderType)
+{
+       switch (glShaderType)
+       {
+               case GL_VERTEX_SHADER:                   return glu::SHADERTYPE_VERTEX;
+               case GL_FRAGMENT_SHADER:                 return glu::SHADERTYPE_FRAGMENT;
+               case GL_TESS_CONTROL_SHADER:     return glu::SHADERTYPE_TESSELLATION_CONTROL;
+               case GL_TESS_EVALUATION_SHADER:  return glu::SHADERTYPE_TESSELLATION_EVALUATION;
+               case GL_GEOMETRY_SHADER:                 return glu::SHADERTYPE_GEOMETRY;
+               case GL_COMPUTE_SHADER:                  return glu::SHADERTYPE_COMPUTE;
+               default:
+                       DE_FATAL("Unknown shader type");
+                       return glu::SHADERTYPE_LAST;
+       }
+}
+
+glw::GLenum getMaxSSBlockSizeEnum (glw::GLenum glShaderType)
+{
+       switch (glShaderType)
+       {
+               case GL_VERTEX_SHADER:                   return GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS;
+               case GL_FRAGMENT_SHADER:                 return GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS;
+               case GL_TESS_CONTROL_SHADER:     return GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS;
+               case GL_TESS_EVALUATION_SHADER:  return GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS;
+               case GL_GEOMETRY_SHADER:                 return GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS;
+               case GL_COMPUTE_SHADER:                  return GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS;
+               default:
+                        DE_FATAL("Unknown shader type");
+                        return -1;
+       }
+}
+
+int getMaxSSBlockSize (NegativeTestContext& ctx, glw::GLenum glShaderType)
+{
+       int maxSSBlocks = 0;
+       ctx.glGetIntegerv(getMaxSSBlockSizeEnum(glShaderType), &maxSSBlocks);
+
+       return maxSSBlocks;
+}
+
+std::string genBlockSource (NegativeTestContext& ctx, deInt64 numSSBlocks, glw::GLenum shaderType)
+{
+       const bool                              isES32          = contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
+       const glu::GLSLVersion  version         = isES32 ? glu::GLSL_VERSION_320_ES : glu::GLSL_VERSION_310_ES;
+       std::ostringstream              source;
+
+       source  << glu::getGLSLVersionDeclaration(version) << "\n"
+                       << ((isES32) ? "" : getShaderExtensionDeclaration(shaderType));
+
+       switch (shaderType)
+       {
+               case GL_VERTEX_SHADER:
+               case GL_FRAGMENT_SHADER:
+                       break;
+
+               case GL_COMPUTE_SHADER:
+                       source << "layout (local_size_x = 1) in;\n";
+                       break;
+
+               case GL_GEOMETRY_SHADER:
+                       source << "layout(points) in;\n"
+                                  << "layout(line_strip, max_vertices = 3) out;\n";
+                       break;
+
+               case GL_TESS_CONTROL_SHADER:
+                       source << "layout(vertices = 10) out;\n";
+                       break;
+
+               case GL_TESS_EVALUATION_SHADER:
+                       source << "layout(triangles) in;\n";
+                       break;
+
+               default:
+                       DE_FATAL("Unknown shader type");
+                       break;
+       }
+
+       source  << "\n"
+                       << "layout(std430, binding = 0) buffer Block {\n"
+                       << "    int value;\n"
+                       << "} sb_in[" << numSSBlocks << "];\n"
+                       << "void main(void) { sb_in[0].value = 1; }\n";
+
+       return source.str();
+}
+
+std::string genCommonSource (NegativeTestContext& ctx, glw::GLenum shaderType)
+{
+       const bool                              isES32          = contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
+       const glu::GLSLVersion  version         = isES32 ? glu::GLSL_VERSION_320_ES : glu::GLSL_VERSION_310_ES;
+       std::ostringstream              source;
+
+       source << glu::getGLSLVersionDeclaration(version) << "\n"
+                  << ((isES32) ? "" : getShaderExtensionDeclaration(shaderType));
+
+       switch (shaderType)
+       {
+               case GL_TESS_CONTROL_SHADER:
+                       source  << "layout(vertices = 3) out;\n"
+                                       << "void main() {}\n";
+                       break;
+
+               case GL_TESS_EVALUATION_SHADER:
+                       source  << "layout(triangles, equal_spacing, cw) in;\n"
+                                       << "void main() {}\n";
+                       break;
+
+               default:
+                       source  << "void main() {}\n";
+                       break;
+       }
+
+       return source.str();
+}
+
+int genMaxSSBlocksSource (NegativeTestContext& ctx, glw::GLenum glShaderType, glu::ProgramSources& sources)
+{
+       int             maxSSBlocks                             = getMaxSSBlockSize(ctx, glShaderType);
+       const   std::string shaderSrc   = genBlockSource(ctx, (maxSSBlocks), glShaderType);
+
+       sources.sources[getGLUShaderType(glShaderType)].push_back(shaderSrc);
+
+       return maxSSBlocks;
+}
+
+void block_number_limits (NegativeTestContext& ctx)
+{
+       const glw::GLenum glShaderTypes[] =
+       {
+               GL_VERTEX_SHADER,
+               GL_FRAGMENT_SHADER,
+               GL_TESS_CONTROL_SHADER,
+               GL_TESS_EVALUATION_SHADER,
+               GL_GEOMETRY_SHADER,
+               GL_COMPUTE_SHADER,
+       };
+
+       const std::string       vertSource                      = genCommonSource(ctx, GL_VERTEX_SHADER);
+       const std::string       fragSource                      = genCommonSource(ctx, GL_FRAGMENT_SHADER);
+       const std::string       tessControlSource       = genCommonSource(ctx, GL_TESS_CONTROL_SHADER);
+       const std::string       tessEvalSource          = genCommonSource(ctx, GL_TESS_EVALUATION_SHADER);
+
+       for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(glShaderTypes); ndx++)
+       {
+               ctx.beginSection("maxShaderStorageBlocks: Exceed limits");
+
+               int                                     maxSSBlocks                     = getMaxSSBlockSize(ctx, glShaderTypes[ndx]);
+               std::string                     source                          = genBlockSource(ctx, maxSSBlocks+1, glShaderTypes[ndx]);
+
+               glu::ProgramSources sources;
+
+               if (maxSSBlocks == 0 || !ctx.isShaderSupported(static_cast<glu::ShaderType>(getGLUShaderType(glShaderTypes[ndx]))))
+               {
+                       ctx.endSection();
+                       continue;
+               }
+
+               switch (glShaderTypes[ndx])
+               {
+                       case GL_VERTEX_SHADER:
+                               sources << glu::VertexSource(source)
+                                               << glu::FragmentSource(fragSource);
+                               break;
+
+                       case GL_FRAGMENT_SHADER:
+                               sources << glu::VertexSource(vertSource)
+                                               << glu::FragmentSource(source);
+                               break;
+
+                       case GL_TESS_CONTROL_SHADER:
+                               sources << glu::VertexSource(vertSource)
+                                               << glu::FragmentSource(fragSource)
+                                               << glu::TessellationControlSource(source)
+                                               << glu::TessellationEvaluationSource(tessEvalSource);
+                               break;
+
+                       case GL_TESS_EVALUATION_SHADER:
+                               sources << glu::VertexSource(vertSource)
+                                               << glu::FragmentSource(fragSource)
+                                               << glu::TessellationControlSource(tessControlSource)
+                                               << glu::TessellationEvaluationSource(source);
+                               break;
+
+                       case GL_GEOMETRY_SHADER:
+                               sources << glu::VertexSource(vertSource)
+                                               << glu::FragmentSource(fragSource)
+                                               << glu::GeometrySource(source);
+                               break;
+
+                       case GL_COMPUTE_SHADER:
+                               sources << glu::ComputeSource(source);
+                               break;
+
+                       default:
+                               DE_FATAL("Unknown shader type");
+                               break;
+               }
+
+               verifyProgram(ctx, sources);
+               ctx.endSection();
+       }
+}
+
+void max_combined_block_number_limit (NegativeTestContext& ctx)
+{
+       ctx.beginSection("maxCombinedShaderStorageBlocks: Exceed limits");
+
+       glu::ProgramSources sources;
+
+       int combinedSSBlocks    = 0;
+       int maxCombinedSSBlocks = 0;
+
+       combinedSSBlocks += genMaxSSBlocksSource(ctx, GL_VERTEX_SHADER, sources);
+       combinedSSBlocks += genMaxSSBlocksSource(ctx, GL_FRAGMENT_SHADER, sources);
+
+       if ((ctx.isShaderSupported(glu::SHADERTYPE_TESSELLATION_CONTROL)) && (ctx.isShaderSupported(glu::SHADERTYPE_TESSELLATION_EVALUATION)))
+       {
+               combinedSSBlocks += genMaxSSBlocksSource(ctx, GL_TESS_CONTROL_SHADER, sources);
+               combinedSSBlocks += genMaxSSBlocksSource(ctx, GL_TESS_EVALUATION_SHADER, sources);
+       }
+
+       if (ctx.isShaderSupported(glu::SHADERTYPE_GEOMETRY))
+               combinedSSBlocks += genMaxSSBlocksSource(ctx, GL_GEOMETRY_SHADER, sources);
+
+       ctx.glGetIntegerv(GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS, &maxCombinedSSBlocks);
+
+       ctx.getLog() << tcu::TestLog::Message << "GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS: " << maxCombinedSSBlocks << tcu::TestLog::EndMessage;
+       ctx.getLog() << tcu::TestLog::Message << "Combined shader storage blocks: " << combinedSSBlocks << tcu::TestLog::EndMessage;
+
+       if (combinedSSBlocks > maxCombinedSSBlocks)
+               verifyProgram(ctx, sources);
+       else
+               ctx.getLog() << tcu::TestLog::Message << "Test skipped: Combined shader storage blocks < GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS: " << tcu::TestLog::EndMessage;
+
+       ctx.endSection();
+}
+
+} // anonymous
+
+std::vector<FunctionContainer> getNegativeShaderStorageTestFunctions ()
+{
+       const FunctionContainer funcs[] =
+       {
+               { block_number_limits,                          "block_number_limits",                          "Invalid shader linkage" },
+               { max_combined_block_number_limit,      "max_combined_block_number_limit",      "Invalid shader linkage" },
+       };
+
+       return std::vector<FunctionContainer>(DE_ARRAY_BEGIN(funcs), DE_ARRAY_END(funcs));
+}
+
+} // NegativeTestShared
+} // Functional
+} // gles31
+} // deqp
diff --git a/modules/gles31/functional/es31fNegativeShaderStorageTests.hpp b/modules/gles31/functional/es31fNegativeShaderStorageTests.hpp
new file mode 100644 (file)
index 0000000..13cbd1f
--- /dev/null
@@ -0,0 +1,45 @@
+#ifndef _ES31FNEGATIVESHADERSTORAGETESTS_HPP
+#define _ES31FNEGATIVESHADERSTORAGETESTS_HPP
+/*-------------------------------------------------------------------------
+ * drawElements Quality Program OpenGL ES 3.1 Module
+ * -------------------------------------------------
+ *
+ * Copyright 2016 The Android Open Source Project
+ *
+ * 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 Negative Shader Storage Tests
+ *//*--------------------------------------------------------------------*/
+
+#include "tcuDefs.hpp"
+#include "es31fNegativeTestShared.hpp"
+
+namespace deqp
+{
+namespace gles31
+{
+namespace Functional
+{
+namespace NegativeTestShared
+{
+
+std::vector<FunctionContainer> getNegativeShaderStorageTestFunctions (void);
+
+} // NegativeTestShared
+} // Functional
+} // gles31
+} // deqp
+
+#endif // _ES31FNEGATIVESHADERSTORAGETESTS_HPP
index 1f1cfeb..19184c6 100644 (file)
@@ -184,8 +184,9 @@ void get_integer64v (NegativeTestContext& ctx)
 
 void get_integeri_v (NegativeTestContext& ctx)
 {
-       GLint data                                              = -1;
-       GLint maxUniformBufferBindings  = 0;
+       GLint data                                                              = -1;
+       GLint maxUniformBufferBindings                  =  0;
+       GLint maxShaderStorageBufferBindings    =  0;
 
        ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
        ctx.glGetIntegeri_v(-1, 0, &data);
@@ -198,12 +199,20 @@ void get_integeri_v (NegativeTestContext& ctx)
        ctx.glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data);
        ctx.expectError(GL_INVALID_VALUE);
        ctx.endSection();
+
+       ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
+       ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings);
+       ctx.expectError(GL_NO_ERROR);
+       ctx.glGetIntegeri_v(GL_SHADER_STORAGE_BUFFER_BINDING, maxShaderStorageBufferBindings, &data);
+       ctx.expectError(GL_INVALID_VALUE);
+       ctx.endSection();
 }
 
 void get_integer64i_v (NegativeTestContext& ctx)
 {
-       GLint64 data                                            = (GLint64)-1;
-       GLint   maxUniformBufferBindings        = 0;
+       GLint64 data                                                    = (GLint64)-1;
+       GLint   maxUniformBufferBindings                = 0;
+       GLint   maxShaderStorageBufferBindings  = 0;
 
        ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
        ctx.glGetInteger64i_v(-1, 0, &data);
@@ -216,6 +225,15 @@ void get_integer64i_v (NegativeTestContext& ctx)
        ctx.glGetInteger64i_v(GL_UNIFORM_BUFFER_START, maxUniformBufferBindings, &data);
        ctx.expectError(GL_INVALID_VALUE);
        ctx.endSection();
+
+       ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
+       ctx.glGetIntegerv(GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &maxShaderStorageBufferBindings);
+       ctx.expectError(GL_NO_ERROR);
+       ctx.glGetInteger64i_v(GL_SHADER_STORAGE_BUFFER_START, maxShaderStorageBufferBindings, &data);
+       ctx.expectError(GL_INVALID_VALUE);
+       ctx.glGetInteger64i_v(GL_SHADER_STORAGE_BUFFER_SIZE, maxShaderStorageBufferBindings, &data);
+       ctx.expectError(GL_INVALID_VALUE);
+       ctx.endSection();
 }
 
 void get_string (NegativeTestContext& ctx)
index e367fd3..cabb96f 100644 (file)
@@ -7230,7 +7230,7 @@ void TessellationTests::init (void)
                queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_evaluation_texture_image_units",                   "Test MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS",                 GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS,             16));
                queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_control_output_components",                                "Test MAX_TESS_CONTROL_OUTPUT_COMPONENTS",                              GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS,                  64));
                queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_patch_components",                                                 "Test MAX_TESS_PATCH_COMPONENTS",                                               GL_MAX_TESS_PATCH_COMPONENTS,                                   120));
-               queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_control_total_output_components",                  "Test MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS",                GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS,    4096));
+               queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_control_total_output_components",                  "Test MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS",                GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS,    2048));
                queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_evaluation_output_components",                             "Test MAX_TESS_EVALUATION_OUTPUT_COMPONENTS",                   GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS,               64));
                queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_control_uniform_blocks",                                   "Test MAX_TESS_CONTROL_UNIFORM_BLOCKS",                                 GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS,                             12));
                queryGroup->addChild(new LimitQueryCase(m_context, "max_tess_evaluation_uniform_blocks",                                "Test MAX_TESS_EVALUATION_UNIFORM_BLOCKS",                              GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS,                  12));
index 3901ec1..791d8c9 100644 (file)
@@ -232,6 +232,12 @@ static const FormatExtEntry s_esExtFormats[] =
                (deUint32)(DEPTH_RENDERABLE | STENCIL_RENDERABLE | TEXTURE_VALID),
                GLS_ARRAY_RANGE(s_oesPackedDepthStencilTexFormats)
        },
+       // The ANGLE extension incorporates GL_OES_depth_texture/GL_OES_packed_depth_stencil.
+       {
+               "GL_ANGLE_depth_texture",
+               (deUint32)(REQUIRED_RENDERABLE | DEPTH_RENDERABLE | TEXTURE_VALID),
+               GLS_ARRAY_RANGE(s_oesDepthTextureFormats),
+       },
        // \todo [2013-12-10 lauri] Find out if OES_texture_half_float is really a
        // requirement on ES3 also. Or is color_buffer_half_float applicatble at
        // all on ES3, since there's also EXT_color_buffer_float?
index 7554f2b..c8761ce 100644 (file)
@@ -39,8 +39,8 @@ EGL_WRAPPER_DIR               = os.path.normpath(os.path.join(EGL_DIR, "wrapper"))
 
 EGL_SOURCE                     = khr_util.registry_cache.RegistrySource(
                                                "egl.xml",
-                                               32725,
-                                               "3464385212ae9b816d121c77bc4191ed3dfb32ce7bfca1a02b42fcefa3ec2354")
+                                               33315,
+                                               "19f3b517f0dede56a6a94b820d08149ef5e1726f58202f47d69fa27f6f483bd2")
 
 VERSION                                = '1.5'
 
@@ -65,7 +65,8 @@ EXTENSIONS                    = [
        "EGL_EXT_buffer_age",
        "EGL_KHR_partial_update",
        "EGL_KHR_swap_buffers_with_damage",
-       "EGL_KHR_mutable_render_buffer"
+       "EGL_KHR_mutable_render_buffer",
+       "EGL_EXT_pixel_format_float"
 ]
 PROTECTS                       = [
        "KHRONOS_SUPPORT_INT64"
index 4372932..b77e69b 100644 (file)
@@ -141,6 +141,7 @@ ENUM_GROUPS = [
                "YUV_PLANE_BPP_8_EXT",
                "YUV_PLANE_BPP_10_EXT",
                ]),
+       ("ColorComponentType",  ["COLOR_COMPONENT_TYPE_FIXED_EXT", "COLOR_COMPONENT_TYPE_FLOAT_EXT"]),
        ("SurfaceTarget",               ["READ", "DRAW"]),
 
        # ConfigAttrib values