Exemplo n.º 1
0
        public override Hash64 GetHash64()
        {
            var result = Hash64.Empty;

            if (mShaderMacroArray.Count > 0)
            {
                Hash64.CalcHash64(ref result, ToString());
            }
            return(result);
        }
Exemplo n.º 2
0
        public CBlendState GetBlendState(CRenderContext rc, CBlendStateDesc desc)
        {
            Hash64 hash = new Hash64();

            unsafe
            {
                Hash64.CalcHash64(&hash, (byte *)&desc, sizeof(CBlendStateDesc));
            }
            CBlendState state;

            if (States.TryGetValue(hash, out state) == false)
            {
                state = rc.CreateBlendState(desc);
                States.Add(hash, state);
            }
            return(state);
        }
Exemplo n.º 3
0
        internal static string GetShaderFile(ref Hash64 hash)
        {
            var    sm   = CRenderContext.ShaderModelString;
            string path = "";

            switch (CIPlatform.Instance.PlayMode)
            {
            case CIPlatform.enPlayMode.Cook:
                path = CEngine.Instance.FileManager.CookingRoot + "deriveddatacache/" + sm + "/" + hash.ToString().ToLower() + ".shader";
                break;

            case CIPlatform.enPlayMode.Game:
            case CIPlatform.enPlayMode.Editor:
            case CIPlatform.enPlayMode.PlayerInEditor:
                path = CEngine.Instance.FileManager.DDCDirectory + sm + "/" + hash.ToString().ToLower() + ".shader";
                break;
            }
            return(path);
        }