string GetSVRegisterName() { switch (SemanticName.ToUpper()) { case "SV_DEPTH": return("oDepth"); case "SV_DEPTHGREATEREQUAL": return("oDepthGE"); case "SV_DEPTHLESSEQUAL": return("oDepthLE"); case "SV_COVERAGE": return("oMask"); case "SV_STENCILREF": return("oStencilRef"); } if (SystemValueType == Name.PrimitiveID) { return("primID"); } else { return("special"); } }
internal void UpdateVersion(ChunkType chunkType, ShaderVersion version) { ProgramType programType = version.ProgramType; if (chunkType == ChunkType.Pcsg && programType == ProgramType.HullShader) { ReadWriteMask = (ComponentMask)(ComponentMask.All - ReadWriteMask); } // Vertex and pixel shaders need special handling for SystemValueType in the output signature. if ((programType == ProgramType.PixelShader || programType == ProgramType.VertexShader) && (chunkType == ChunkType.Osg5 || chunkType == ChunkType.Osgn || chunkType == ChunkType.Osg1)) { if (Register == 0xffffffff) { switch (SemanticName.ToUpper()) { case "SV_DEPTH": SystemValueType = Name.Depth; break; case "SV_COVERAGE": SystemValueType = Name.Coverage; break; case "SV_DEPTHGREATEREQUAL": SystemValueType = Name.DepthGreaterEqual; break; case "SV_DEPTHLESSEQUAL": SystemValueType = Name.DepthLessEqual; break; case "SV_STENCILREF": SystemValueType = Name.StencilRef; break; } } else if (programType == ProgramType.PixelShader) { SystemValueType = Name.Target; } } }