示例#1
0
        private unsafe EffectObjectIds ComputeInternal(ShaderMixinSource mixin, ShaderMixinParameters mixinParameters)
        {
            // Write to memory stream
            memStream.Position = 0;
            writer.Write(mixin);

            parameters.Clear();
            parameters.Set(CompilerParameters.GraphicsPlatformKey, mixinParameters.Get(CompilerParameters.GraphicsPlatformKey));
            parameters.Set(CompilerParameters.GraphicsProfileKey, mixinParameters.Get(CompilerParameters.GraphicsProfileKey));
            parameters.Set(CompilerParameters.DebugKey, mixinParameters.Get(CompilerParameters.DebugKey));
            writer.Write(parameters);

            // Compute hash
            objectIdBuilder.Reset();
            objectIdBuilder.Write((byte *)buffer, (int)memStream.Position);

            EffectObjectIds ids;

            ids.CompileParametersId = objectIdBuilder.ComputeHash();

            memStream.Position = 0;
            writer.Write(mixin);
            writer.Write(mixinParameters);
            objectIdBuilder.Reset();
            objectIdBuilder.Write((byte *)buffer, (int)memStream.Position);
            ids.FullParametersId = objectIdBuilder.ComputeHash();

            return(ids);
        }
示例#2
0
        private unsafe ObjectId ComputeInternal(ShaderMixinSource mixin, ShaderMixinParameters mixinParameters)
        {
            // Write to memory stream
            memStream.Position = 0;
            writer.Write(EffectBytecode.MagicHeader); // Write the effect bytecode magic header
            writer.Write(mixin);

            parameters.Clear();
            parameters.Set(CompilerParameters.GraphicsPlatformKey, mixinParameters.Get(CompilerParameters.GraphicsPlatformKey));
            parameters.Set(CompilerParameters.GraphicsProfileKey, mixinParameters.Get(CompilerParameters.GraphicsProfileKey));
            parameters.Set(CompilerParameters.DebugKey, mixinParameters.Get(CompilerParameters.DebugKey));
            writer.Write(parameters);

            // Compute hash
            objectIdBuilder.Reset();
            objectIdBuilder.Write((byte *)buffer, (int)memStream.Position);

            return(objectIdBuilder.ComputeHash());
        }
示例#3
0
        private unsafe ObjectId ComputeInternal(ShaderMixinSource mixin, ShaderMixinParameters mixinParameters)
        {
            // Write to memory stream
            memStream.Position = 0;
            writer.Write(EffectBytecode.MagicHeader); // Write the effect bytecode magic header
            writer.Write(mixin);

            parameters.Clear();
            parameters.Set(CompilerParameters.GraphicsPlatformKey, mixinParameters.Get(CompilerParameters.GraphicsPlatformKey));
            parameters.Set(CompilerParameters.GraphicsProfileKey, mixinParameters.Get(CompilerParameters.GraphicsProfileKey));
            parameters.Set(CompilerParameters.DebugKey, mixinParameters.Get(CompilerParameters.DebugKey));
            writer.Write(parameters);

            // Compute hash
            objectIdBuilder.Reset();
            objectIdBuilder.Write((byte*)buffer, (int)memStream.Position);

            return objectIdBuilder.ComputeHash();
        }