// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

namespace Win32.Graphics.Direct3D12;

/// <include file='../Direct3D12.xml' path='doc/member[@name="D3D12_RESOURCE_BARRIER"]/*' />
/// <unmanaged>D3D12_RESOURCE_BARRIER</unmanaged>
public partial struct ResourceBarrier
{
	/// <include file='../Direct3D12.xml' path='doc/member[@name="D3D12_RESOURCE_BARRIER::Type"]/*' />
	public ResourceBarrierType Type;

	/// <include file='../Direct3D12.xml' path='doc/member[@name="D3D12_RESOURCE_BARRIER::Flags"]/*' />
	public ResourceBarrierFlags Flags;

	/// <include file='../Direct3D12.xml' path='doc/member[@name="D3D12_RESOURCE_BARRIER::Anonymous"]/*' />
	public _Anonymous_e__Union Anonymous;

	[UnscopedRef]
	public ref ResourceTransitionBarrier Transition
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			return ref Anonymous.Transition;
		}
	}

	[UnscopedRef]
	public ref ResourceAliasingBarrier Aliasing
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			return ref Anonymous.Aliasing;
		}
	}

	[UnscopedRef]
	public ref ResourceUavBarrier UAV
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			return ref Anonymous.UAV;
		}
	}

	[StructLayout(LayoutKind.Explicit)]
	public partial struct _Anonymous_e__Union
	{
		/// <include file='../Direct3D12.xml' path='doc/member[@name="_Anonymous_e__Union::Transition"]/*' />
		[FieldOffset(0)]
		public ResourceTransitionBarrier Transition;

		/// <include file='../Direct3D12.xml' path='doc/member[@name="_Anonymous_e__Union::Aliasing"]/*' />
		[FieldOffset(0)]
		public ResourceAliasingBarrier Aliasing;

		/// <include file='../Direct3D12.xml' path='doc/member[@name="_Anonymous_e__Union::UAV"]/*' />
		[FieldOffset(0)]
		public ResourceUavBarrier UAV;
	}
}
