protected override void OnApply(CommandEncoder commandEncoder) { if (_dirtyFlags.HasFlag(SpriteEffectDirtyFlags.TextureConstants)) { _textureConstantBuffer.UpdateData(_textureConstants); commandEncoder.SetInlineConstantBuffer(0, _textureConstantBuffer); _dirtyFlags &= ~SpriteEffectDirtyFlags.TextureConstants; } if (_dirtyFlags.HasFlag(SpriteEffectDirtyFlags.Texture)) { commandEncoder.SetTexture(1, _texture); _dirtyFlags &= ~SpriteEffectDirtyFlags.Texture; } }
public void SetTexture(Texture texture) { _texture = texture; _dirtyFlags |= SpriteEffectDirtyFlags.Texture; }
public void SetMipMapLevel(uint mipMapLevel) { _textureConstants.MipMapLevel = mipMapLevel; _dirtyFlags |= SpriteEffectDirtyFlags.TextureConstants; }
protected override void OnBegin() { _dirtyFlags = SpriteEffectDirtyFlags.All; }