public static Texture2D.Texture2DSubresource[] CreateMipMaps(int mipLevels, int width, int height) { var result = new Texture2D.Texture2DSubresource[mipLevels]; for (int level = 0; level < mipLevels; level++) { result[level] = new Texture2D.Texture2DSubresource(width, height); width = System.Math.Max((int) System.Math.Floor(width / 2.0), 1); height = System.Math.Max((int) System.Math.Floor(height / 2.0), 1); } return result; }
public static Texture2D.Texture2DSubresource[] CreateMipMaps(int mipLevels, int width, int height) { var result = new Texture2D.Texture2DSubresource[mipLevels]; for (int level = 0; level < mipLevels; level++) { result[level] = new Texture2D.Texture2DSubresource(width, height); width = System.Math.Max((int)System.Math.Floor(width / 2.0), 1); height = System.Math.Max((int)System.Math.Floor(height / 2.0), 1); } return(result); }
public Texture2DView(Texture2D resource, RenderTargetViewDescription.Texture2DResource description) { _subresource = resource.GetSubresource(0, description.MipSlice); }
public Texture2DView(Texture2D resource, DepthStencilViewDescription.Texture2DResource description) { _subresource = resource.GetSubresource(0, description.MipSlice); }