Allow ExecutionModeStencilRefReplacingEXT execution mode
ExecutionModeStencilRefReplacingEXT is part of the
SPV_EXT_shader_stencil_export extension, which is already supported.
See:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/swiftshader/src/Pipeline/SpirvShader.cpp;l=821
This CL allows the ExecutionModeStencilRefReplacingEXT execution mode
to be used in a SPIR-V shader, which is already supported.
Bug: b/244332223
Change-Id: Ic7d18d44cb2d8274decad93d47c2514961480f24
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/67929
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Alexis Hétu <sugoi@google.com>
diff --git a/src/Pipeline/SpirvShader.cpp b/src/Pipeline/SpirvShader.cpp
index 28516ed..875d534 100644
--- a/src/Pipeline/SpirvShader.cpp
+++ b/src/Pipeline/SpirvShader.cpp
@@ -1053,6 +1053,9 @@
// TODO(b/177915067): Can be used to optimize depth test, currently unused.
executionModes.DepthUnchanged = true;
break;
+ case spv::ExecutionModeStencilRefReplacingEXT:
+ executionModes.StencilRefReplacing = true;
+ break;
case spv::ExecutionModeLocalSize:
case spv::ExecutionModeLocalSizeId:
executionModes.WorkgroupSizeX = insn.word(3);
diff --git a/src/Pipeline/SpirvShader.hpp b/src/Pipeline/SpirvShader.hpp
index 0c67b5f..b0288b2 100644
--- a/src/Pipeline/SpirvShader.hpp
+++ b/src/Pipeline/SpirvShader.hpp
@@ -654,6 +654,7 @@
bool DepthGreater : 1;
bool DepthLess : 1;
bool DepthUnchanged : 1;
+ bool StencilRefReplacing : 1;
// Compute workgroup dimensions
Object::ID WorkgroupSizeX = 1;