summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp/src/TestTextureCreation.cpp
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-06-04 03:38:17 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-06-04 03:38:17 +0000
commit8851654997a413c24ec789d7ea8675f7c89769dd (patch)
treec2f9af9a60316ec79e3707dbf1190f5a20dbc4d2 /Tests/TestApp/src/TestTextureCreation.cpp
parentUpdated lua test in test app to use (0,0,0,1) as border color (diff)
downloadDiligentEngine-8851654997a413c24ec789d7ea8675f7c89769dd.tar.gz
DiligentEngine-8851654997a413c24ec789d7ea8675f7c89769dd.zip
Updated tests
Diffstat (limited to 'Tests/TestApp/src/TestTextureCreation.cpp')
-rw-r--r--Tests/TestApp/src/TestTextureCreation.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/Tests/TestApp/src/TestTextureCreation.cpp b/Tests/TestApp/src/TestTextureCreation.cpp
index 2ee8028..12ea5d8 100644
--- a/Tests/TestApp/src/TestTextureCreation.cpp
+++ b/Tests/TestApp/src/TestTextureCreation.cpp
@@ -193,7 +193,7 @@ private:
TextureData &InitData)
{
- auto PixelSize = PixelFormatAttribs.ComponentSize * PixelFormatAttribs.NumComponents;
+ Uint32 PixelSize = PixelFormatAttribs.ComponentSize * PixelFormatAttribs.NumComponents;
assert( PixelSize == m_PixelSize );
Uint32 ArrSize = (TexDesc.Type == RESOURCE_DIM_TEX_3D) ? 1 : TexDesc.ArraySize;
@@ -274,9 +274,18 @@ private:
PrepareSubresourceData(TexDesc, PixelFormatAttribs, Data, SubResources, InitData);
TexDesc.Name = "TestTexture2";
- pTestTex.Release();
- m_pDevice->CreateTexture( TexDesc, InitData, &pTestTex );
- m_pTestCreateObjFromNativeRes->CreateTexture(pTestTex);
+ RefCntAutoPtr<Diligent::ITexture> pTestTex2;
+ m_pDevice->CreateTexture( TexDesc, InitData, &pTestTex2 );
+ m_pTestCreateObjFromNativeRes->CreateTexture(pTestTex2);
+ Box SrcBox;
+ SrcBox.MinX = TexDesc.Width/4;
+ SrcBox.MinY = TexDesc.Height/4;
+ SrcBox.MinZ = ( TexDesc.Type == RESOURCE_DIM_TEX_3D ) ? TexDesc.Depth/4 : 0;
+ SrcBox.MaxX = std::max(TexDesc.Width/3, SrcBox.MinX+1);
+ SrcBox.MaxY = std::max(TexDesc.Height/3, SrcBox.MinY+1);
+ SrcBox.MaxZ = ( TexDesc.Type == RESOURCE_DIM_TEX_3D ) ? std::max(TexDesc.Depth/3, SrcBox.MinZ+1) : 1;
+ //pTestTex2->UpdateData(m_pDeviceContext, 0, 0, DstBox, SubResources[0]);
+ pTestTex->CopyData(m_pDeviceContext, pTestTex2, 0, 0, &SrcBox, 0, 0, 0,0,0);
}
const auto &DeviceCaps = m_pDevice->GetDeviceCaps();
@@ -362,7 +371,7 @@ private:
FirstTime = false;
}
}
-
+
// It is necessary to call Flush() to force the driver to release the resources.
// Without flushing the command buffer, the memory is not released until sometimes
// later causing out-of-memory error
@@ -602,9 +611,9 @@ TestTextureCreation::TestTextureCreation( IRenderDevice *pDevice, IDeviceContext
//{TEX_FORMAT_X32_TYPELESS_G8X24_UINT, 8, BindD, false, "X32_TYPELESS_G8X24_UINT"},
//{TEX_FORMAT_RGB10A2_TYPELESS, 4, BindSRU, true, "RGB10A2_TYPELESS"},
- {TEX_FORMAT_RGB10A2_UNORM, 4, BindSRU, true, "RGB10A2_UNORM"},
- {TEX_FORMAT_RGB10A2_UINT, 4, BindSRU, true, "RGB10A2_UINT"},
- {TEX_FORMAT_R11G11B10_FLOAT, 4, BindSRU, false,"R11G11B10_FLOAT"},
+ {TEX_FORMAT_RGB10A2_UNORM, 4, BindSR, true, "RGB10A2_UNORM"},
+ {TEX_FORMAT_RGB10A2_UINT, 4, BindS, true, "RGB10A2_UINT"},
+ {TEX_FORMAT_R11G11B10_FLOAT, 4, BindSRU, false, "R11G11B10_FLOAT"},
//{TEX_FORMAT_RGBA8_TYPELESS, 4, BindSRU, true, "RGBA8_TYPELESS"},
{TEX_FORMAT_RGBA8_UNORM, 4, BindSRU, true, "RGBA8_UNORM"},
@@ -627,7 +636,7 @@ TestTextureCreation::TestTextureCreation( IRenderDevice *pDevice, IDeviceContext
{TEX_FORMAT_R32_SINT, 4, BindSRU, true, "R32_SINT"},
//{TEX_FORMAT_R24G8_TYPELESS, 4, BindD, true, "R24G8_TYPELESS"},
- {TEX_FORMAT_D24_UNORM_S8_UINT, 4, BindD, true, "D24_UNORM_S8_UINT"},
+ {TEX_FORMAT_D24_UNORM_S8_UINT, 4, BindD, false,"D24_UNORM_S8_UINT"},
//{TEX_FORMAT_R24_UNORM_X8_TYPELESS, 4, BindD, true, "R24_UNORM_X8_TYPELESS"},
//{TEX_FORMAT_X24_TYPELESS_G8_UINT, 4, BindD, true, "X24_TYPELESS_G8_UINT"},
@@ -701,7 +710,7 @@ TestTextureCreation::TestTextureCreation( IRenderDevice *pDevice, IDeviceContext
continue;
}
++m_NumFormatsTested;
- assert(CurrAttrs.PixelSize == PixelFormatAttribs.ComponentSize * PixelFormatAttribs.NumComponents ||
+ assert(CurrAttrs.PixelSize == Uint32{PixelFormatAttribs.ComponentSize} * PixelFormatAttribs.NumComponents ||
PixelFormatAttribs.ComponentType == COMPONENT_TYPE_COMPRESSED);
Verifier.Test(CurrAttrs.Fmt, CurrAttrs.PixelSize, CurrAttrs.BindFlags, CurrAttrs.TestDataUpload);
}
@@ -715,7 +724,7 @@ void TestTextureCreation::CheckFormatSize(TEXTURE_FORMAT *begin, TEXTURE_FORMAT
for(auto fmt = begin; fmt != end; ++fmt)
{
auto FmtAttrs = m_pDevice->GetTextureFormatInfo(*fmt);
- assert(FmtAttrs.ComponentSize * FmtAttrs.NumComponents == RefSize);
+ assert(Uint32{FmtAttrs.ComponentSize} * FmtAttrs.NumComponents == RefSize);
}
}