summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp/src/TestTextureCreation.cpp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-05 22:27:39 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-05 22:27:39 +0000
commit9a8b1ce5926ba32be80cc3a2a308b9e054c1f781 (patch)
tree9c254c01d925e5121d5663f04f7de327f996922f /Tests/TestApp/src/TestTextureCreation.cpp
parentUpdated broken shader & comput shader tests (diff)
downloadDiligentEngine-9a8b1ce5926ba32be80cc3a2a308b9e054c1f781.tar.gz
DiligentEngine-9a8b1ce5926ba32be80cc3a2a308b9e054c1f781.zip
Updated test app
Diffstat (limited to 'Tests/TestApp/src/TestTextureCreation.cpp')
-rw-r--r--Tests/TestApp/src/TestTextureCreation.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/Tests/TestApp/src/TestTextureCreation.cpp b/Tests/TestApp/src/TestTextureCreation.cpp
index 12ea5d8..fbc2bcb 100644
--- a/Tests/TestApp/src/TestTextureCreation.cpp
+++ b/Tests/TestApp/src/TestTextureCreation.cpp
@@ -294,6 +294,18 @@ private:
{
TextureViewDesc ViewDesc;
ViewDesc.TextureDim = TexDesc.Type;
+
+ if( SampleCount > 1 )
+ {
+ ViewDesc.MostDetailedMip = 0;
+ ViewDesc.NumMipLevels = 1;
+ }
+ else
+ {
+ ViewDesc.MostDetailedMip = 1;
+ ViewDesc.NumMipLevels = 2;
+ }
+
if( TexDesc.Type == RESOURCE_DIM_TEX_1D_ARRAY || TexDesc.Type == RESOURCE_DIM_TEX_2D_ARRAY )
{
ViewDesc.FirstArraySlice = 3;
@@ -306,11 +318,11 @@ private:
ViewDesc.FirstDepthSlice = 3;
ViewDesc.NumDepthSlices = 4;
}
- else
+ else if( DeviceCaps.DevType == DeviceType::Vulkan && ViewDesc.ViewType != TEXTURE_VIEW_RENDER_TARGET && ViewDesc.ViewType != TEXTURE_VIEW_DEPTH_STENCIL || DeviceCaps.DevType != DeviceType::Vulkan)
{
// OpenGL cannot create views for separate depth slices
ViewDesc.FirstDepthSlice = 0;
- ViewDesc.NumDepthSlices = 1;
+ ViewDesc.NumDepthSlices = TexDesc.Depth >> ViewDesc.MostDetailedMip;
}
}
else
@@ -319,17 +331,6 @@ private:
ViewDesc.NumArraySlices = 1;
}
- if( SampleCount > 1 )
- {
- ViewDesc.MostDetailedMip = 0;
- ViewDesc.NumMipLevels = 1;
- }
- else
- {
- ViewDesc.MostDetailedMip = 1;
- ViewDesc.NumMipLevels = 2;
- }
-
if( TexDesc.BindFlags & BIND_SHADER_RESOURCE )
{
ViewDesc.ViewType = TEXTURE_VIEW_SHADER_RESOURCE;