Exemplo n.º 1
0
        // only for use by the Builder
        ShaderFunction(ShaderContainer container, FoundryHandle functionHandle, string name, string body, FoundryHandle returnTypeHandle, List <FunctionParameter> parameters, FoundryHandle parentBlockHandle)
        {
            this.container = container;
            if (container != null)
            {
                FoundryHandle parametersList = FixedHandleListInternal.Build(container, parameters, (p) => (p.handle));
                handle = functionHandle;
                container.SetFunction(functionHandle, name, body, returnTypeHandle, parametersList, parentBlockHandle);
                function = container.GetFunction(handle);
                return;
            }

            // failure
            this = Invalid;
        }
Exemplo n.º 2
0
 internal ShaderFunction(ShaderContainer container, FoundryHandle handle)
 {
     this.container = container;
     this.handle    = handle;
     this.function  = container?.GetFunction(handle) ?? ShaderFunctionInternal.Invalid();
 }