Fix dependency on unspecified rounding mode
authorStephen Clarke <stephen.clarke@imgtec.com>
Tue, 15 Jan 2019 11:32:49 +0000 (11:32 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 24 Jan 2019 19:34:23 +0000 (14:34 -0500)
These tests perform an addition whose Rounding mode is unspecified
according to the specification.  This test is not testing addition,
it is testing that the input values are read correctly, so modify
the input values such that they do not require rounding.

Affected tests:
* dEQP-VK.spirv_assembly.instruction.compute.indexing.input.non16basealignment*

Components: Vulkan

VK-GL-CTS issue: 1473
Change-Id: Ifab284d95cc2e36c3a551c30d57deeca7bd8d4b2

external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmIndexingTests.cpp

index 5ad6941..c543d96 100644 (file)
@@ -675,7 +675,14 @@ void addComputeIndexingNon16BaseAlignmentTests (tcu::TestCaseGroup* group)
 
        inputData.reserve(numInputFloats);
        for (deUint32 numIdx = 0; numIdx < numInputFloats; ++numIdx)
-               inputData.push_back(rnd.getFloat());
+       {
+               float f = rnd.getFloat();
+
+               // CPU might not use the same rounding mode as the GPU. Use whole numbers to avoid rounding differences.
+               f = deFloatFloor(f);
+
+               inputData.push_back(f);
+       }
 
        spec.inputs.push_back(Resource(BufferSp(new Float32Buffer(inputData)), VK_DESCRIPTOR_TYPE_STORAGE_BUFFER));