Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 0 additions & 2 deletions include/dxc/Support/HLSLOptions.td
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ def print_before_all : Flag<["-", "/"], "print-before-all">, Group<hlslcomp_Grou
HelpText<"Print LLVM IR before each pass.">;
def print_before : Separate<["-", "/"], "print-before">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
HelpText<"Print LLVM IR before a specific pass. May be specificied multiple times.">;
def select_validator : Separate<["-", "/"], "select-validator">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
HelpText<"Select validator: auto: (default) use DXIL.dll if found, otherwise use internal; internal: internal non-signing validator; external: use DXIL.dll if found, otherwise fail compilation.">;
def print_after_all : Flag<["-", "/"], "print-after-all">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
HelpText<"Print LLVM IR after each pass.">;
def print_after : Separate<["-", "/"], "print-after">, Group<hlslcomp_Group>, Flags<[CoreOption, HelpHidden]>,
Expand Down
14 changes: 0 additions & 14 deletions lib/DxcSupport/HLSLOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,20 +1033,6 @@ int ReadDxcOpts(const OptTable *optionTable, unsigned flagsToInclude,
opts.ValVerMinor = (unsigned long)minor64;
}

llvm::StringRef valSelectStr = Args.getLastArgValue(OPT_select_validator);
if (!valSelectStr.empty()) {
opts.SelectValidator = llvm::StringSwitch<ValidatorSelection>(valSelectStr)
.Case("auto", ValidatorSelection::Auto)
.Case("internal", ValidatorSelection::Internal)
.Case("external", ValidatorSelection::External)
.Default(ValidatorSelection::Invalid);
if (opts.SelectValidator == ValidatorSelection::Invalid) {
errors << "Unsupported value '" << valSelectStr
<< "for -select-validator option.";
return 1;
}
}

if (opts.IsLibraryProfile() && Minor == 0xF) {
if (opts.ValVerMajor != UINT_MAX && opts.ValVerMajor != 0) {
errors << "Offline library profile cannot be used with non-zero "
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %dxc -T ps_6_8 -E main -Qkeep_reflect_in_dxil -select-validator internal %s | FileCheck -check-prefix=CHECK68 %s
// RUN: %dxc -T ps_6_7 -E main -Qkeep_reflect_in_dxil -select-validator internal %s | FileCheck -check-prefix=CHECK67 %s
// RUN: %dxc -T ps_6_8 -E main -Qkeep_reflect_in_dxil %s | FileCheck -check-prefix=CHECK68 %s
// RUN: %dxc -T ps_6_7 -E main -Qkeep_reflect_in_dxil %s | FileCheck -check-prefix=CHECK67 %s

// Make sure the vector is annotated with vector size (DXIL 1.8 and higher),
// matrix is annotated with matrix size and orientation, and scalar does not
Expand Down Expand Up @@ -47,4 +47,4 @@ StructuredBuffer<MyStruct> g_myStruct;
float main() : SV_Target
{
return g_myStruct[0].vec.x + g_myStruct[0].vec.y;
}
}
11 changes: 6 additions & 5 deletions tools/clang/test/HLSLFileCheck/infra/auto-dxilver.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
// This should implicitly require dxilver 1.8.

// RUN: %dxc -T vs_6_8 -Vd %s | FileCheck %s
// Even though this is using -Vd, the validator version is set by the available
// validator. If that isn't version 1.8 or above, we'll see an error.
// Even though this is using -Vd, the validator version being checked is the internal
// validator's version. If a pre-DXIL-1.8 DXC was used to run this test, we expect failure,
// since the internal validator will be the same version as the older DXC.
// The implicit dxilver logic should not skip the check when -Vd is used.
// CHECK-NOT: error: validator version {{.*}} does not support target profile.

// RUN: %dxc -T vs_6_0 -validator-version 1.8 %s | FileCheck %s
// Even though target is 6.0, the explicit -validator-version should add an
// implicit dxilver 1.8 requirement.
// implicit dxilver 1.8 requirement. The requirement should pass for DXCs that
// are newer than DXIL Version 1.8, since then, the internal validator's version will
// be sufficiently new for this check.
// CHECK-NOT: error: The module cannot be validated by the version of the validator currently attached.

// This error would occur if run against wrong compiler.
Expand All @@ -21,8 +24,6 @@
// Catch any other unexpected error cases.
// CHECK-NOT: error

// RUN: %dxc -T vs_6_8 -select-validator internal %s | FileCheck %s
// This should always be run, and always succeed.
// CHECK: define void @main()

void main() {}
14 changes: 14 additions & 0 deletions tools/clang/test/Parser/deprecated-select-validator.hlsl
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized that this is in the wrong location. This is a folder of clang c/cpp parser tests, not for testing the argument parsing. This whole folder is disabled for the DXC project, so this test will not run.

Check lit.local.cfg under Parser for:

config.suffixes = [] # HLSL Change - Disable lit suites.

This should be moved under the DXC folder instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Test that the deprecated option, select-validator, doesn't work.
// RUN: not %dxc -E main -T vs_6_7 -select-validator internal %s 2>&1 | FileCheck %s

// CHECK: dxc failed : Unknown argument: '-select-validator'

float4 main(int loc : SV_StartVertexLocation
, uint loc2 : SV_StartInstanceLocation
) : SV_Position
{
float4 r = 0;
r += loc;
r += loc2;
return r;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// TODO: use -verify instead of FileCheck after fix https://github.com/microsoft/DirectXShaderCompiler/issues/5768
// -select-validator internal used to avoid downlevel validator testing
// incompatibility with shader model 6.7.
// RUN: not %dxc -E main -T vs_6_7 -select-validator internal %s 2>&1 | FileCheck %s --check-prefix=SM67
// RUN: not %dxc -E main -T vs_6_7 %s 2>&1 | FileCheck %s --check-prefix=SM67

// SM67:invalid semantic 'SV_StartVertexLocation' for vs 6.7
// SM67:invalid semantic 'SV_StartInstanceLocation' for vs 6.7
Expand Down