We previously set this device limit to infinity to avoid having to clamp the sum of the sampler and shader provided bias values to the [-maxSamplerLodBias, maxSamplerLodBias] range. Unfortunately infinity is not supported/allowed by JSON and the android.graphics.cts.VulkanFeaturesTest tests which parse the output of the vkjson tool produce a failure. This change works around it by setting maxSamplerLodBias to a finite value (15, which is very common according to https://vulkan.gpuinfo.org/), and performing the clamping required by Vulkan 1.1.117 section 15.6.7. Fortunately this cost only has to be incurred when an optional Bias operand is used in the SPIR-V image sampling instruction. When an Lod operand is used, which is mutually exclusive with Bias because the former is for explicit-lod instructions and the latter for implicit-lod, no clamping is required because the explicit LOD is not part of this clamping equation and the sampler LOD bias must already be clamped as specified by the spec: "The absolute value of mipLodBias must be less than or equal to VkPhysicalDeviceLimits::maxSamplerLodBias". Bug: b/138670766 Change-Id: Iebd6a1fef1c993ec86ac8cc38f8d9a992ba9bc47 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/34510Tested-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| BUILD.gn | Loading commit data... | |
| Version.h | Loading commit data... | |
| VkBuffer.cpp | Loading commit data... | |
| VkBuffer.hpp | Loading commit data... | |
| VkBufferView.cpp | Loading commit data... | |
| VkBufferView.hpp | Loading commit data... | |
| VkCommandBuffer.cpp | Loading commit data... | |
| VkCommandBuffer.hpp | Loading commit data... | |
| VkCommandPool.cpp | Loading commit data... | |
| VkCommandPool.hpp | Loading commit data... | |
| VkConfig.h | Loading commit data... | |
| VkDebug.cpp | Loading commit data... | |
| VkDebug.hpp | Loading commit data... | |
| VkDescriptorPool.cpp | Loading commit data... | |
| VkDescriptorPool.hpp | Loading commit data... | |
| VkDescriptorSet.hpp | Loading commit data... | |
| VkDescriptorSetLayout.cpp | Loading commit data... | |
| VkDescriptorSetLayout.hpp | Loading commit data... | |
| VkDescriptorUpdateTemplate.cpp | Loading commit data... | |
| VkDescriptorUpdateTemplate.hpp | Loading commit data... | |
| VkDestroy.h | Loading commit data... | |
| VkDevice.cpp | Loading commit data... | |
| VkDevice.hpp | Loading commit data... | |
| VkDeviceMemory.cpp | Loading commit data... | |
| VkDeviceMemory.hpp | Loading commit data... | |
| VkEvent.hpp | Loading commit data... | |
| VkFence.hpp | Loading commit data... | |
| VkFormat.cpp | Loading commit data... | |
| VkFormat.h | Loading commit data... | |
| VkFramebuffer.cpp | Loading commit data... | |
| VkFramebuffer.hpp | Loading commit data... | |
| VkGetProcAddress.cpp | Loading commit data... | |
| VkGetProcAddress.h | Loading commit data... | |
| VkImage.cpp | Loading commit data... | |
| VkImage.hpp | Loading commit data... | |
| VkImageView.cpp | Loading commit data... | |
| VkImageView.hpp | Loading commit data... | |
| VkInstance.cpp | Loading commit data... | |
| VkInstance.hpp | Loading commit data... | |
| VkMemory.cpp | Loading commit data... | |
| VkMemory.h | Loading commit data... | |
| VkObject.hpp | Loading commit data... | |
| VkPhysicalDevice.cpp | Loading commit data... | |
| VkPhysicalDevice.hpp | Loading commit data... | |
| VkPipeline.cpp | Loading commit data... | |
| VkPipeline.hpp | Loading commit data... | |
| VkPipelineCache.cpp | Loading commit data... | |
| VkPipelineCache.hpp | Loading commit data... | |
| VkPipelineLayout.cpp | Loading commit data... | |
| VkPipelineLayout.hpp | Loading commit data... | |
| VkPromotedExtensions.cpp | Loading commit data... | |
| VkQueryPool.cpp | Loading commit data... | |
| VkQueryPool.hpp | Loading commit data... | |
| VkQueue.cpp | Loading commit data... | |
| VkQueue.hpp | Loading commit data... | |
| VkRenderPass.cpp | Loading commit data... | |
| VkRenderPass.hpp | Loading commit data... | |
| VkSampler.cpp | Loading commit data... | |
| VkSampler.hpp | Loading commit data... | |
| VkSemaphore.hpp | Loading commit data... | |
| VkShaderModule.cpp | Loading commit data... | |
| VkShaderModule.hpp | Loading commit data... | |
| Vulkan.rc | Loading commit data... | |
| VulkanPlatform.h | Loading commit data... | |
| libVulkan.cpp | Loading commit data... | |
| libvk_swiftshader.def | Loading commit data... | |
| libvk_swiftshader.exports | Loading commit data... | |
| libvk_swiftshader.lds | Loading commit data... | |
| main.cpp | Loading commit data... | |
| resource.h | Loading commit data... | |
| vk_swiftshader_icd.json | Loading commit data... | |
| vk_swiftshader_icd.json.tmpl | Loading commit data... | |
| vulkan.vcxproj | Loading commit data... | |
| vulkan.vcxproj.filters | Loading commit data... |