2011-12-14 11:49:04 +00:00
|
|
|
using System;
|
|
|
|
using ANX.Framework;
|
2012-09-07 09:48:45 +00:00
|
|
|
using ANX.Framework.Graphics;
|
|
|
|
using ANX.Framework.NonXNA;
|
|
|
|
using Dx11 = SharpDX.Direct3D11;
|
2012-09-30 10:43:06 +00:00
|
|
|
using ANX.Framework.NonXNA.Development;
|
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
|
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
[PercentageComplete(50)]
|
2012-09-30 10:43:06 +00:00
|
|
|
[TestState(TestStateAttribute.TestState.Untested)]
|
|
|
|
[Developer("Glatzemann")]
|
|
|
|
public class EffectParameter_DX11 : INativeEffectParameter
|
2012-09-07 09:48:45 +00:00
|
|
|
{
|
|
|
|
#region Public
|
2012-10-13 10:51:27 +00:00
|
|
|
public Dx11.EffectVariable NativeParameter { get; internal set; }
|
2012-09-07 09:48:45 +00:00
|
|
|
|
2012-10-13 10:51:27 +00:00
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
get { return NativeParameter.Description.Name; }
|
|
|
|
}
|
2012-09-30 10:43:06 +00:00
|
|
|
|
|
|
|
public string Semantic
|
|
|
|
{
|
2012-10-13 10:51:27 +00:00
|
|
|
get { return NativeParameter.Description.Semantic; }
|
2012-09-30 10:43:06 +00:00
|
|
|
}
|
2012-10-13 10:51:27 +00:00
|
|
|
|
|
|
|
public int ColumnCount
|
|
|
|
{
|
|
|
|
get { return NativeParameter.TypeInfo.Description.Columns; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public int RowCount
|
|
|
|
{
|
|
|
|
get { return NativeParameter.TypeInfo.Description.Rows; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public EffectParameterClass ParameterClass
|
|
|
|
{
|
|
|
|
get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Class); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public EffectParameterType ParameterType
|
|
|
|
{
|
|
|
|
get { return DxFormatConverter.Translate(NativeParameter.TypeInfo.Description.Type); }
|
|
|
|
}
|
2012-10-13 13:12:07 +00:00
|
|
|
|
|
|
|
public EffectAnnotationCollection Annotations
|
|
|
|
{
|
|
|
|
get { throw new NotImplementedException(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public EffectParameterCollection Elements
|
|
|
|
{
|
|
|
|
get { throw new NotImplementedException(); }
|
|
|
|
}
|
|
|
|
|
|
|
|
public EffectParameterCollection StructureMembers
|
|
|
|
{
|
|
|
|
get { throw new NotImplementedException(); }
|
|
|
|
}
|
2012-10-13 10:51:27 +00:00
|
|
|
#endregion
|
2012-09-07 09:48:45 +00:00
|
|
|
|
|
|
|
#region SetValue (bool)
|
|
|
|
public void SetValue(bool value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsScalar().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
2011-12-14 11:49:04 +00:00
|
|
|
|
2012-09-07 09:48:45 +00:00
|
|
|
#region SetValue (bool[])
|
|
|
|
public void SetValue(bool[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsScalar().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (int)
|
|
|
|
public void SetValue(int value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsScalar().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (int[])
|
|
|
|
public void SetValue(int[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsScalar().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Matrix, transpose) (TODO)
|
|
|
|
public void SetValue(Matrix value, bool transpose)
|
|
|
|
{
|
|
|
|
// TODO: handle transpose!
|
|
|
|
NativeParameter.AsMatrix().SetMatrix(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Matrix[], transpose) (TODO)
|
2012-08-10 08:38:01 +00:00
|
|
|
public void SetValue(Matrix[] value, bool transpose)
|
2012-09-07 09:48:45 +00:00
|
|
|
{
|
|
|
|
// TODO: handle transpose!
|
|
|
|
NativeParameter.AsMatrix().SetMatrix(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Quaternion)
|
|
|
|
public void SetValue(Quaternion value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Quaternion[])
|
|
|
|
public void SetValue(Quaternion[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (float)
|
|
|
|
public void SetValue(float value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsScalar().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (float[])
|
|
|
|
public void SetValue(float[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsScalar().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Vector2)
|
|
|
|
public void SetValue(Vector2 value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Vector2[])
|
|
|
|
public void SetValue(Vector2[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Vector3)
|
|
|
|
public void SetValue(Vector3 value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Vector3[])
|
|
|
|
public void SetValue(Vector3[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Vector4)
|
|
|
|
public void SetValue(Vector4 value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Vector4[])
|
|
|
|
public void SetValue(Vector4[] value)
|
|
|
|
{
|
|
|
|
NativeParameter.AsVector().Set(value);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (Texture)
|
|
|
|
public void SetValue(Texture value)
|
|
|
|
{
|
|
|
|
if (value == null)
|
|
|
|
throw new ArgumentNullException("value");
|
|
|
|
|
2012-09-15 13:43:31 +00:00
|
|
|
var tex = value.NativeTexture as DxTexture2D;
|
2012-09-07 09:48:45 +00:00
|
|
|
NativeParameter.AsShaderResource().SetResource(tex.NativeShaderResourceView);
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region SetValue (string) (TODO)
|
|
|
|
public void SetValue(string value)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Get (TODO)
|
|
|
|
public bool GetValueBoolean()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool[] GetValueBooleanArray(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public int GetValueInt32()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public int[] GetValueInt32Array(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Matrix GetValueMatrix()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Matrix[] GetValueMatrixArray(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Matrix GetValueMatrixTranspose()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Matrix[] GetValueMatrixTransposeArray(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Quaternion GetValueQuaternion()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Quaternion[] GetValueQuaternionArray(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public float GetValueSingle()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public float[] GetValueSingleArray(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public string GetValueString()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Texture2D GetValueTexture2D()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Texture3D GetValueTexture3D()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public TextureCube GetValueTextureCube()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector2 GetValueVector2()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector2[] GetValueVector2Array(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector3 GetValueVector3()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector3[] GetValueVector3Array(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector4 GetValueVector4()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector4[] GetValueVector4Array(int count)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
2012-01-16 15:03:28 +00:00
|
|
|
}
|
2012-09-07 09:48:45 +00:00
|
|
|
#endregion
|
2015-10-14 23:59:27 +02:00
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
Dispose(true);
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposeManaged)
|
|
|
|
{
|
|
|
|
if (disposeManaged)
|
|
|
|
{
|
|
|
|
if (NativeParameter != null)
|
|
|
|
{
|
|
|
|
NativeParameter.Dispose();
|
|
|
|
NativeParameter = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-10-13 10:51:27 +00:00
|
|
|
}
|
2011-12-14 11:49:04 +00:00
|
|
|
}
|