D3D11_BLEND GetTermBlendDescImpl( TermInfo info, AttrCase channel, TermFlavor flavor) { // Need to look for a match on our target type var left = info._left; var right = info._right; AttrInfo factor = null; if (left.IsFactor(flavor, channel)) { factor = right; } else if (right.IsFactor(flavor, channel)) { factor = left; } else { throw OperationTooComplexError(info.Range); } return(GetFactorBlendDesc( factor, channel)); }
D3D11_BLEND GetTermBlendDesc( AttrInfo info, AttrCase channel, TermFlavor flavor) { return(GetTermBlendDescImpl((dynamic)info, channel, flavor)); }
ChannelBlendDesc GetChannelBlendDescImpl( OpInfo info, AttrCase channel) { // \todo: Need to pick whether left or right is src/dest ChannelBlendDesc result; var left = info._left; var right = info._right; if (CanUseAs(left, channel, TermFlavor.Src) && CanUseAs(right, channel, TermFlavor.Dest)) { result.srcBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Src); result.destBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Dest); } else if (CanUseAs(left, channel, TermFlavor.Dest) && CanUseAs(right, channel, TermFlavor.Src)) { result.destBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Dest); result.srcBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Src); } else { throw OperationTooComplexError(info.Range); } result.op = info._op; return(result); }
bool CanUseAsImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { return(info.IsFactor(flavor, channel)); }
public override bool IsFactor( TermFlavor flavor, AttrCase channel) { if (flavor == TermFlavor.Dest) { if (channel == AttrCase.Color) { return(_color == D3D11_BLEND.D3D11_BLEND_DEST_COLOR); } else if (channel == AttrCase.Alpha) { return(_alpha == D3D11_BLEND.D3D11_BLEND_DEST_ALPHA); } } else if (flavor == TermFlavor.Src) { if (channel == AttrCase.Color) { return(_color == D3D11_BLEND.D3D11_BLEND_SRC_COLOR); } else if (channel == AttrCase.Alpha) { return(_alpha == D3D11_BLEND.D3D11_BLEND_SRC_ALPHA); } } return(false); }
D3D11_BLEND GetSubFactorBlendDescImpl( AttrInfo left, AttrInfo right, AttrCase channel) { throw OperationTooComplexError(right.Range); }
D3D11_BLEND GetFactorBlendDescImpl( SubInfo info, AttrCase channel) { return(GetSubFactorBlendDescImpl( (dynamic)info._left, (dynamic)info._right, channel)); }
public override bool IsFactor( TermFlavor flavor, AttrCase channel) { if (flavor == TermFlavor.Dest) { return(true); } return(false); }
bool CanUseAs( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) { return(true); } return(CanUseAsImpl((dynamic)info, channel, flavor)); }
D3D11_BLEND GetTermBlendDescImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) { return(D3D11_BLEND.D3D11_BLEND_ONE); } throw OperationTooComplexError(info.Range); }
bool CanUseAsImpl( TermInfo info, AttrCase channel, TermFlavor flavor) { var left = info._left; var right = info._right; bool canUseLeft = CanUseAs(left, channel, flavor); bool canUseRight = CanUseAs(right, channel, flavor); return(canUseLeft || canUseRight); }
D3D11_BLEND GetFactorBlendDescImpl( FactorInfo info, AttrCase channel) { switch (channel) { case AttrCase.Color: return(info._color); case AttrCase.Alpha: return(info._alpha); default: throw OperationTooComplexError(info.Range); } }
D3D11_BLEND GetSubFactorBlendDescImpl( LitInfo left, AttrInfo right, AttrCase channel) { var value = left._value; if (value != 1.0f) { throw OperationTooComplexError(right.Range); } var factor = GetFactorBlendDesc(right, channel); switch (factor) { case D3D11_BLEND.D3D11_BLEND_SRC_COLOR: return(D3D11_BLEND.D3D11_BLEND_INV_SRC_COLOR); case D3D11_BLEND.D3D11_BLEND_SRC_ALPHA: return(D3D11_BLEND.D3D11_BLEND_INV_SRC_ALPHA); case D3D11_BLEND.D3D11_BLEND_DEST_ALPHA: return(D3D11_BLEND.D3D11_BLEND_INV_DEST_ALPHA); case D3D11_BLEND.D3D11_BLEND_DEST_COLOR: return(D3D11_BLEND.D3D11_BLEND_INV_DEST_COLOR); case D3D11_BLEND.D3D11_BLEND_BLEND_FACTOR: return(D3D11_BLEND.D3D11_BLEND_INV_BLEND_FACTOR); case D3D11_BLEND.D3D11_BLEND_SRC1_COLOR: return(D3D11_BLEND.D3D11_BLEND_INV_SRC1_COLOR); case D3D11_BLEND.D3D11_BLEND_SRC1_ALPHA: return(D3D11_BLEND.D3D11_BLEND_INV_SRC1_ALPHA); default: throw OperationTooComplexError(right.Range); } }
D3D11_BLEND GetFactorBlendDescImpl( AttrInfo info, AttrCase channel) { throw OperationTooComplexError(info.Range); }
D3D11_BLEND GetFactorBlendDescImpl( DestInfo info, AttrCase channel) { return D3D11_BLEND.D3D11_BLEND_ONE; }
ChannelBlendDesc GetChannelBlendDescImpl( OpInfo info, AttrCase channel) { // \todo: Need to pick whether left or right is src/dest ChannelBlendDesc result; var left = info._left; var right = info._right; if (CanUseAs(left, channel, TermFlavor.Src) && CanUseAs(right, channel, TermFlavor.Dest)) { result.srcBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Src); result.destBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Dest); } else if (CanUseAs(left, channel, TermFlavor.Dest) && CanUseAs(right, channel, TermFlavor.Src)) { result.destBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Dest); result.srcBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Src); } else { throw OperationTooComplexError(info.Range); } result.op = info._op; return result; }
D3D11_BLEND GetFactorBlendDesc( AttrInfo info, AttrCase channel ) { return GetFactorBlendDescImpl((dynamic)info, channel); }
D3D11_BLEND GetTermBlendDesc( AttrInfo info, AttrCase channel, TermFlavor flavor) { return GetTermBlendDescImpl((dynamic)info, channel, flavor); }
D3D11_BLEND GetFactorBlendDescImpl( DestInfo info, AttrCase channel) { return(D3D11_BLEND.D3D11_BLEND_ONE); }
bool CanUseAsImpl( TermInfo info, AttrCase channel, TermFlavor flavor) { var left = info._left; var right = info._right; bool canUseLeft = CanUseAs(left, channel, flavor); bool canUseRight = CanUseAs(right, channel, flavor); return canUseLeft || canUseRight; }
D3D11_BLEND GetSubFactorBlendDescImpl( LitInfo left, AttrInfo right, AttrCase channel) { var value = left._value; if (value != 1.0f) { throw OperationTooComplexError(right.Range); } var factor = GetFactorBlendDesc(right, channel); switch( factor ) { case D3D11_BLEND.D3D11_BLEND_SRC_COLOR: return D3D11_BLEND.D3D11_BLEND_INV_SRC_COLOR; case D3D11_BLEND.D3D11_BLEND_SRC_ALPHA: return D3D11_BLEND.D3D11_BLEND_INV_SRC_ALPHA; case D3D11_BLEND.D3D11_BLEND_DEST_ALPHA: return D3D11_BLEND.D3D11_BLEND_INV_DEST_ALPHA; case D3D11_BLEND.D3D11_BLEND_DEST_COLOR: return D3D11_BLEND.D3D11_BLEND_INV_DEST_COLOR; case D3D11_BLEND.D3D11_BLEND_BLEND_FACTOR: return D3D11_BLEND.D3D11_BLEND_INV_BLEND_FACTOR; case D3D11_BLEND.D3D11_BLEND_SRC1_COLOR: return D3D11_BLEND.D3D11_BLEND_INV_SRC1_COLOR; case D3D11_BLEND.D3D11_BLEND_SRC1_ALPHA: return D3D11_BLEND.D3D11_BLEND_INV_SRC1_ALPHA; default: throw OperationTooComplexError(right.Range); } }
public override bool IsFactor( TermFlavor flavor, AttrCase channel) { if (flavor == TermFlavor.Dest) return true; return false; }
ChannelBlendDesc GetChannelBlendDesc( AttrInfo info, AttrCase channel) { return(GetChannelBlendDescImpl((dynamic)info, channel)); }
D3D11_BLEND GetTermBlendDescImpl( TermInfo info, AttrCase channel, TermFlavor flavor) { // Need to look for a match on our target type var left = info._left; var right = info._right; AttrInfo factor = null; if (left.IsFactor(flavor, channel)) { factor = right; } else if (right.IsFactor(flavor, channel)) { factor = left; } else { throw OperationTooComplexError(info.Range); } return GetFactorBlendDesc( factor, channel ); }
ChannelBlendDesc GetChannelBlendDescImpl( AttrInfo info, AttrCase channel) { throw OperationTooComplexError(info.Range); }
D3D11_BLEND GetFactorBlendDesc( AttrInfo info, AttrCase channel) { return(GetFactorBlendDescImpl((dynamic)info, channel)); }
D3D11_BLEND GetFactorBlendDescImpl( FactorInfo info, AttrCase channel) { switch (channel) { case AttrCase.Color: return info._color; case AttrCase.Alpha: return info._alpha; default: throw OperationTooComplexError(info.Range); } }
bool CanUseAsImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { return info.IsFactor(flavor, channel); }
D3D11_BLEND GetFactorBlendDescImpl( SubInfo info, AttrCase channel) { return GetSubFactorBlendDescImpl( (dynamic)info._left, (dynamic)info._right, channel); }
ChannelBlendDesc GetChannelBlendDesc( AttrInfo info, AttrCase channel) { return GetChannelBlendDescImpl((dynamic)info, channel); }
D3D11_BLEND GetTermBlendDescImpl( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) { return D3D11_BLEND.D3D11_BLEND_ONE; } throw OperationTooComplexError(info.Range); }
public virtual bool IsFactor( TermFlavor flavor, AttrCase channel) { return false; }
bool CanUseAs( AttrInfo info, AttrCase channel, TermFlavor flavor) { if (info.IsFactor(flavor, channel)) return true; return CanUseAsImpl((dynamic)info, channel, flavor); }
public override bool IsFactor( TermFlavor flavor, AttrCase channel) { if (flavor == TermFlavor.Dest) { if (channel == AttrCase.Color) return _color == D3D11_BLEND.D3D11_BLEND_DEST_COLOR; else if (channel == AttrCase.Alpha) return _alpha == D3D11_BLEND.D3D11_BLEND_DEST_ALPHA; } else if (flavor == TermFlavor.Src) { if (channel == AttrCase.Color) return _color == D3D11_BLEND.D3D11_BLEND_SRC_COLOR; else if (channel == AttrCase.Alpha) return _alpha == D3D11_BLEND.D3D11_BLEND_SRC_ALPHA; } return false; }
public virtual bool IsFactor( TermFlavor flavor, AttrCase channel) { return(false); }