3 #if SILICONSTUDIO_PARADOX_GRAPHICS_API_DIRECT3D
6 using SharpDX.Direct3D11;
7 using SiliconStudio.Core.ReferenceCounting;
10 namespace SiliconStudio.
Paradox.Graphics
17 private SharpDX.Direct3D11.RenderTargetView _renderTargetView;
31 _nativeDeviceChild = texture.NativeDeviceChild;
32 Description = texture.Description;
34 NativeRenderTargetView = texture.GetRenderTargetView(viewType, arraySlice, mipSlice);
36 Width = Math.Max(1, Description.Width >> mipSlice);
37 Height = Math.Max(1, Description.Height >> mipSlice);
40 ArraySlice = arraySlice;
42 ViewFormat = viewFormat == PixelFormat.None ? Description.Format : viewFormat;
45 Texture.AddReferenceInternal();
57 internal RenderTarget(GraphicsDevice device, Texture texture,
ViewType viewType,
int arraySlice,
int mipSlice, RenderTargetView view)
60 _nativeDeviceChild = texture.NativeDeviceChild;
61 Description = texture.Description;
63 NativeRenderTargetView = view;
65 Width = Math.Max(1, Description.Width >> mipSlice);
66 Height = Math.Max(1, Description.Height >> mipSlice);
68 var viewFormat = view.Description.Format;
71 ArraySlice = arraySlice;
78 protected override void DestroyImpl()
83 _nativeDeviceChild = null;
84 Utilities.Dispose(ref _renderTargetView);
88 protected internal override void OnDestroyed()
95 protected internal override bool OnRecreate()
102 _nativeDeviceChild = Texture.NativeDeviceChild;
103 NativeRenderTargetView = Texture.GetRenderTargetView(
ViewType, ArraySlice, MipLevel);
113 internal SharpDX.Direct3D11.RenderTargetView NativeRenderTargetView
117 return _renderTargetView;
121 if (_renderTargetView != null)
throw new ArgumentException(
string.Format(FrameworkResources.GraphicsResourceAlreadySet,
"RenderTargetView"),
"value");
122 _renderTargetView = value;
125 SetDebugName(GraphicsDevice, _renderTargetView,
"View " + Name);
SiliconStudio.Core.Utilities Utilities
ViewType
Defines how a view is selected from a resource.
Same as Deferred mode, except sprites are sorted by texture prior to drawing. This can improve perfor...
GraphicsResourceLifetimeState
Describes the lifetime state of a graphics resource.
Creates a render target buffer.
PixelFormat
Defines various types of pixel formats.