예제 #1
0
		public void MipMapsHaveCorrectDimensions(int mipLevel, int expectedWidth, int expectedHeight, int expectedDepth)
		{
			// Arrange.
			var texture = new Texture3D(new Device(), new Texture3DDescription
			{
				Width = 64,
				Height = 32,
				Depth = 16
			});

			// Act / Assert.
			int actualWidth, actualHeight, actualDepth;
			texture.GetDimensions(mipLevel, out actualWidth, out actualHeight, out actualDepth);
			Assert.That(actualWidth, Is.EqualTo(expectedWidth));
			Assert.That(actualHeight, Is.EqualTo(expectedHeight));
			Assert.That(actualDepth, Is.EqualTo(expectedDepth));
		}
예제 #2
0
		public void TextureHasCorrectNumberOfMipMapLevels()
		{
			// Arrange.
			var texture = new Texture3D(new Device(), new Texture3DDescription
			{
				Width = 32,
				Height = 32,
				Depth = 32
			});
			int width, height, depth, numberOfLevels;

			// Act.
			texture.GetDimensions(0, out width, out height, out depth, out numberOfLevels);

			// Assert.
			Assert.That(width, Is.EqualTo(32));
			Assert.That(height, Is.EqualTo(32));
			Assert.That(depth, Is.EqualTo(32));
			Assert.That(numberOfLevels, Is.EqualTo(6));
		}
			public Texture3DView(Texture3D resource, RenderTargetViewDescription.Texture3DResource description)
			{
				_subresource = resource.GetSubresource(description.MipSlice);
				_firstDepthSlice = description.FirstDepthSlice;
				_depthSliceCount = description.DepthSliceCount;
			}