Add stencil reference as a supported shader builtin

This commit is contained in:
baldurk
2018-06-22 19:28:31 +01:00
parent 233fbedf35
commit 199a1f6de5
5 changed files with 11 additions and 0 deletions
+1
View File
@@ -518,6 +518,7 @@ std::string DoStringise(const ShaderBuiltin &el)
STRINGISE_ENUM_CLASS_NAMED(DepthOutput, "Depth Output");
STRINGISE_ENUM_CLASS_NAMED(DepthOutputGreaterEqual, "Depth Output (GEqual)");
STRINGISE_ENUM_CLASS_NAMED(DepthOutputLessEqual, "Depth Output (LEqual)");
STRINGISE_ENUM_CLASS_NAMED(StencilReference, "Stencil Ref Value");
}
END_ENUM_STRINGISE();
}
+5
View File
@@ -744,6 +744,10 @@ to apply to multiple related things - see :data:`ClipDistance`, :data:`CullDista
For indirect or multi-draw commands, the index of this draw call within the overall draw command.
.. data:: StencilReference
The stencil reference to be used for stenciling operations on this fragment.
)");
enum class ShaderBuiltin : uint32_t
{
@@ -780,6 +784,7 @@ enum class ShaderBuiltin : uint32_t
BaseVertex,
BaseInstance,
DrawIndex,
StencilReference,
Count,
};
@@ -177,6 +177,8 @@ ShaderDebug::State D3D11DebugManager::CreateShaderDebugState(ShaderDebugTrace &t
v.name = "oDepthGreaterEqual";
else if(sig.systemValue == ShaderBuiltin::MSAACoverage)
v.name = "oMask";
else if(sig.systemValue == ShaderBuiltin::StencilReference)
v.name = "oStencilRef";
// if(sig.systemValue == TYPE_OUTPUT_CONTROL_POINT) str = "oOutputControlPoint";
else
{
+2
View File
@@ -1883,6 +1883,8 @@ void MakeShaderReflection(const GLHookSet &gl, GLenum shadType, GLuint sepProg,
sig.systemValue = ShaderBuiltin::DepthOutput;
if(IS_BUILTIN("gl_SampleMask"))
sig.systemValue = ShaderBuiltin::MSAACoverage;
if(IS_BUILTIN("gl_FragStencilRefARB"))
sig.systemValue = ShaderBuiltin::StencilReference;
// CS built-in inputs
if(IS_BUILTIN("gl_NumWorkGroups"))
@@ -3682,6 +3682,7 @@ ShaderBuiltin BuiltInToSystemAttribute(ShaderStage stage, const spv::BuiltIn el)
case spv::BuiltInBaseInstance: return ShaderBuiltin::BaseInstance;
case spv::BuiltInDrawIndex: return ShaderBuiltin::DrawIndex;
case spv::BuiltInViewIndex: return ShaderBuiltin::ViewportIndex;
case spv::BuiltInFragStencilRefEXT: return ShaderBuiltin::StencilReference;
default: break;
}