Beispiel #1
0
        public GlobalShaderField FindStaticField(ISymbol symbol)
        {
            // Try and find the type that owns this symbol
            var owningType = mFrontEnd.mCurrentLibrary.FindType(new TypeKey(symbol.ContainingType));

            if (owningType == null)
            {
                return(null);
            }

            // Find the field on this symbol
            ShaderField shaderField;
            int         fieldIndex;

            mFrontEnd.FindField(owningType, symbol.Name, out shaderField, out fieldIndex);
            // Look up the stored spirv field in the library
            var staticOp = mFrontEnd.mCurrentLibrary.mStaticGlobals.GetValueOrDefault(shaderField);

            return(staticOp);
        }