Spark.Emit.HLSL.EmitContextHLSL.EmitUniformRef C# (CSharp) Method

EmitUniformRef() private method

private EmitUniformRef ( MidVal uniformVal, Span span ) : EmitValHLSL
uniformVal MidVal
span Span
return EmitValHLSL
        private EmitValHLSL EmitUniformRef(MidVal uniformVal, Span span)
        {
            var uniformType = uniformVal.Type;
            if (uniformType is MidBuiltinType)
            {
                var builtinType = (MidBuiltinType)uniformType;
                switch (builtinType.Name)
                {
                    case "Buffer":
                    case "Texture1D":
                    case "Texture1DArray":
                    case "Texture2D":
                    case "Texture2DArray":
                    case "Texture3D":
                    case "Texture3DArray":
                    case "TextureCube":
                    case "TextureCubeArray":
                        return EmitShaderResourceRef(builtinType, uniformVal, span);
                    case "SamplerState":
                    case "SamplerComparisonState":
                        return EmitSamplerStateRef(builtinType, uniformVal, span);
                }
            }

            var uString = _shared.EmitUniformRef(uniformVal);
            var uType = EmitType(uniformVal.Type);

            return new SimpleValHLSL(
                uString,
                (RealTypeHLSL) uType);
        }