2011-12-14 11:49:04 +00:00
|
|
|
using ANX.Framework.NonXNA;
|
|
|
|
using SharpDX.Direct3D11;
|
2015-10-14 23:59:27 +02:00
|
|
|
using System;
|
2011-12-14 11:49:04 +00:00
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-12-14 11:49:04 +00:00
|
|
|
|
|
|
|
namespace ANX.RenderSystem.Windows.DX11
|
|
|
|
{
|
|
|
|
public class EffectPass_DX11 : INativeEffectPass
|
|
|
|
{
|
2012-09-07 09:48:45 +00:00
|
|
|
private EffectPass nativePass;
|
2015-10-14 23:59:27 +02:00
|
|
|
private Framework.Graphics.Effect parentEffect;
|
2011-12-14 11:49:04 +00:00
|
|
|
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-09-07 09:48:45 +00:00
|
|
|
return nativePass.Description.Name;
|
2011-12-14 11:49:04 +00:00
|
|
|
}
|
|
|
|
}
|
2012-09-07 09:48:45 +00:00
|
|
|
|
2015-10-14 23:59:27 +02:00
|
|
|
public SharpDX.D3DCompiler.ShaderBytecode Signature
|
|
|
|
{
|
|
|
|
get;
|
|
|
|
private set;
|
|
|
|
}
|
|
|
|
|
|
|
|
internal EffectPass_DX11(Framework.Graphics.Effect parentEffect, EffectPass setNativePass)
|
2012-09-07 09:48:45 +00:00
|
|
|
{
|
|
|
|
nativePass = setNativePass;
|
2015-10-14 23:59:27 +02:00
|
|
|
this.parentEffect = parentEffect;
|
|
|
|
|
|
|
|
this.Signature = nativePass.Description.Signature;
|
2012-09-07 09:48:45 +00:00
|
|
|
}
|
2015-10-14 23:59:27 +02:00
|
|
|
|
|
|
|
public Framework.Graphics.EffectAnnotationCollection Annotations
|
|
|
|
{
|
|
|
|
get { throw new System.NotImplementedException(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Apply()
|
|
|
|
{
|
|
|
|
var deviceContext = ((GraphicsDeviceDX)parentEffect.GraphicsDevice.NativeDevice).NativeDevice;
|
|
|
|
|
|
|
|
nativePass.Apply(deviceContext);
|
|
|
|
((GraphicsDeviceDX)this.parentEffect.GraphicsDevice.NativeDevice).currentPass = this;
|
|
|
|
parentEffect.OnApply();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
Dispose(true);
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposeManaged)
|
|
|
|
{
|
|
|
|
if (disposeManaged)
|
|
|
|
{
|
|
|
|
if (nativePass != null)
|
|
|
|
{
|
|
|
|
nativePass.Dispose();
|
|
|
|
nativePass = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-12-14 11:49:04 +00:00
|
|
|
}
|
|
|
|
}
|