Skip to content

Orthogonal comparison sampling #30

@jenatali

Description

@jenatali

Is your feature request related to a problem? Please describe.
In Vulkan/SPIR-V, for every type of sampling operation you can do, there exists a corresponding comparison sample operation. Shader model 6.7's "advanced texture ops" improved the situation by adding explicit-LOD comparison sampling, but D3D/DXIL is still missing:

  • Bias
  • Gradient
  • Mip level computation (must be passed a non-comparison sampler)

Describe the solution you'd like
I'd like to see shader model 6.8 add new intrinsics for these operations, or relax restrictions (e.g. mip level computation simply fails DXIL validation).

Describe alternatives you've considered
The only alternative I can see would be to add a non-comparison sampler to the shader for every comparison sampler, and to rewrite the shader for bias to explicitly compute derivatives, and then for bias/gradient to explicitly compute a mip level (using the non-comparison sampler), and then do an explicit-LOD sample. This is... ugly.

Additional context
This is needed for VulkanOn12 aka Dozen.

Metadata

Metadata

Assignees

Labels

Requires Shader ModelFeature requests that require DXIL and Shader Model updates

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions