Bladeren bron

Merged PR 69: Add -auto-binding-space option enabling auto-binding for lib targets

Add -auto-binding-space option enabling auto-binding for lib targets

- Added DxilAllocateResourcesForLib pass to allow auto-binding any unbound
resources in a DxcOptimizer pass.
Tex Riddell 7 jaren geleden
bovenliggende
commit
8bdf2fef5f
100 gewijzigde bestanden met toevoegingen van 269 en 102 verwijderingen
  1. 2 0
      include/dxc/HLSL/DxilGenerationPass.h
  2. 40 0
      include/dxc/HLSL/DxilInstructions.h
  3. 1 0
      include/dxc/HLSL/DxilMetadataHelper.h
  4. 6 0
      include/dxc/HLSL/DxilModule.h
  5. 9 4
      include/dxc/HLSL/DxilShaderModel.h
  6. 6 0
      include/dxc/HLSL/HLModule.h
  7. 1 0
      include/dxc/Support/HLSLOptions.h
  8. 1 0
      include/dxc/Support/HLSLOptions.td
  9. 8 0
      lib/DxcSupport/HLSLOptions.cpp
  10. 1 0
      lib/HLSL/DxcOptimizer.cpp
  11. 73 11
      lib/HLSL/DxilCondenseResources.cpp
  12. 2 0
      lib/HLSL/DxilGenerationPass.cpp
  13. 20 1
      lib/HLSL/DxilModule.cpp
  14. 10 0
      lib/HLSL/HLModule.cpp
  15. 2 0
      tools/clang/include/clang/Frontend/CodeGenOptions.h
  16. 1 0
      tools/clang/lib/CodeGen/CGHLSLMS.cpp
  17. 1 1
      tools/clang/test/CodeGenHLSL/lib_cs_entry.hlsl
  18. 1 1
      tools/clang/test/CodeGenHLSL/lib_cs_entry2.hlsl
  19. 1 1
      tools/clang/test/CodeGenHLSL/lib_cs_entry3.hlsl
  20. 1 1
      tools/clang/test/CodeGenHLSL/lib_entries.hlsl
  21. 1 1
      tools/clang/test/CodeGenHLSL/lib_entries2.hlsl
  22. 1 1
      tools/clang/test/CodeGenHLSL/lib_no_alias.hlsl
  23. 1 1
      tools/clang/test/CodeGenHLSL/lib_resource.hlsl
  24. 1 1
      tools/clang/test/CodeGenHLSL/lib_select_res.hlsl
  25. 1 1
      tools/clang/test/CodeGenHLSL/lib_unused_func.hlsl
  26. 3 3
      tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/raytracing_traceray.hlsl
  27. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/raytracing_traceray_readback.hlsl
  28. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/reflect-lib-1.hlsl
  29. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/structured_buffer_getdim_stride.hlsl
  30. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/fn_attr_experimental.hlsl
  31. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/incomp_array.hlsl
  32. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/lib_mat_array.hlsl
  33. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/lib_remove_res.hlsl
  34. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/lib_select_res.hlsl
  35. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/noinline.hlsl
  36. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/opt_2x32_64_bitcast_invalid.hlsl
  37. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_accept_ignore_hit.hlsl
  38. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit.hlsl
  39. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_in_payload.hlsl
  40. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_inout_attr.hlsl
  41. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_no_attr.hlsl
  42. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_no_payload.hlsl
  43. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_out.hlsl
  44. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_param.hlsl
  45. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_attr_struct.hlsl
  46. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_builtin.hlsl
  47. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable.hlsl
  48. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_2param.hlsl
  49. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_in.hlsl
  50. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_out.hlsl
  51. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_ret.hlsl
  52. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_udt.hlsl
  53. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_callshader.hlsl
  54. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit.hlsl
  55. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_in_payload.hlsl
  56. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_inout_attr.hlsl
  57. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_no_attr.hlsl
  58. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_no_payload.hlsl
  59. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_numeric.hlsl
  60. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_out.hlsl
  61. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_param.hlsl
  62. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_intersection.hlsl
  63. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_intersection_param.hlsl
  64. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss.hlsl
  65. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_extra.hlsl
  66. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_in.hlsl
  67. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_no_payload.hlsl
  68. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_out.hlsl
  69. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_ret.hlsl
  70. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_udt.hlsl
  71. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_payload_struct.hlsl
  72. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_raygen_param.hlsl
  73. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_raygeneration.hlsl
  74. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_reporthit.hlsl
  75. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_sgv_intrin.hlsl
  76. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_sgv_transforms.hlsl
  77. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_traceray.hlsl
  78. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_traceray_readback.hlsl
  79. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/raytracing_udt_sizes.hlsl
  80. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/res_select2.hlsl
  81. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/res_select3.hlsl
  82. 1 1
      tools/clang/test/CodeGenHLSL/quick-test/structured_buffer_getdim_stride.hlsl
  83. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/createHandle_multi.hlsl
  84. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/createHandle_multi2.hlsl
  85. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/ignore_line_directives.hlsl
  86. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/inout_subscript.hlsl
  87. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten.hlsl
  88. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten2.hlsl
  89. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten3.hlsl
  90. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten4.hlsl
  91. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_empty_struct_arg.hlsl
  92. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_ret_struct.hlsl
  93. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_no_flat_extern_func.hlsl
  94. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_out_param_res.hlsl
  95. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_out_param_res_imp.hlsl
  96. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_out_undef.hlsl
  97. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_res_sel.hlsl
  98. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_ret_res.hlsl
  99. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_unresolved_func1.hlsl
  100. 1 1
      tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_unresolved_func2.hlsl

+ 2 - 0
include/dxc/HLSL/DxilGenerationPass.h

@@ -45,6 +45,7 @@ namespace llvm {
 /// Note that this pass is designed for use with the legacy pass manager.
 /// Note that this pass is designed for use with the legacy pass manager.
 ModulePass *createDxilCondenseResourcesPass();
 ModulePass *createDxilCondenseResourcesPass();
 ModulePass *createDxilLowerCreateHandleForLibPass();
 ModulePass *createDxilLowerCreateHandleForLibPass();
+ModulePass *createDxilAllocateResourcesForLibPass();
 ModulePass *createDxilEliminateOutputDynamicIndexingPass();
 ModulePass *createDxilEliminateOutputDynamicIndexingPass();
 ModulePass *createDxilGenerationPass(bool NotOptimized, hlsl::HLSLExtensionsCodegenHelper *extensionsHelper);
 ModulePass *createDxilGenerationPass(bool NotOptimized, hlsl::HLSLExtensionsCodegenHelper *extensionsHelper);
 ModulePass *createHLEmitMetadataPass();
 ModulePass *createHLEmitMetadataPass();
@@ -72,6 +73,7 @@ ModulePass *createResumePassesPass();
 
 
 void initializeDxilCondenseResourcesPass(llvm::PassRegistry&);
 void initializeDxilCondenseResourcesPass(llvm::PassRegistry&);
 void initializeDxilLowerCreateHandleForLibPass(llvm::PassRegistry&);
 void initializeDxilLowerCreateHandleForLibPass(llvm::PassRegistry&);
+void initializeDxilAllocateResourcesForLibPass(llvm::PassRegistry&);
 void initializeDxilEliminateOutputDynamicIndexingPass(llvm::PassRegistry&);
 void initializeDxilEliminateOutputDynamicIndexingPass(llvm::PassRegistry&);
 void initializeDxilGenerationPassPass(llvm::PassRegistry&);
 void initializeDxilGenerationPassPass(llvm::PassRegistry&);
 void initializeHLEnsureMetadataPass(llvm::PassRegistry&);
 void initializeHLEnsureMetadataPass(llvm::PassRegistry&);

+ 40 - 0
include/dxc/HLSL/DxilInstructions.h

@@ -4837,6 +4837,8 @@ struct DxilInst_InstanceID {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction The autogenerated index of the current instance in the top-level structure
 /// This instruction The autogenerated index of the current instance in the top-level structure
@@ -4853,6 +4855,8 @@ struct DxilInst_InstanceIndex {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction Returns the value passed as HitKind in ReportIntersection().  If intersection was reported by fixed-function triangle intersection, HitKind will be one of HIT_KIND_TRIANGLE_FRONT_FACE or HIT_KIND_TRIANGLE_BACK_FACE.
 /// This instruction Returns the value passed as HitKind in ReportIntersection().  If intersection was reported by fixed-function triangle intersection, HitKind will be one of HIT_KIND_TRIANGLE_FRONT_FACE or HIT_KIND_TRIANGLE_BACK_FACE.
@@ -4869,6 +4873,8 @@ struct DxilInst_HitKind {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction uint containing the current ray flags.
 /// This instruction uint containing the current ray flags.
@@ -4885,6 +4891,8 @@ struct DxilInst_RayFlags {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction The current x and y location within the Width and Height
 /// This instruction The current x and y location within the Width and Height
@@ -4901,6 +4909,8 @@ struct DxilInst_DispatchRaysIndex {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_col = 1,
     arg_col = 1,
@@ -4924,6 +4934,8 @@ struct DxilInst_DispatchRaysDimensions {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_col = 1,
     arg_col = 1,
@@ -4947,6 +4959,8 @@ struct DxilInst_WorldRayOrigin {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_col = 1,
     arg_col = 1,
@@ -4970,6 +4984,8 @@ struct DxilInst_WorldRayDirection {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_col = 1,
     arg_col = 1,
@@ -4993,6 +5009,8 @@ struct DxilInst_ObjectRayOrigin {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_col = 1,
     arg_col = 1,
@@ -5016,6 +5034,8 @@ struct DxilInst_ObjectRayDirection {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_col = 1,
     arg_col = 1,
@@ -5039,6 +5059,8 @@ struct DxilInst_ObjectToWorld {
     if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_row = 1,
     arg_row = 1,
@@ -5065,6 +5087,8 @@ struct DxilInst_WorldToObject {
     if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_row = 1,
     arg_row = 1,
@@ -5091,6 +5115,8 @@ struct DxilInst_RayTMin {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction float representing the current parametric ending point for the ray
 /// This instruction float representing the current parametric ending point for the ray
@@ -5107,6 +5133,8 @@ struct DxilInst_RayTCurrent {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction Used in an any hit shader to reject an intersection and terminate the shader
 /// This instruction Used in an any hit shader to reject an intersection and terminate the shader
@@ -5123,6 +5151,8 @@ struct DxilInst_IgnoreHit {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction Used in an any hit shader to abort the ray query and the intersection shader (if any). The current hit is committed and execution passes to the closest hit shader with the closest hit recorded so far
 /// This instruction Used in an any hit shader to abort the ray query and the intersection shader (if any). The current hit is committed and execution passes to the closest hit shader with the closest hit recorded so far
@@ -5139,6 +5169,8 @@ struct DxilInst_AcceptHitAndEndSearch {
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (1 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
 };
 };
 
 
 /// This instruction returns the view index
 /// This instruction returns the view index
@@ -5155,6 +5187,8 @@ struct DxilInst_TraceRay {
     if (16 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (16 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_AccelerationStructure = 1,
     arg_AccelerationStructure = 1,
@@ -5220,6 +5254,8 @@ struct DxilInst_ReportHit {
     if (4 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (4 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_THit = 1,
     arg_THit = 1,
@@ -5249,6 +5285,8 @@ struct DxilInst_CallShader {
     if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (3 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_ShaderIndex = 1,
     arg_ShaderIndex = 1,
@@ -5275,6 +5313,8 @@ struct DxilInst_CreateHandleFromResourceStructForLib {
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     if (2 != llvm::dyn_cast<llvm::CallInst>(Instr)->getNumArgOperands()) return false;
     return true;
     return true;
   }
   }
+  // Metadata
+  bool requiresUniformInputs() const { return false; }
   // Operand indexes
   // Operand indexes
   enum OperandIdx {
   enum OperandIdx {
     arg_Resource = 1,
     arg_Resource = 1,

+ 1 - 0
include/dxc/HLSL/DxilMetadataHelper.h

@@ -206,6 +206,7 @@ public:
   static const unsigned kDxilDSStateTag         = 2;
   static const unsigned kDxilDSStateTag         = 2;
   static const unsigned kDxilHSStateTag         = 3;
   static const unsigned kDxilHSStateTag         = 3;
   static const unsigned kDxilNumThreadsTag      = 4;
   static const unsigned kDxilNumThreadsTag      = 4;
+  static const unsigned kDxilAutoBindingSpaceTag    = 5;
 
 
   // GSState.
   // GSState.
   static const unsigned kDxilGSStateNumFields               = 5;
   static const unsigned kDxilGSStateNumFields               = 5;

+ 6 - 0
include/dxc/HLSL/DxilModule.h

@@ -261,6 +261,11 @@ public:
   float GetMaxTessellationFactor() const;
   float GetMaxTessellationFactor() const;
   void SetMaxTessellationFactor(float MaxTessellationFactor);
   void SetMaxTessellationFactor(float MaxTessellationFactor);
 
 
+  // AutoBindingSpace also enables automatic binding for libraries if set.
+  // UINT_MAX == unset
+  void SetAutoBindingSpace(uint32_t Space);
+  uint32_t GetAutoBindingSpace() const;
+
   void SetShaderProperties(DxilFunctionProps *props);
   void SetShaderProperties(DxilFunctionProps *props);
 
 
 private:
 private:
@@ -339,6 +344,7 @@ private:
   bool m_bDisableOptimizations;
   bool m_bDisableOptimizations;
   bool m_bUseMinPrecision;
   bool m_bUseMinPrecision;
   bool m_bAllResourcesBound;
   bool m_bAllResourcesBound;
+  uint32_t m_AutoBindingSpace;
 };
 };
 
 
 } // namespace hlsl
 } // namespace hlsl

+ 9 - 4
include/dxc/HLSL/DxilShaderModel.h

@@ -48,10 +48,15 @@ public:
   unsigned GetMinor() const { return m_Minor; }
   unsigned GetMinor() const { return m_Minor; }
   void GetDxilVersion(unsigned &DxilMajor, unsigned &DxilMinor) const;
   void GetDxilVersion(unsigned &DxilMajor, unsigned &DxilMinor) const;
   void GetMinValidatorVersion(unsigned &ValMajor, unsigned &ValMinor) const;
   void GetMinValidatorVersion(unsigned &ValMajor, unsigned &ValMinor) const;
-  bool IsSM50Plus() const   { return m_Major >= 5; }
-  bool IsSM51Plus() const   { return m_Major > 5 || (m_Major == 5 && m_Minor >= 1); }
-  bool IsSM60Plus() const   { return m_Major >= 6; }
-  bool IsSM61Plus() const   { return m_Major > 6 || (m_Major == 6 && m_Minor >= 1); }
+  bool IsSMAtLeast(unsigned Major, unsigned Minor) const {
+    return m_Major > Major || (m_Major == Major && m_Minor >= Minor);
+  }
+  bool IsSM50Plus() const   { return IsSMAtLeast(5, 0); }
+  bool IsSM51Plus() const   { return IsSMAtLeast(5, 1); }
+  bool IsSM60Plus() const   { return IsSMAtLeast(6, 0); }
+  bool IsSM61Plus() const   { return IsSMAtLeast(6, 1); }
+  bool IsSM62Plus() const   { return IsSMAtLeast(6, 2); }
+  bool IsSM63Plus() const   { return IsSMAtLeast(6, 3); }
   const char *GetName() const { return m_pszName; }
   const char *GetName() const { return m_pszName; }
   std::string GetKindName() const;
   std::string GetKindName() const;
   unsigned GetNumTempRegs() const { return DXIL::kMaxTempRegCount; }
   unsigned GetNumTempRegs() const { return DXIL::kMaxTempRegCount; }

+ 6 - 0
include/dxc/HLSL/HLModule.h

@@ -85,6 +85,11 @@ public:
   void SetHLOptions(HLOptions &opts);
   void SetHLOptions(HLOptions &opts);
   const HLOptions &GetHLOptions() const;
   const HLOptions &GetHLOptions() const;
 
 
+  // AutoBindingSpace also enables automatic binding for libraries if set.
+  // UINT_MAX == unset
+  void SetAutoBindingSpace(uint32_t Space);
+  uint32_t GetAutoBindingSpace() const;
+
   // Entry function.
   // Entry function.
   llvm::Function *GetEntryFunction() const;
   llvm::Function *GetEntryFunction() const;
   void SetEntryFunction(llvm::Function *pEntryFunc);
   void SetEntryFunction(llvm::Function *pEntryFunc);
@@ -269,6 +274,7 @@ private:
   HLOptions m_Options;
   HLOptions m_Options;
   std::unique_ptr<OP> m_pOP;
   std::unique_ptr<OP> m_pOP;
   size_t m_pUnused;
   size_t m_pUnused;
+  uint32_t m_AutoBindingSpace;
 
 
   // DXIL metadata serialization/deserialization.
   // DXIL metadata serialization/deserialization.
   llvm::MDTuple *EmitHLResources();
   llvm::MDTuple *EmitHLResources();

+ 1 - 0
include/dxc/Support/HLSLOptions.h

@@ -154,6 +154,7 @@ public:
   bool DisassembleByteOffset = false; //OPT_No
   bool DisassembleByteOffset = false; //OPT_No
   bool DisaseembleHex = false; //OPT_Lx
   bool DisaseembleHex = false; //OPT_Lx
   bool LegacyMacroExpansion = false; // OPT_flegacy_macro_expansion
   bool LegacyMacroExpansion = false; // OPT_flegacy_macro_expansion
+  unsigned long AutoBindingSpace = UINT_MAX; // OPT_auto_binding_space
 
 
   bool IsRootSignatureProfile();
   bool IsRootSignatureProfile();
   bool IsLibraryProfile();
   bool IsLibraryProfile();

+ 1 - 0
include/dxc/Support/HLSLOptions.td

@@ -232,6 +232,7 @@ def rootsig_define : Separate<["-", "/"], "rootsig-define">, Group<hlslcomp_Grou
 def enable_16bit_types: Flag<["-", "/"], "enable-16bit-types">, Flags<[CoreOption, DriverOption]>, Group<hlslcomp_Group>,
 def enable_16bit_types: Flag<["-", "/"], "enable-16bit-types">, Flags<[CoreOption, DriverOption]>, Group<hlslcomp_Group>,
   HelpText<"Enable 16bit types and disable min precision types. Available in HLSL 2018 and shader model 6.2">;
   HelpText<"Enable 16bit types and disable min precision types. Available in HLSL 2018 and shader model 6.2">;
 def ignore_line_directives : Flag<["-", "/"], "ignore-line-directives">, HelpText<"Ignore line directives">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
 def ignore_line_directives : Flag<["-", "/"], "ignore-line-directives">, HelpText<"Ignore line directives">, Flags<[CoreOption]>, Group<hlslcomp_Group>;
+def auto_binding_space : Separate<["-", "/"], "auto-binding-space">, Group<hlslcomp_Group>, Flags<[CoreOption]>, HelpText<"Set auto binding space - enables auto resource binding in libraries">;
 
 
 // SPIRV Change Starts
 // SPIRV Change Starts
 def spirv : Flag<["-"], "spirv">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,
 def spirv : Flag<["-"], "spirv">, Group<spirv_Group>, Flags<[CoreOption, DriverOption]>,

+ 8 - 0
lib/DxcSupport/HLSLOptions.cpp

@@ -341,6 +341,14 @@ int ReadDxcOpts(const OptTable *optionTable, unsigned flagsToInclude,
     }
     }
   }
   }
 
 
+  llvm::StringRef auto_binding_space = Args.getLastArgValue(OPT_auto_binding_space);
+  if (!auto_binding_space.empty()) {
+    if (auto_binding_space.getAsInteger(10, opts.AutoBindingSpace)) {
+      errors << "Unsupported value '" << auto_binding_space << "' for auto binding space.";
+      return 1;
+    }
+  }
+
   // Check options only allowed in shader model >= 6.2FPDenormalMode
   // Check options only allowed in shader model >= 6.2FPDenormalMode
   unsigned Major = 0;
   unsigned Major = 0;
   unsigned Minor = 0;
   unsigned Minor = 0;

+ 1 - 0
lib/HLSL/DxcOptimizer.cpp

@@ -86,6 +86,7 @@ HRESULT SetupRegistryPassForHLSL() {
     initializeDSEPass(Registry);
     initializeDSEPass(Registry);
     initializeDeadInstEliminationPass(Registry);
     initializeDeadInstEliminationPass(Registry);
     initializeDxilAddPixelHitInstrumentationPass(Registry);
     initializeDxilAddPixelHitInstrumentationPass(Registry);
+    initializeDxilAllocateResourcesForLibPass(Registry);
     initializeDxilCondenseResourcesPass(Registry);
     initializeDxilCondenseResourcesPass(Registry);
     initializeDxilConvergentClearPass(Registry);
     initializeDxilConvergentClearPass(Registry);
     initializeDxilConvergentMarkPass(Registry);
     initializeDxilConvergentMarkPass(Registry);

+ 73 - 11
lib/HLSL/DxilCondenseResources.cpp

@@ -96,9 +96,10 @@ void ApplyRewriteMapOnResTable(RemapEntryCollection &rewrites, DxilModule &DM) {
 namespace {
 namespace {
 
 
 template <typename T>
 template <typename T>
-static void
+static bool
 AllocateDxilResource(const std::vector<std::unique_ptr<T>> &resourceList,
 AllocateDxilResource(const std::vector<std::unique_ptr<T>> &resourceList,
-                     LLVMContext &Ctx) {
+                     LLVMContext &Ctx, unsigned AutoBindingSpace=0) {
+  bool bChanged = false;
   SpacesAllocator<unsigned, T> SAlloc;
   SpacesAllocator<unsigned, T> SAlloc;
 
 
   for (auto &res : resourceList) {
   for (auto &res : resourceList) {
@@ -135,7 +136,7 @@ AllocateDxilResource(const std::vector<std::unique_ptr<T>> &resourceList,
   }
   }
 
 
   // Allocate.
   // Allocate.
-  const unsigned space = 0;
+  const unsigned space = AutoBindingSpace;
   typename SpacesAllocator<unsigned, T>::Allocator &alloc0 = SAlloc.Get(space);
   typename SpacesAllocator<unsigned, T>::Allocator &alloc0 = SAlloc.Get(space);
   for (auto &res : resourceList) {
   for (auto &res : resourceList) {
     if (!res->IsAllocated()) {
     if (!res->IsAllocated()) {
@@ -160,6 +161,8 @@ AllocateDxilResource(const std::vector<std::unique_ptr<T>> &resourceList,
       }
       }
       if (success) {
       if (success) {
         res->SetLowerBound(reg);
         res->SetLowerBound(reg);
+        res->SetSpaceID(space);
+        bChanged = true;
       } else {
       } else {
         Ctx.emitError(((res->IsUnbounded()) ? Twine("unbounded ") : Twine("")) +
         Ctx.emitError(((res->IsUnbounded()) ? Twine("unbounded ") : Twine("")) +
                       Twine("resource ") + res->GetGlobalName() +
                       Twine("resource ") + res->GetGlobalName() +
@@ -167,13 +170,25 @@ AllocateDxilResource(const std::vector<std::unique_ptr<T>> &resourceList,
       }
       }
     }
     }
   }
   }
+
+  return bChanged;
 }
 }
 
 
-void AllocateDxilResources(DxilModule &DM) {
-  AllocateDxilResource(DM.GetCBuffers(), DM.GetCtx());
-  AllocateDxilResource(DM.GetSamplers(), DM.GetCtx());
-  AllocateDxilResource(DM.GetUAVs(), DM.GetCtx());
-  AllocateDxilResource(DM.GetSRVs(), DM.GetCtx());
+bool AllocateDxilResources(DxilModule &DM) {
+  uint32_t AutoBindingSpace = DM.GetAutoBindingSpace();
+  if (AutoBindingSpace == UINT_MAX) {
+    // For libraries, we don't allocate unless AutoBindingSpace is set.
+    if (DM.GetShaderModel()->IsLib())
+      return false;
+    // For shaders, we allocate in space 0 by default.
+    AutoBindingSpace = 0;
+  }
+  bool bChanged = false;
+  bChanged |= AllocateDxilResource(DM.GetCBuffers(), DM.GetCtx(), AutoBindingSpace);
+  bChanged |= AllocateDxilResource(DM.GetSamplers(), DM.GetCtx(), AutoBindingSpace);
+  bChanged |= AllocateDxilResource(DM.GetUAVs(), DM.GetCtx(), AutoBindingSpace);
+  bChanged |= AllocateDxilResource(DM.GetSRVs(), DM.GetCtx(), AutoBindingSpace);
+  return bChanged;
 }
 }
 } // namespace
 } // namespace
 
 
@@ -482,8 +497,14 @@ public:
                             DM.GetSRVs().size() + DM.GetSamplers().size();
                             DM.GetSRVs().size() + DM.GetSamplers().size();
     bChanged = bChanged || (numResources != newResources);
     bChanged = bChanged || (numResources != newResources);
 
 
-    if (0 == newResources || m_bIsLib)
+    if (0 == newResources)
+      return bChanged;
+
+    bChanged |= AllocateDxilResources(DM);
+
+    if (m_bIsLib)
       return bChanged;
       return bChanged;
+
     // Make sure no select on resource.
     // Make sure no select on resource.
     RemovePhiOnResource();
     RemovePhiOnResource();
 
 
@@ -493,8 +514,6 @@ public:
     // used to load them.
     // used to load them.
     m_HasDbgInfo = getDebugMetadataVersionFromModule(M) != 0;
     m_HasDbgInfo = getDebugMetadataVersionFromModule(M) != 0;
 
 
-    AllocateDxilResources(DM);
-
     GenerateDxilResourceHandles();
     GenerateDxilResourceHandles();
     AddCreateHandleForPhiNodeAndSelect(DM.GetOP());
     AddCreateHandleForPhiNodeAndSelect(DM.GetOP());
 
 
@@ -1462,3 +1481,46 @@ ModulePass *llvm::createDxilLowerCreateHandleForLibPass() {
 }
 }
 
 
 INITIALIZE_PASS(DxilLowerCreateHandleForLib, "hlsl-dxil-lower-handle-for-lib", "DXIL Lower createHandleForLib", false, false)
 INITIALIZE_PASS(DxilLowerCreateHandleForLib, "hlsl-dxil-lower-handle-for-lib", "DXIL Lower createHandleForLib", false, false)
+
+
+class DxilAllocateResourcesForLib : public ModulePass {
+private:
+  RemapEntryCollection m_rewrites;
+
+public:
+  static char ID; // Pass identification, replacement for typeid
+  explicit DxilAllocateResourcesForLib() : ModulePass(ID), m_AutoBindingSpace(UINT_MAX) {}
+
+  void applyOptions(PassOptions O) override {
+    GetPassOptionUInt32(O, "auto-binding-space", &m_AutoBindingSpace, UINT_MAX);
+  }
+  const char *getPassName() const override { return "DXIL Condense Resources"; }
+
+  bool runOnModule(Module &M) override {
+    DxilModule &DM = M.GetOrCreateDxilModule();
+    // Must specify a default space, and must apply to library.
+    // Use DxilCondenseResources instead for shaders.
+    if ((m_AutoBindingSpace == UINT_MAX) || !DM.GetShaderModel()->IsLib())
+      return false;
+
+    bool hasResource = DM.GetCBuffers().size() ||
+      DM.GetUAVs().size() || DM.GetSRVs().size() || DM.GetSamplers().size();
+
+    if (hasResource) {
+      DM.SetAutoBindingSpace(m_AutoBindingSpace);
+      AllocateDxilResources(DM);
+    }
+    return true;
+  }
+
+private:
+  uint32_t m_AutoBindingSpace;
+};
+
+char DxilAllocateResourcesForLib::ID = 0;
+
+ModulePass *llvm::createDxilAllocateResourcesForLibPass() {
+  return new DxilAllocateResourcesForLib();
+}
+
+INITIALIZE_PASS(DxilAllocateResourcesForLib, "hlsl-dxil-allocate-resources-for-lib", "DXIL Allocate Resources For Library", false, false)

+ 2 - 0
lib/HLSL/DxilGenerationPass.cpp

@@ -214,6 +214,8 @@ void InitDxilModuleFromHLModule(HLModule &H, DxilModule &M, DxilEntrySignature *
 
 
   M.SetAllResourcesBound(H.GetHLOptions().bAllResourcesBound);
   M.SetAllResourcesBound(H.GetHLOptions().bAllResourcesBound);
 
 
+  M.SetAutoBindingSpace(H.GetAutoBindingSpace());
+
   // Update Validator Version
   // Update Validator Version
   M.UpgradeToMinValidatorVersion();
   M.UpgradeToMinValidatorVersion();
 }
 }

+ 20 - 1
lib/HLSL/DxilModule.cpp

@@ -86,7 +86,8 @@ DxilModule::DxilModule(Module *pModule)
 , m_RootSignature(nullptr)
 , m_RootSignature(nullptr)
 , m_bUseMinPrecision(true) // use min precision by default
 , m_bUseMinPrecision(true) // use min precision by default
 , m_bDisableOptimizations(false)
 , m_bDisableOptimizations(false)
-, m_bAllResourcesBound(false) {
+, m_bAllResourcesBound(false)
+, m_AutoBindingSpace(UINT_MAX) {
   DXASSERT_NOMSG(m_pModule != nullptr);
   DXASSERT_NOMSG(m_pModule != nullptr);
 
 
   m_NumThreads[0] = m_NumThreads[1] = m_NumThreads[2] = 0;
   m_NumThreads[0] = m_NumThreads[1] = m_NumThreads[2] = 0;
@@ -463,6 +464,13 @@ void DxilModule::SetMaxTessellationFactor(float MaxTessellationFactor) {
   m_MaxTessellationFactor = MaxTessellationFactor;
   m_MaxTessellationFactor = MaxTessellationFactor;
 }
 }
 
 
+void DxilModule::SetAutoBindingSpace(uint32_t Space) {
+  m_AutoBindingSpace = Space;
+}
+uint32_t DxilModule::GetAutoBindingSpace() const {
+  return m_AutoBindingSpace;
+}
+
 void DxilModule::SetShaderProperties(DxilFunctionProps *props) {
 void DxilModule::SetShaderProperties(DxilFunctionProps *props) {
   if (!props)
   if (!props)
     return;
     return;
@@ -1278,6 +1286,11 @@ MDTuple *DxilModule::EmitDxilShaderProperties() {
     MDVals.emplace_back(pMDTuple);
     MDVals.emplace_back(pMDTuple);
   }
   }
 
 
+  if (GetAutoBindingSpace() != UINT_MAX && m_pSM->IsSMAtLeast(6, 3)) {
+    MDVals.emplace_back(m_pMDHelper->Uint32ToConstMD(DxilMDHelper::kDxilAutoBindingSpaceTag));
+    MDVals.emplace_back(MDNode::get(m_Ctx, { m_pMDHelper->Uint32ToConstMD(GetAutoBindingSpace()) }));
+  }
+
   if (!MDVals.empty())
   if (!MDVals.empty())
     return MDNode::get(m_Ctx, MDVals);
     return MDNode::get(m_Ctx, MDVals);
   else
   else
@@ -1334,6 +1347,12 @@ void DxilModule::LoadDxilShaderProperties(const MDOperand &MDO) {
                                    m_MaxTessellationFactor);
                                    m_MaxTessellationFactor);
       break;
       break;
 
 
+    case DxilMDHelper::kDxilAutoBindingSpaceTag: {
+      MDNode *pNode = cast<MDNode>(MDO.get());
+      SetAutoBindingSpace(DxilMDHelper::ConstMDToUint32(pNode->getOperand(0)));
+      break;
+    }
+
     default:
     default:
       DXASSERT(false, "Unknown extended shader properties tag");
       DXASSERT(false, "Unknown extended shader properties tag");
       break;
       break;

+ 10 - 0
lib/HLSL/HLModule.cpp

@@ -124,6 +124,13 @@ const HLOptions &HLModule::GetHLOptions() const {
   return m_Options;
   return m_Options;
 }
 }
 
 
+void HLModule::SetAutoBindingSpace(uint32_t Space) {
+  m_AutoBindingSpace = Space;
+}
+uint32_t HLModule::GetAutoBindingSpace() const {
+  return m_AutoBindingSpace;
+}
+
 Function *HLModule::GetEntryFunction() const {
 Function *HLModule::GetEntryFunction() const {
   return m_pEntryFunc;
   return m_pEntryFunc;
 }
 }
@@ -461,6 +468,7 @@ void HLModule::EmitHLMetadata() {
     NamedMDNode * options = m_pModule->getOrInsertNamedMetadata(kHLDxilOptionsMDName);
     NamedMDNode * options = m_pModule->getOrInsertNamedMetadata(kHLDxilOptionsMDName);
     uint32_t hlOptions = m_Options.GetHLOptionsRaw();
     uint32_t hlOptions = m_Options.GetHLOptionsRaw();
     options->addOperand(MDNode::get(m_Ctx, m_pMDHelper->Uint32ToConstMD(hlOptions)));
     options->addOperand(MDNode::get(m_Ctx, m_pMDHelper->Uint32ToConstMD(hlOptions)));
+    options->addOperand(MDNode::get(m_Ctx, m_pMDHelper->Uint32ToConstMD(GetAutoBindingSpace())));
 
 
     NamedMDNode * resTyAnnotations = m_pModule->getOrInsertNamedMetadata(kHLDxilResourceTypeAnnotationMDName);
     NamedMDNode * resTyAnnotations = m_pModule->getOrInsertNamedMetadata(kHLDxilResourceTypeAnnotationMDName);
     resTyAnnotations->addOperand(EmitResTyAnnotations());
     resTyAnnotations->addOperand(EmitResTyAnnotations());
@@ -514,6 +522,8 @@ void HLModule::LoadHLMetadata() {
     const NamedMDNode * options = m_pModule->getOrInsertNamedMetadata(kHLDxilOptionsMDName);
     const NamedMDNode * options = m_pModule->getOrInsertNamedMetadata(kHLDxilOptionsMDName);
     const MDNode *MDOptions = options->getOperand(0);
     const MDNode *MDOptions = options->getOperand(0);
     m_Options.SetHLOptionsRaw(DxilMDHelper::ConstMDToUint32(MDOptions->getOperand(0)));
     m_Options.SetHLOptionsRaw(DxilMDHelper::ConstMDToUint32(MDOptions->getOperand(0)));
+    if (options->getNumOperands() > 1)
+      SetAutoBindingSpace(DxilMDHelper::ConstMDToUint32(options->getOperand(1)->getOperand(0)));
     NamedMDNode * resTyAnnotations = m_pModule->getOrInsertNamedMetadata(kHLDxilResourceTypeAnnotationMDName);
     NamedMDNode * resTyAnnotations = m_pModule->getOrInsertNamedMetadata(kHLDxilResourceTypeAnnotationMDName);
     const MDNode *MDResTyAnnotations = resTyAnnotations->getOperand(0);
     const MDNode *MDResTyAnnotations = resTyAnnotations->getOperand(0);
     if (MDResTyAnnotations->getNumOperands())
     if (MDResTyAnnotations->getNumOperands())

+ 2 - 0
tools/clang/include/clang/Frontend/CodeGenOptions.h

@@ -200,6 +200,8 @@ public:
   unsigned HLSLSignaturePackingStrategy = 0;
   unsigned HLSLSignaturePackingStrategy = 0;
   /// denormalized number mode ("ieee" for default)
   /// denormalized number mode ("ieee" for default)
   hlsl::DXIL::Float32DenormMode HLSLFloat32DenormMode;
   hlsl::DXIL::Float32DenormMode HLSLFloat32DenormMode;
+  /// HLSLDefaultSpace also enables automatic binding for libraries if set. UINT_MAX == unset
+  unsigned HLSLDefaultSpace = UINT_MAX;
   // HLSL Change Ends
   // HLSL Change Ends
   /// Regular expression to select optimizations for which we should enable
   /// Regular expression to select optimizations for which we should enable
   /// optimization remarks. Transformation passes whose name matches this
   /// optimization remarks. Transformation passes whose name matches this

+ 1 - 0
tools/clang/lib/CodeGen/CGHLSLMS.cpp

@@ -376,6 +376,7 @@ CGMSHLSLRuntime::CGMSHLSLRuntime(CodeGenModule &CGM)
   opts.bUseMinPrecision = CGM.getLangOpts().UseMinPrecision;
   opts.bUseMinPrecision = CGM.getLangOpts().UseMinPrecision;
 
 
   m_pHLModule->SetHLOptions(opts);
   m_pHLModule->SetHLOptions(opts);
+  m_pHLModule->SetAutoBindingSpace(CGM.getCodeGenOpts().HLSLDefaultSpace);
 
 
   m_pHLModule->SetValidatorVersion(CGM.getCodeGenOpts().HLSLValidatorMajorVer, CGM.getCodeGenOpts().HLSLValidatorMinorVer);
   m_pHLModule->SetValidatorVersion(CGM.getCodeGenOpts().HLSLValidatorMajorVer, CGM.getCodeGenOpts().HLSLValidatorMinorVer);
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_cs_entry.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure entry function exist.
 // Make sure entry function exist.
 // CHECK: @entry(
 // CHECK: @entry(

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_cs_entry2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: redefinition of entry
 // CHECK: redefinition of entry
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_cs_entry3.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure entry function exist.
 // Make sure entry function exist.
 // CHECK: @entry(
 // CHECK: @entry(

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_entries.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 
 
 // Make sure entry function exist.
 // Make sure entry function exist.

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_entries2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure entry function exist.
 // Make sure entry function exist.
 // CHECK: @cs_main()
 // CHECK: @cs_main()

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_no_alias.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure out param has no-alias.
 // Make sure out param has no-alias.
 // CHECK: float @"\01?test@@YAMMUT@@AIAV?$matrix@M$01$01@@M@Z"(float %a, %struct.T* noalias nocapture %t, %class.matrix.float.2.2* noalias nocapture dereferenceable(16) %m, float %b)
 // CHECK: float @"\01?test@@YAMMUT@@AIAV?$matrix@M$01$01@@M@Z"(float %a, %struct.T* noalias nocapture %t, %class.matrix.float.2.2* noalias nocapture dereferenceable(16) %m, float %b)

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_resource.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure globals for resource exist.
 // Make sure globals for resource exist.
 // CHECK: @"\01?g_txDiffuse@@3V?$Texture2D@V?$vector@M$03@@@@A" = external global %"class.Texture2D<vector<float, 4> >", align 4
 // CHECK: @"\01?g_txDiffuse@@3V?$Texture2D@V?$vector@M$03@@@@A" = external global %"class.Texture2D<vector<float, 4> >", align 4

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_select_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure load resource rangeID when select resource.
 // Make sure load resource rangeID when select resource.
 // CHECK:load i32, i32* @ReadBuffer1_rangeID
 // CHECK:load i32, i32* @ReadBuffer1_rangeID

+ 1 - 1
tools/clang/test/CodeGenHLSL/lib_unused_func.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure all function still exist.
 // Make sure all function still exist.
 // CHECK: unused
 // CHECK: unused

+ 3 - 3
tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/raytracing_traceray.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | %D3DReflect %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | %D3DReflect %s | FileCheck %s
 
 
 struct Payload {
 struct Payload {
    float2 t;
    float2 t;
@@ -41,8 +41,8 @@ float4 emit(inout float2 f2, RayDesc Ray:R, inout Payload p )  {
 // CHECK:         Type: D3D_SIT_RTACCELERATIONSTRUCTURE
 // CHECK:         Type: D3D_SIT_RTACCELERATIONSTRUCTURE
 // CHECK:         uID: 0
 // CHECK:         uID: 0
 // CHECK:         BindCount: 1
 // CHECK:         BindCount: 1
-// CHECK:         BindPoint: 4294967295
-// CHECK:         Space: 0
+// CHECK:         BindPoint: 0
+// CHECK:         Space: 11
 // CHECK:         ReturnType: D3D_RETURN_TYPE_SINT
 // CHECK:         ReturnType: D3D_RETURN_TYPE_SINT
 // CHECK:         Dimension: D3D_SRV_DIMENSION_UNKNOWN
 // CHECK:         Dimension: D3D_SRV_DIMENSION_UNKNOWN
 // CHECK:         NumSamples (or stride): 4294967295
 // CHECK:         NumSamples (or stride): 4294967295

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/raytracing_traceray_readback.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | %D3DReflect %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | %D3DReflect %s | FileCheck %s
 
 
 struct Payload {
 struct Payload {
    float4 abc;
    float4 abc;

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/reflect-lib-1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | %D3DReflect %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | %D3DReflect %s | FileCheck %s
 
 
 float cbval1;
 float cbval1;
 cbuffer MyCB : register(b11, space2) { int4 cbval2, cbval3; }
 cbuffer MyCB : register(b11, space2) { int4 cbval2, cbval3; }

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/d3dreflect/structured_buffer_getdim_stride.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | %D3DReflect %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | %D3DReflect %s | FileCheck %s
 
 
 struct Foo
 struct Foo
 {
 {

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/fn_attr_experimental.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: define <4 x float>
 // CHECK: define <4 x float>
 // CHECK: fn1
 // CHECK: fn1

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/incomp_array.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Verify no hang on incomplete array
 // Verify no hang on incomplete array
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/lib_mat_array.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 -Zpr %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -Zpr %s | FileCheck %s
 
 
 // check that matrix lowering succeeds
 // check that matrix lowering succeeds
 // CHECK-NOT: Fail to lower matrix load/store.
 // CHECK-NOT: Fail to lower matrix load/store.

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/lib_remove_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Ensure UnusedBuffer is removed:
 // Ensure UnusedBuffer is removed:
 // CHECK-NOT: @"\01?UnusedBuffer@@3UByteAddressBuffer@@A"
 // CHECK-NOT: @"\01?UnusedBuffer@@3UByteAddressBuffer@@A"

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/lib_select_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure createHandleFromResourceStructForLib is used for resource.
 // Make sure createHandleFromResourceStructForLib is used for resource.
 // CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.ByteAddressBuffer(i32 160
 // CHECK:call %dx.types.Handle @dx.op.createHandleFromResourceStructForLib.struct.ByteAddressBuffer(i32 160

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/noinline.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure noinline is present
 // Make sure noinline is present
 // CHECK: noinline
 // CHECK: noinline

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/opt_2x32_64_bitcast_invalid.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 -Zpr %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -Zpr %s | FileCheck %s
 
 
 // Make sure GVN does not do illegal bitcast for DXIL
 // Make sure GVN does not do illegal bitcast for DXIL
 // CHECK-NOT: bitcast i32* {{.*}} to i64*
 // CHECK-NOT: bitcast i32* {{.*}} to i64*

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_accept_ignore_hit.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call void @dx.op.acceptHitAndEndSearch(i32 156)
 // CHECK: call void @dx.op.acceptHitAndEndSearch(i32 156)
 // CHECK: call void @dx.op.ignoreHit(i32 155)
 // CHECK: call void @dx.op.ignoreHit(i32 155)

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: define void [[anyhit1:@"\\01\?anyhit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.MyAttributes* nocapture readonly %attr) #0 {
 // CHECK: define void [[anyhit1:@"\\01\?anyhit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.MyAttributes* nocapture readonly %attr) #0 {
 // CHECK:   call float @dx.op.objectRayOrigin.f32(i32 149, i8 2)
 // CHECK:   call float @dx.op.objectRayOrigin.f32(i32 149, i8 2)

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_in_payload.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be inout
 // CHECK: error: ray payload parameter must be inout
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_inout_attr.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: intersection attributes parameter must be in
 // CHECK: error: intersection attributes parameter must be in
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_no_attr.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: shader must include attributes structure parameter
 // CHECK: error: shader must include attributes structure parameter
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_no_payload.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: shader must include inout payload structure parameter
 // CHECK: error: shader must include inout payload structure parameter
 // CHECK: error: shader must include attributes structure parameter
 // CHECK: error: shader must include attributes structure parameter

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_out.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be inout
 // CHECK: error: ray payload parameter must be inout
 // CHECK: error: intersection attributes parameter must be in
 // CHECK: error: intersection attributes parameter must be in

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_anyhit_param.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 struct MyPayload {
 struct MyPayload {
   float4 color;
   float4 color;

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_attr_struct.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 //CHECK: User defined type intrinsic arg must be struct
 //CHECK: User defined type intrinsic arg must be struct
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_builtin.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: %struct.BuiltInTriangleIntersectionAttributes
 // CHECK: %struct.BuiltInTriangleIntersectionAttributes
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: ; S                                 sampler      NA          NA      S0             s1     1
 // CHECK: ; S                                 sampler      NA          NA      S0             s1     1
 // CHECK: ; T                                 texture     f32          2d      T0             t1     1
 // CHECK: ; T                                 texture     f32          2d      T0             t1     1

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_2param.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: only one parameter allowed for callable shader
 // CHECK: error: only one parameter allowed for callable shader
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_in.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: callable parameter must be declared inout
 // CHECK: error: callable parameter must be declared inout
 // CHECK: error: callable parameter must be a user defined type with only numeric contents.
 // CHECK: error: callable parameter must be a user defined type with only numeric contents.

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_out.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: callable parameter must be declared inout
 // CHECK: error: callable parameter must be declared inout
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_ret.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 struct MyParam {
 struct MyParam {
   float2 coord;
   float2 coord;

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callable_udt.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: callable parameter must be a user defined type with only numeric contents.
 // CHECK: error: callable parameter must be a user defined type with only numeric contents.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_callshader.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call void @dx.op.callShader.struct.Parameter(i32 159
 // CHECK: call void @dx.op.callShader.struct.Parameter(i32 159
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: define void [[closesthit1:@"\\01\?closesthit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.BuiltInTriangleIntersectionAttributes* nocapture readonly %attr) #0 {
 // CHECK: define void [[closesthit1:@"\\01\?closesthit1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload, %struct.BuiltInTriangleIntersectionAttributes* nocapture readonly %attr) #0 {
 // CHECK:   call void @dx.op.callShader.struct.MyParam(i32 159, i32 {{.*}}, %struct.MyParam* nonnull {{.*}})
 // CHECK:   call void @dx.op.callShader.struct.MyParam(i32 159, i32 {{.*}}, %struct.MyParam* nonnull {{.*}})

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_in_payload.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be inout
 // CHECK: error: ray payload parameter must be inout
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_inout_attr.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: intersection attributes parameter must be in
 // CHECK: error: intersection attributes parameter must be in
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_no_attr.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: shader must include attributes structure parameter
 // CHECK: error: shader must include attributes structure parameter
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_no_payload.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: shader must include inout payload structure parameter
 // CHECK: error: shader must include inout payload structure parameter
 // CHECK: error: shader must include attributes structure parameter
 // CHECK: error: shader must include attributes structure parameter

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_numeric.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -enable-16bit-types -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -enable-16bit-types -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: define void @"\01?closesthit_numeric
 // CHECK: define void @"\01?closesthit_numeric
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_out.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be inout
 // CHECK: error: ray payload parameter must be inout
 // CHECK: error: intersection attributes parameter must be in
 // CHECK: error: intersection attributes parameter must be in

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_closesthit_param.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 struct MyPayload {
 struct MyPayload {
   float4 color;
   float4 color;

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_intersection.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: define void [[intersection1:@"\\01\?intersection1@[^\"]+"]]() #0 {
 // CHECK: define void [[intersection1:@"\\01\?intersection1@[^\"]+"]]() #0 {
 // CHECK:   [[rayTCurrent:%[^ ]+]] = call float @dx.op.rayTCurrent.f32(i32 154)
 // CHECK:   [[rayTCurrent:%[^ ]+]] = call float @dx.op.rayTCurrent.f32(i32 154)

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_intersection_param.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: return type for ray tracing shaders must be void
 // CHECK: error: return type for ray tracing shaders must be void
 // CHECK: error: parameters are not allowed for intersection shader
 // CHECK: error: parameters are not allowed for intersection shader

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: define void [[miss1:@"\\01\?miss1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload) #0 {
 // CHECK: define void [[miss1:@"\\01\?miss1@[^\"]+"]](%struct.MyPayload* noalias nocapture %payload) #0 {
 // CHECK:   %0 = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0
 // CHECK:   %0 = getelementptr inbounds %struct.MyPayload, %struct.MyPayload* %payload, i32 0, i32 0

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_extra.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: only one parameter (ray payload) allowed for miss shader
 // CHECK: error: only one parameter (ray payload) allowed for miss shader
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_in.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be declared inout
 // CHECK: error: ray payload parameter must be declared inout
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_no_payload.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: shader must include inout payload structure parameter
 // CHECK: error: shader must include inout payload structure parameter
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_out.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be declared inout
 // CHECK: error: ray payload parameter must be declared inout
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_ret.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 struct MyPayload {
 struct MyPayload {
   float4 color;
   float4 color;

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_miss_udt.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: ray payload parameter must be a user defined type with only numeric contents.
 // CHECK: error: ray payload parameter must be a user defined type with only numeric contents.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_payload_struct.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 //CHECK: User defined type intrinsic arg must be struct
 //CHECK: User defined type intrinsic arg must be struct
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_raygen_param.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: error: return type for ray tracing shaders must be void
 // CHECK: error: return type for ray tracing shaders must be void
 // CHECK: error: parameters are not allowed for raygeneration shader
 // CHECK: error: parameters are not allowed for raygeneration shader

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_raygeneration.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: ; RTAS                              texture     i32         ras      T0             t5     1
 // CHECK: ; RTAS                              texture     i32         ras      T0             t5     1
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_reporthit.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call i1 @dx.op.reportHit.struct.Attr(i32 158
 // CHECK: call i1 @dx.op.reportHit.struct.Attr(i32 158
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_sgv_intrin.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call i32 @dx.op.dispatchRaysIndex.i32(i32 145, i8 0)
 // CHECK: call i32 @dx.op.dispatchRaysIndex.i32(i32 145, i8 0)
 // CHECK: call i32 @dx.op.dispatchRaysIndex.i32(i32 145, i8 1)
 // CHECK: call i32 @dx.op.dispatchRaysIndex.i32(i32 145, i8 1)

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_sgv_transforms.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 0)
 // CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 0)
 // CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 1)
 // CHECK: call float @dx.op.objectToWorld.f32(i32 151, i32 0, i8 1)

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_traceray.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call void @dx.op.traceRay.struct.Payload(i32 157,
 // CHECK: call void @dx.op.traceRay.struct.Payload(i32 157,
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_traceray_readback.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure we don't store the initial value (must load from payload after TraceRay)
 // Make sure we don't store the initial value (must load from payload after TraceRay)
 // CHECK: define void @"\01?RayGenTestMain@@YAXXZ"()
 // CHECK: define void @"\01?RayGenTestMain@@YAXXZ"()

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/raytracing_udt_sizes.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 -enable-16bit-types %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -enable-16bit-types %s | FileCheck %s
 
 
 ///////////////////////////////////////
 ///////////////////////////////////////
 // CHECK: !{void (%struct.Payload_20*, %struct.BuiltInTriangleIntersectionAttributes*)* @"\01?anyhit1@@YAXUPayload_20@@UBuiltInTriangleIntersectionAttributes@@@Z", i32 9, i32 20, i32 8}
 // CHECK: !{void (%struct.Payload_20*, %struct.BuiltInTriangleIntersectionAttributes*)* @"\01?anyhit1@@YAXUPayload_20@@UBuiltInTriangleIntersectionAttributes@@@Z", i32 9, i32 20, i32 8}

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/res_select2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure phi of resource for lib.
 // Make sure phi of resource for lib.
 // CHECK: phi %"class.RWBuffer
 // CHECK: phi %"class.RWBuffer

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/res_select3.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure phi of resource in lib.
 // Make sure phi of resource in lib.
 // CHECK: phi %"class.RWStructuredBuffer
 // CHECK: phi %"class.RWStructuredBuffer

+ 1 - 1
tools/clang/test/CodeGenHLSL/quick-test/structured_buffer_getdim_stride.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: ret i32 20
 // CHECK: ret i32 20
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/createHandle_multi.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s  | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s  | FileCheck %s
 
 
 // CHECK: %"class.Texture2D<float>" = type { float
 // CHECK: %"class.Texture2D<float>" = type { float
 // CHECK: %"class.Texture2D<vector<float, 4> >" = type { <4 x float>
 // CHECK: %"class.Texture2D<vector<float, 4> >" = type { <4 x float>

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/createHandle_multi2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_3 %s  | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s  | FileCheck %s
 
 
 // CHECK: %"class.Texture2D<vector<float, 4> >" = type { <4 x float>
 // CHECK: %"class.Texture2D<vector<float, 4> >" = type { <4 x float>
 // CHECK: %"class.Texture2D<float>" = type { float
 // CHECK: %"class.Texture2D<float>" = type { float

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/ignore_line_directives.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 -Zi  -ignore-line-directives %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -Zi  -ignore-line-directives %s | FileCheck %s
 
 
 // Make sure only 1 DIFile exist in debug info when NoLineDirectives is enabled.
 // Make sure only 1 DIFile exist in debug info when NoLineDirectives is enabled.
 // CHECK: !DIFile
 // CHECK: !DIFile

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/inout_subscript.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure subscript on inout vector works.
 // Make sure subscript on inout vector works.
 // CHECK: noalias
 // CHECK: noalias

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure function call on external function has correct type.
 // Make sure function call on external function has correct type.
 // CHECK: call float @"\01?test_extern@@YAMUT@@Y01U1@U1@AIAV?$matrix@M$01$01@@@Z"(%struct.T* {{.*}}, [2 x %struct.T]* {{.*}}, %struct.T* nonnull {{.*}}, %class.matrix.float.2.2* dereferenceable(16) {{.*}})
 // CHECK: call float @"\01?test_extern@@YAMUT@@Y01U1@U1@AIAV?$matrix@M$01$01@@@Z"(%struct.T* {{.*}}, [2 x %struct.T]* {{.*}}, %struct.T* nonnull {{.*}}, %class.matrix.float.2.2* dereferenceable(16) {{.*}})

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure no undef in test3.
 // Make sure no undef in test3.
 // CHECK: define <4 x float>
 // CHECK: define <4 x float>

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten3.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure function call on external function has correct type.
 // Make sure function call on external function has correct type.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_arg_flatten4.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure function call on external function has correct type.
 // Make sure function call on external function has correct type.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_empty_struct_arg.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure empty struct arg works.
 // Make sure empty struct arg works.
 // CHECK: call float @"\01?test@@YAMUT@@@Z"(%struct.T* %t)
 // CHECK: call float @"\01?test@@YAMUT@@@Z"(%struct.T* %t)

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_arg_flatten/lib_ret_struct.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure struct param used as out arg works.
 // Make sure struct param used as out arg works.
 
 

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_no_flat_extern_func.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure extern function don't need to flat is called.
 // Make sure extern function don't need to flat is called.
 // CHECK: call void @"\01?test@@YAXMAIAM@Z"
 // CHECK: call void @"\01?test@@YAXMAIAM@Z"

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_out_param_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: call void @"\01?GetBuf@@YA?AV?$Buffer@V?$vector@M$03@@@@XZ"(%"class.Buffer<vector<float, 4> >"* nonnull sret {{.*}})
 // CHECK: call void @"\01?GetBuf@@YA?AV?$Buffer@V?$vector@M$03@@@@XZ"(%"class.Buffer<vector<float, 4> >"* nonnull sret {{.*}})
 // Make sure resource return type works.
 // Make sure resource return type works.

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_out_param_res_imp.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK: load %"class.Buffer<vector<float, 4> >", %"class.Buffer<vector<float, 4> >"* @"\01?buf@@3V?$Buffer@V?$vector@M$03@@@@A"
 // CHECK: load %"class.Buffer<vector<float, 4> >", %"class.Buffer<vector<float, 4> >"* @"\01?buf@@3V?$Buffer@V?$vector@M$03@@@@A"
 // CHECK: store %"class.Buffer<vector<float, 4> >"
 // CHECK: store %"class.Buffer<vector<float, 4> >"

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_out_undef.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 -Zpr %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 -Zpr %s | FileCheck %s
 
 
 // CHECK: call void @"\01?GetMat
 // CHECK: call void @"\01?GetMat
 // CHECK-NOT: undef
 // CHECK-NOT: undef

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_res_sel.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure select resource works for lib profile.
 // Make sure select resource works for lib profile.
 // CHECK: call %dx.types.Handle @"dx.op.createHandleFromResourceStructForLib.class.RWStructuredBuffer<vector<float, 2> >"
 // CHECK: call %dx.types.Handle @"dx.op.createHandleFromResourceStructForLib.class.RWStructuredBuffer<vector<float, 2> >"

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_ret_res.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // Make sure handle store not unpack.
 // Make sure handle store not unpack.
 // CHECK: store %struct.SamplerState {{.*}}, %struct.SamplerState*
 // CHECK: store %struct.SamplerState {{.*}}, %struct.SamplerState*

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_unresolved_func1.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK-DAG: define float @"\01?lib1_fn@@YAMXZ"()
 // CHECK-DAG: define float @"\01?lib1_fn@@YAMXZ"()
 // CHECK-DAG: declare float @"\01?external_fn@@YAMXZ"()
 // CHECK-DAG: declare float @"\01?external_fn@@YAMXZ"()

+ 1 - 1
tools/clang/test/CodeGenHLSL/shader-compat-suite/lib_unresolved_func2.hlsl

@@ -1,4 +1,4 @@
-// RUN: %dxc -T lib_6_1 %s | FileCheck %s
+// RUN: %dxc -T lib_6_3 -auto-binding-space 11 %s | FileCheck %s
 
 
 // CHECK-DAG: define float @"\01?lib2_fn@@YAMXZ"()
 // CHECK-DAG: define float @"\01?lib2_fn@@YAMXZ"()
 // CHECK-DAG: declare float @"\01?external_fn@@YAMXZ"()
 // CHECK-DAG: declare float @"\01?external_fn@@YAMXZ"()

Some files were not shown because too many files changed in this diff