Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • src
  • Vulkan
  • VkPhysicalDevice.cpp
Find file
BlameHistoryPermalink
  • Nicolas Capens's avatar
    Use a finite maxSamplerLodBias limit · 324bdfed
    Nicolas Capens authored Jul 30, 2019
    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: 's avatarNicolas Capens <nicolascapens@google.com>
    Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
    Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
    324bdfed
VkPhysicalDevice.cpp 26.9 KB
EditWeb IDE
×

Replace VkPhysicalDevice.cpp

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.