Example #1
0
 private IEmitVal EmitExpImpl(
     MidAttributeRef attrRef,
     IEmitBlock block,
     EmitEnv env)
 {
     return(EmitAttributeRef(attrRef.Decl, block, env));
 }
Example #2
0
        private void SetSource(
            ref MidExp srcExp,
            MidAttributeDecl attr)
        {
            if (srcExp != null)
            {
                if (srcExp is MidAttributeRef)
                {
                    var srcAttr = ((MidAttributeRef)srcExp).Decl;
                    if (srcAttr != attr)
                    {
                        throw OperationTooComplexError(srcExp.Range);
                    }
                }
                else
                {
                    throw OperationTooComplexError(srcExp.Range);
                }
            }

            srcExp = new MidAttributeRef(attr.Range, attr, new LazyFactory());
        }
        private void SetSource(
            ref MidExp srcExp,
            MidAttributeDecl attr)
        {
            if( srcExp != null )
            {
                if (srcExp is MidAttributeRef)
                {
                    var srcAttr = ((MidAttributeRef)srcExp).Decl;
                    if (srcAttr != attr)
                    {
                        throw OperationTooComplexError(srcExp.Range);
                    }
                }
                else
                {
                    throw OperationTooComplexError(srcExp.Range);
                }
            }

            srcExp = new MidAttributeRef(attr.Range, attr, new LazyFactory());
        }
 private AttrInfo DecomposeAttrImpl(
     MidAttributeRef midAttrRef,
     DecomposeAttrContext context)
 {
     return DecomposeAttr(midAttrRef.Decl, context);
 }
 private object GetUniformValKeyImpl(
     MidAttributeRef val)
 {
     return val.Decl;
 }
 private EmitValHLSL EmitValImpl(MidAttributeRef attribRef, Span span)
 {
     return EmitAttribRef(attribRef.Decl, span);
 }
        private string EmitAttrLitImpl(
            MidAttributeRef exp )
        {
            EmitValHLSL val;
            if( _attrVals.TryGetValue(exp.Decl, out val) )
                return val.ToString();

            throw new NotImplementedException();
        }
 public void PreEmitExpImpl(
     MidAttributeRef exp,
     Span span)
 {
     // Ensure that we've already emitted the attribute
     EmitAttribRef(exp.Decl, span);
 }
Example #9
0
 private AttributeInfo DecomposeAttrImpl(
     SourceRange range,
     MidAttributeRef midAttrRef)
 {
     return(DecomposeAttr(range, midAttrRef.Decl));
 }
 private MidExp SimplifyExpImpl(MidAttributeRef val, SimplifyEnv env)
 {
     if (val.IsLazy)
     {
         return _exps.AttributeRef(val.Range, val.Decl);
     }
     return val;
 }
        public MidAttributeRef CleanupExp( MidAttributeRef exp )
        {
            var oldAttr = exp.Decl;
            var newAttr = MapOldToNew( oldAttr );
            if( newAttr == oldAttr )
                return exp;

            newAttr.TrySetName( oldAttr.Name, oldAttr.Range );
            return _exps.AttributeRef( exp.Range, newAttr );
        }
Example #12
0
 private AttrInfo DecomposeAttrImpl(
     MidAttributeRef midAttrRef,
     DecomposeAttrContext context)
 {
     return(DecomposeAttr(midAttrRef.Decl, context));
 }
 private MidVal ReplaceImpl(
     MidAttributeRef attrRef)
 {
     throw new NotImplementedException();
 }
 private AttributeInfo DecomposeAttrImpl(
     SourceRange range,
     MidAttributeRef midAttrRef)
 {
     return DecomposeAttr(range, midAttrRef.Decl);
 }