/// <summary> /// Specialised constructor for use only by derived classes. /// </summary> /// <param name="device">The <see cref="GraphicsDevice" />.</param> /// <param name="texture">The texture.</param> protected internal Texture2DBase(GraphicsDevice device, Texture2DBase texture, ViewType viewType, int viewArraySlice, int viewMipLevel, PixelFormat viewFormat = PixelFormat.None) : base(device, texture, viewType, viewArraySlice, viewMipLevel, viewFormat) { // Copy the device child, but don't use NativeDeviceChild, as it is registering it for disposing. _nativeDeviceChild = texture._nativeDeviceChild; NativeResource = texture.NativeResource; NativeDescription = texture.NativeDescription; NativeShaderResourceView = GetShaderResourceView(viewType, viewArraySlice, viewMipLevel); NativeUnorderedAccessView = GetUnorderedAccessView(viewArraySlice, viewMipLevel); dxgiSurface = texture.dxgiSurface; }
protected internal Texture2DBase(GraphicsDevice device, Texture2DBase texture) : base(device, texture, ViewType.Full, 0, 0) { this.Target = texture.Target; this.resourceId = texture.ResourceId; }
protected internal Texture2DBase(GraphicsDevice device, Texture2DBase texture) : base(device, texture.Description) { }
protected internal Texture2DBase(GraphicsDevice device, Texture2DBase texture) : base(device, texture, ViewType.Full, 0, 0) { this.Target = texture.Target; this.resourceId = texture.ResourceId; }
protected internal Texture2DBase(GraphicsDevice device, Texture2DBase texture) : base(device, texture.Description) { }