Fixes pipeline tests to check for maxSamplerLodBias
authorMatthew Netsch <quic_mnetsch@quicinc.com>
Wed, 24 Apr 2019 16:02:30 +0000 (12:02 -0400)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Wed, 24 Apr 2019 16:21:15 +0000 (12:21 -0400)
Components: Vulkan
VK-GL-CTS Issue: 1750

Affects:
dEQP-VK.pipeline.sampler.*

Change-Id: I1ed594f0eb5cf8e249eda5eb31b114f1bfb93fd2

external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp

index d7aa9aa..75c07d5 100644 (file)
@@ -217,14 +217,18 @@ ImageSamplingInstance::ImageSamplingInstance (Context&                                                    context,
        , m_colorFormat                 (VK_FORMAT_R8G8B8A8_UNORM)
        , m_vertices                    (vertices)
 {
-       const InstanceInterface&        vki                                             = context.getInstanceInterface();
-       const DeviceInterface&          vk                                              = context.getDeviceInterface();
-       const VkPhysicalDevice          physDevice                              = context.getPhysicalDevice();
-       const VkDevice                          vkDevice                                = context.getDevice();
-       const VkQueue                           queue                                   = context.getUniversalQueue();
-       const deUint32                          queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
-       SimpleAllocator                         memAlloc                                (vk, vkDevice, getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), context.getPhysicalDevice()));
-       const VkComponentMapping        componentMappingRGBA    = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
+       const InstanceInterface&                        vki                                             = context.getInstanceInterface();
+       const DeviceInterface&                          vk                                              = context.getDeviceInterface();
+       const VkPhysicalDevice                          physDevice                              = context.getPhysicalDevice();
+       const VkDevice                                          vkDevice                                = context.getDevice();
+       const VkQueue                                           queue                                   = context.getUniversalQueue();
+       const deUint32                                          queueFamilyIndex                = context.getUniversalQueueFamilyIndex();
+       SimpleAllocator                                         memAlloc                                (vk, vkDevice, getPhysicalDeviceMemoryProperties(context.getInstanceInterface(), context.getPhysicalDevice()));
+       const VkComponentMapping                        componentMappingRGBA    = { VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_B, VK_COMPONENT_SWIZZLE_A };
+       const vk::VkPhysicalDeviceLimits        limits                                  = getPhysicalDeviceProperties(vki, physDevice).limits;
+
+       if (de::abs(samplerParams.mipLodBias) > limits.maxSamplerLodBias)
+               TCU_THROW(NotSupportedError, "Unsupported sampler Lod bias value");
 
        if (!isSupportedSamplableFormat(context.getInstanceInterface(), context.getPhysicalDevice(), imageFormat))
                throw tcu::NotSupportedError(std::string("Unsupported format for sampling: ") + getFormatName(imageFormat));