Ejemplo n.º 1
0
        public static ShaderOp GenerateOutputStruct(FrontEndTranslator translator, ShaderType shaderType, ShaderInterfaceSet interfaceSet, ShaderBlock declarationBlock, ShaderBlock decorationsBlock)
        {
            if (interfaceSet.Fields.Count == 0)
            {
                return(null);
            }

            var typeName     = shaderType.mMeta.TypeName.CloneAsAppended("_Outputs");
            var instanceName = "Out";
            var instanceOp   = EntryPointGenerationShared.GenerateInterfaceStructAndOp(translator, interfaceSet.Fields, typeName, instanceName, StorageClass.Output);

            Decorations.AddDecorationLocation(translator, instanceOp, 0, decorationsBlock);
            declarationBlock.mLocalVariables.Add(instanceOp);
            return(instanceOp);
        }