Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Bring Expanded Comparison Sampling up to date with the specification #6162

Closed
pow2clk opened this issue Jan 19, 2024 · 1 comment
Assignees
Labels
enhancement Feature suggestion sm6.8 Shader Model 6.8

Comments

@pow2clk
Copy link
Member

pow2clk commented Jan 19, 2024

Since Expanded Comparison Sampling implementation (#5560) there have been some additions to the spec (microsoft/hlsl-specs#147). This includes some additional diagnostics, tests, and a feature capability bit.

Describe the solution you'd like

Details of all the below can be found in the spec.

*** Feature Bit ***

ExtendedComparisonSampling is a new feature info flag added to SFI0.
It's value is 0x80000000.
It indicates that the shadermakes use of SampleCmpBias or SampleCmpGrad.
This indicates to the runtime that that the shader requires the presence of
the corresponding capability bit.

Testing

  • SampleCmpBias in an entry point of an unsupported shader stage should produce an appropriate error.

  • SampleCmpBias, SampleCmpGrad, and the new CalculateLevelOfDetail* overloads in an unsupported shader model should produce an appropriate error.

  • Violating the bias range limits tested by SampleBiasFail in ValidationTest with dx.op.sampleCmpBias should produce a validation error

  • Using invalid Test that DXIL validation of allowed resource types must be performed for
    dx.op.sampleCmpBias and dx.op.sampleCmpGrad:

  • Instr.SampleCompType - texture resources are declared with types that are
    sampleable in the current environment.

  • Instr.SamplerModeForSampleC - sampler resource used by SampleCmpBias and
    SampleCmpGrad are of type SamplerComparisonState.

  • Instr.ResourceKindForCalcLOD - texture resources used by
    CalculateLevelOfDetail* are among the valid texture objects.

  • Instr.ResourceKindForSample - texture resources used by
    SampleCmpBias and SampleCmpGrad are among the valid texture objects.

  • Instr.ResourceClassForSamplerGather - texture resources used by
    SampleCmpBias and SampleCmpGrad must be SRVs.

@pow2clk pow2clk added enhancement Feature suggestion sm6.8 Shader Model 6.8 labels Jan 19, 2024
@pow2clk pow2clk added this to the Shader Model 6.8 milestone Jan 19, 2024
@pow2clk
Copy link
Member Author

pow2clk commented Feb 12, 2024

Fixed by #6204

@pow2clk pow2clk closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature suggestion sm6.8 Shader Model 6.8
Projects
Status: Done
Development

No branches or pull requests

2 participants