Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/DXIL/DxilShaderFlags.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
continue;
if (hlsl::OP::IsDxilOpWave(dxilOp))
hasWaveOps = true;
if (hlsl::OP::IsDxilOpFeedback(dxilOp))
hasSamplerFeedback = true;
switch (dxilOp) {
case DXIL::OpCode::CheckAccessFullyMapped:
hasCheckAccessFully = true;
Expand Down Expand Up @@ -821,6 +823,11 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
// Before validator version 1.8, RequiresGroup flag did not exist.
requiresGroup = false;
}
if (hasSamplerFeedback &&
DXIL::CompareVersions(valMajor, valMinor, 1, 9) < 0) {
// Before validator version 1.9, SamplerFeedback flag was not set.
hasSamplerFeedback = false;
}

flag.SetEnableDoublePrecision(hasDouble);
flag.SetStencilRef(hasStencilRef);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// RUN: %dxc -E main -T ps_6_5 %s | FileCheck %s -check-prefix=FLAG
// RUN: %dxc -E main -T ps_6_5 -validator-version 1.8 %s | FileCheck %s -check-prefix=NOFLAG

// Verify that the Sampler feedback shader feature flag is set when any
// sampler feedback instruction is used, and that it is gated off for
// validator versions before 1.9.

// FLAG: Note: shader requires additional functionality:
// FLAG: Sampler feedback

// NOFLAG-NOT: Sampler feedback

FeedbackTexture2D<SAMPLER_FEEDBACK_MIN_MIP> feedbackMinMip;
Texture2D<float> texture2D;
SamplerState samp;

float main() : SV_Target {
feedbackMinMip.WriteSamplerFeedback(texture2D, samp, (float2)0);
return 0;
}
Loading