Browse Source

[spirv] Update external projects (#1205)

Lei Zhang 7 năm trước cách đây
mục cha
commit
db417e9ad5

+ 1 - 1
external/SPIRV-Headers

@@ -1 +1 @@
-Subproject commit b13b3be4cc38eb0b2f4b1d296f3fa41b27cefc5e
+Subproject commit 12f8de9f04327336b699b1b80aa390ae7f9ddbf4

+ 1 - 1
external/SPIRV-Tools

@@ -1 +1 @@
-Subproject commit 742454968db1da529f54050bac9e6cc40d0611fb
+Subproject commit 42840d15e4bf5cba4a7345639b409c6e962b96c2

+ 1 - 1
external/googletest

@@ -1 +1 @@
-Subproject commit f35fe6de3b25671099de0bf69b016eed3832dc9e
+Subproject commit 82febb8eafc0425601b0d46567dc66c7750233ff

+ 1 - 1
external/re2

@@ -1 +1 @@
-Subproject commit c1ed8543f1b703ce200212bb5629ba69a2f9b63a
+Subproject commit f2cc1aeb5de463c45d020c446cbcb028385b49f3

+ 3 - 0
tools/clang/lib/SPIRV/DeclResultIdMapper.cpp

@@ -1956,6 +1956,9 @@ uint32_t DeclResultIdMapper::createSpirvStageVar(StageVar *stageVar,
   case hlsl::Semantic::Kind::DepthGreaterEqual:
   case hlsl::Semantic::Kind::DepthLessEqual: {
     stageVar->setIsSpirvBuiltin();
+    // Vulkan requires the DepthReplacing execution mode to write to FragDepth.
+    theBuilder.addExecutionMode(entryFunctionId,
+                                spv::ExecutionMode::DepthReplacing, {});
     if (semanticKind == hlsl::Semantic::Kind::DepthGreaterEqual)
       theBuilder.addExecutionMode(entryFunctionId,
                                   spv::ExecutionMode::DepthGreater, {});

+ 1 - 0
tools/clang/test/CodeGenSPIRV/semantic.depth-greater-equal.ps.hlsl

@@ -2,6 +2,7 @@
 
 // CHECK: OpEntryPoint Fragment %main "main" %in_var_A %gl_FragDepth
 
+// CHECK: OpExecutionMode %main DepthReplacing
 // CHECK: OpExecutionMode %main DepthGreater
 
 // CHECK: OpDecorate %gl_FragDepth BuiltIn FragDepth

+ 1 - 0
tools/clang/test/CodeGenSPIRV/semantic.depth-less-equal.ps.hlsl

@@ -2,6 +2,7 @@
 
 // CHECK: OpEntryPoint Fragment %main "main" %in_var_A %gl_FragDepth
 
+// CHECK: OpExecutionMode %main DepthReplacing
 // CHECK: OpExecutionMode %main DepthLess
 
 // CHECK: OpDecorate %gl_FragDepth BuiltIn FragDepth

+ 2 - 0
tools/clang/test/CodeGenSPIRV/semantic.depth.ps.hlsl

@@ -2,6 +2,8 @@
 
 // CHECK:                 OpEntryPoint Fragment %main "main" %in_var_A %gl_FragDepth
 
+// CHECK:                 OpExecutionMode %main DepthReplacing
+
 // CHECK:                 OpDecorate %gl_FragDepth BuiltIn FragDepth
 
 // CHECK: %gl_FragDepth = OpVariable %_ptr_Output_float Output

+ 1 - 3
tools/clang/unittests/SPIRV/CodeGenSPIRVTest.cpp

@@ -92,9 +92,7 @@ TEST_F(FileTest, 16BitDisabledScalarConstants) {
   runFileTest("constant.scalar.16bit.disabled.hlsl");
 }
 TEST_F(FileTest, 16BitEnabledScalarConstants) {
-  // TODO: Fix spirv-val to make sure it respects the 16-bit extension.
-  runFileTest("constant.scalar.16bit.enabled.hlsl", Expect::Success,
-              /*runValidation*/ false);
+  runFileTest("constant.scalar.16bit.enabled.hlsl");
 }
 TEST_F(FileTest, 64BitScalarConstants) {
   runFileTest("constant.scalar.64bit.hlsl");