summaryrefslogtreecommitdiffstats
path: root/Tests/TestApp/src
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-27 00:09:03 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-27 00:09:03 +0000
commit57b27983564952bee0100dcce350361aa32c9494 (patch)
tree99b7ff2a9464ad236578ea725bd7b1b8d858099a /Tests/TestApp/src
parentUpdated readme: organized projects into a table (diff)
downloadDiligentEngine-57b27983564952bee0100dcce350361aa32c9494.tar.gz
DiligentEngine-57b27983564952bee0100dcce350361aa32c9494.zip
Updated core & tools (implemented raw buffers plus other improvements)
Diffstat (limited to 'Tests/TestApp/src')
-rw-r--r--Tests/TestApp/src/MTResourceCreationTest.cpp21
-rw-r--r--Tests/TestApp/src/RenderScriptTest.cpp10
-rw-r--r--Tests/TestApp/src/TestBufferCreation.cpp48
-rw-r--r--Tests/TestApp/src/TestCopyTexData.cpp6
-rw-r--r--Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp4
-rw-r--r--Tests/TestApp/src/TestDrawCommands.cpp7
-rw-r--r--Tests/TestApp/src/TestShaderResourceLayout.cpp24
-rw-r--r--Tests/TestApp/src/TestShaderVarAccess.cpp24
-rw-r--r--Tests/TestApp/src/TestTextureCreation.cpp6
-rw-r--r--Tests/TestApp/src/TestTexturing.cpp2
10 files changed, 104 insertions, 48 deletions
diff --git a/Tests/TestApp/src/MTResourceCreationTest.cpp b/Tests/TestApp/src/MTResourceCreationTest.cpp
index 837f4f9..3be401d 100644
--- a/Tests/TestApp/src/MTResourceCreationTest.cpp
+++ b/Tests/TestApp/src/MTResourceCreationTest.cpp
@@ -100,16 +100,12 @@ void MTResourceCreationTest::ThreadWorkerFunc(bool bIsMasterThread)
WaitForThreadStart(0);
RefCntAutoPtr<IBuffer> pBuffer1, pBuffer2,pBuffer3,pBuffer4;
+ RefCntAutoPtr<IBufferView> pBufferSRV, pBufferUAV;
{
BufferDesc BuffDesc;
BuffDesc.Usage = USAGE_DEFAULT;
BuffDesc.BindFlags = BIND_UNIFORM_BUFFER;
- BuffDesc.Mode = BUFFER_MODE_FORMATTED;
- BuffDesc.Format.NumComponents = 4;
- BuffDesc.Format.IsNormalized = False;
- BuffDesc.Format.ValueType = VT_FLOAT32;
BuffDesc.Name = "MT test buffer";
-
BuffDesc.uiSizeInBytes = sizeof(RawBufferData);
BufferData BuffData;
@@ -118,12 +114,25 @@ void MTResourceCreationTest::ThreadWorkerFunc(bool bIsMasterThread)
m_pDevice->CreateBuffer(BuffDesc, BuffData, &pBuffer1);
+ BuffDesc.Mode = BUFFER_MODE_FORMATTED;
+ BuffDesc.ElementByteStride = 16;
BuffDesc.BindFlags = BIND_SHADER_RESOURCE|BIND_UNORDERED_ACCESS;
m_pDevice->CreateBuffer(BuffDesc, BuffData, &pBuffer2);
- BuffDesc.BindFlags = BIND_VERTEX_BUFFER|BIND_UNORDERED_ACCESS;
+ BufferViewDesc ViewDesc;
+ ViewDesc.ViewType = BUFFER_VIEW_SHADER_RESOURCE;
+ ViewDesc.ByteOffset = 16;
+ ViewDesc.Format.NumComponents = 4;
+ ViewDesc.Format.IsNormalized = False;
+ ViewDesc.Format.ValueType = VT_FLOAT32;
+ pBuffer2->CreateView(ViewDesc, &pBufferSRV);
+
+ BuffDesc.BindFlags = BIND_VERTEX_BUFFER | BIND_UNORDERED_ACCESS;
m_pDevice->CreateBuffer(BuffDesc, BuffData, &pBuffer3);
+ ViewDesc.ViewType = BUFFER_VIEW_UNORDERED_ACCESS;
+ pBuffer3->CreateView(ViewDesc, &pBufferUAV);
+ BuffDesc.Mode = BUFFER_MODE_RAW;
BuffDesc.BindFlags = BIND_INDEX_BUFFER|BIND_UNORDERED_ACCESS;
m_pDevice->CreateBuffer(BuffDesc, BuffData, &pBuffer4);
diff --git a/Tests/TestApp/src/RenderScriptTest.cpp b/Tests/TestApp/src/RenderScriptTest.cpp
index 4d433a6..5f47db8 100644
--- a/Tests/TestApp/src/RenderScriptTest.cpp
+++ b/Tests/TestApp/src/RenderScriptTest.cpp
@@ -79,12 +79,10 @@ RenderScriptTest::RenderScriptTest( IRenderDevice *pRenderDevice, IDeviceContext
Diligent::BufferDesc BuffDesc;
BuffDesc.Name = "TestGlobalBuff2";
BuffDesc.uiSizeInBytes = 64;
- BuffDesc.BindFlags = BIND_VERTEX_BUFFER | BIND_UNORDERED_ACCESS;
+ BuffDesc.BindFlags = BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
BuffDesc.Usage = USAGE_DEFAULT;
- BuffDesc.Format.ValueType = VT_UINT16;
- BuffDesc.Format.NumComponents = 4;
- BuffDesc.Format.IsNormalized = true;
- BuffDesc.Mode = BUFFER_MODE_FORMATTED;
+ BuffDesc.ElementByteStride = 16;
+ BuffDesc.Mode = BUFFER_MODE_STRUCTURED;
RefCntAutoPtr<IBuffer> pBuffer;
pRenderDevice->CreateBuffer( BuffDesc, Diligent::BufferData(), &pBuffer );
pScriptParser->SetGlobalVariable( "TestGlobalBufferWithUAV", pBuffer );
@@ -126,7 +124,6 @@ RenderScriptTest::RenderScriptTest( IRenderDevice *pRenderDevice, IDeviceContext
GlobalDrawAttribs.IndexType = VT_UINT16;
GlobalDrawAttribs.IsIndexed = True;
GlobalDrawAttribs.NumInstances = 19;
- GlobalDrawAttribs.IsIndirect = True;
GlobalDrawAttribs.BaseVertex = 97;
GlobalDrawAttribs.IndirectDrawArgsOffset = 120;
GlobalDrawAttribs.StartVertexLocation = 98;
@@ -338,7 +335,6 @@ RenderScriptTest::RenderScriptTest( IRenderDevice *pRenderDevice, IDeviceContext
DrawAttribs.IndexType = VT_UINT16;
DrawAttribs.IsIndexed = True;
DrawAttribs.NumInstances = 139;
- DrawAttribs.IsIndirect = True;
DrawAttribs.BaseVertex = 937;
DrawAttribs.IndirectDrawArgsOffset = 1205;
DrawAttribs.StartVertexLocation = 198;
diff --git a/Tests/TestApp/src/TestBufferCreation.cpp b/Tests/TestApp/src/TestBufferCreation.cpp
index 5af3777..7ea1fdd 100644
--- a/Tests/TestApp/src/TestBufferCreation.cpp
+++ b/Tests/TestApp/src/TestBufferCreation.cpp
@@ -114,15 +114,26 @@ TestBufferCreation::TestBufferCreation(Diligent::IRenderDevice *pDevice, Diligen
Diligent::BufferDesc BuffDesc;
BuffDesc.Name = "Buffer creation test 2";
BuffDesc.uiSizeInBytes = 256;
- BuffDesc.BindFlags = BIND_INDIRECT_DRAW_ARGS | BIND_UNORDERED_ACCESS;
+ BuffDesc.BindFlags = BIND_UNORDERED_ACCESS | BIND_SHADER_RESOURCE;
BuffDesc.Mode = BUFFER_MODE_FORMATTED;
- BuffDesc.Format.NumComponents = 4;
- BuffDesc.Format.ValueType = VT_INT32;
- BuffDesc.Format.IsNormalized = false;
+ BuffDesc.ElementByteStride = 16;
RefCntAutoPtr<IBuffer> pBuffer;
pDevice->CreateBuffer(BuffDesc, BufferData(), &pBuffer);
VERIFY_EXPR(pBuffer);
+ BufferViewDesc ViewDesc;
+ ViewDesc.ViewType = BUFFER_VIEW_SHADER_RESOURCE;
+ ViewDesc.ByteOffset = 32;
+ ViewDesc.Format.NumComponents = 4;
+ ViewDesc.Format.ValueType = VT_FLOAT32;
+ ViewDesc.Format.IsNormalized = false;
+ RefCntAutoPtr<IBufferView> pBufferSRV;
+ pBuffer->CreateView(ViewDesc, &pBufferSRV);
+
+ ViewDesc.ViewType = BUFFER_VIEW_UNORDERED_ACCESS;
+ RefCntAutoPtr<IBufferView> pBufferUAV;
+ pBuffer->CreateView(ViewDesc, &pBufferUAV);
+
pTestCreateObjFromNativeRes->CreateBuffer(pBuffer);
++BuffersCreated;
}
@@ -155,7 +166,34 @@ TestBufferCreation::TestBufferCreation(Diligent::IRenderDevice *pDevice, Diligen
pTestCreateObjFromNativeRes->CreateBuffer(pBuffer);
++BuffersCreated;
}
-
+
+ {
+ Diligent::BufferDesc BuffDesc;
+ BuffDesc.Name = "Buffer creation test 5";
+ BuffDesc.uiSizeInBytes = 256;
+ BuffDesc.BindFlags = BIND_VERTEX_BUFFER | BIND_INDEX_BUFFER | BIND_UNORDERED_ACCESS | BIND_SHADER_RESOURCE;
+ BuffDesc.Mode = BUFFER_MODE_RAW;
+ BuffDesc.ElementByteStride = 16;
+ RefCntAutoPtr<IBuffer> pBuffer;
+ pDevice->CreateBuffer(BuffDesc, BufferData(), &pBuffer);
+ VERIFY_EXPR(pBuffer);
+
+ BufferViewDesc ViewDesc;
+ ViewDesc.ViewType = BUFFER_VIEW_UNORDERED_ACCESS;
+ ViewDesc.ByteOffset = 32;
+ ViewDesc.Format.NumComponents = 4;
+ ViewDesc.Format.ValueType = VT_FLOAT32;
+ RefCntAutoPtr<IBufferView> pBufferUAV;
+ pBuffer->CreateView(ViewDesc, &pBufferUAV);
+
+ ViewDesc.ViewType = BUFFER_VIEW_SHADER_RESOURCE;
+ RefCntAutoPtr<IBufferView> pBufferSRV;
+ pBuffer->CreateView(ViewDesc, &pBufferSRV);
+
+ pTestCreateObjFromNativeRes->CreateBuffer(pBuffer);
+ ++BuffersCreated;
+ }
+
std::stringstream infoss;
infoss << "Created " << BuffersCreated << " test buffers.";
SetStatus(TestResult::Succeeded, infoss.str().c_str());
diff --git a/Tests/TestApp/src/TestCopyTexData.cpp b/Tests/TestApp/src/TestCopyTexData.cpp
index 63dd2b9..01e0274 100644
--- a/Tests/TestApp/src/TestCopyTexData.cpp
+++ b/Tests/TestApp/src/TestCopyTexData.cpp
@@ -95,7 +95,7 @@ void TestCopyTexData::Test2DTexture( TEXTURE_FORMAT Format )
Diligent::RefCntAutoPtr<ITexture> pSrcTex, pDstTex;
auto FmtAttribs = m_pDevice->GetTextureFormatInfo(Format);
- auto TexelSize = FmtAttribs.ComponentSize * FmtAttribs.NumComponents;
+ auto TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
std::vector<uint8_t> DummyData(TexDesc.Width * TexDesc.Height * TexelSize);
TextureData InitData;
InitData.NumSubresources = TexDesc.MipLevels;
@@ -147,7 +147,7 @@ void TestCopyTexData::Test2DTexArray( TEXTURE_FORMAT Format )
Diligent::RefCntAutoPtr<ITexture> pSrcTex, pDstTex;
auto FmtAttribs = m_pDevice->GetTextureFormatInfo(Format);
- auto TexelSize = FmtAttribs.ComponentSize * FmtAttribs.NumComponents;
+ auto TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
std::vector<uint8_t> DummyData(TexDesc.Width * TexDesc.Height * TexelSize);
TextureData InitData;
InitData.NumSubresources = TexDesc.MipLevels * TexDesc.ArraySize;
@@ -204,7 +204,7 @@ void TestCopyTexData::Test3DTexture( TEXTURE_FORMAT Format )
Diligent::RefCntAutoPtr<ITexture> pSrcTex, pDstTex;
auto FmtAttribs = m_pDevice->GetTextureFormatInfo(Format);
- auto TexelSize = FmtAttribs.ComponentSize * FmtAttribs.NumComponents;
+ auto TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
std::vector<uint8_t> DummyData(TexDesc.Width * TexDesc.Height * TexDesc.Depth * TexelSize);
TextureData InitData;
InitData.NumSubresources = TexDesc.MipLevels;
diff --git a/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp b/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp
index cd985a1..782ca08 100644
--- a/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp
+++ b/Tests/TestApp/src/TestCreateObjFromNativeResD3D11.cpp
@@ -49,7 +49,7 @@ void TestCreateObjFromNativeResD3D11::CreateTexture(Diligent::ITexture *pTexture
pDeviceD3D11->CreateTextureFromD3DResource(static_cast<ID3D11Texture2D*>(pd3d11Texture), &pTextureFromNativeD3D11Handle);
++m_NumTexturesCreated;
}
- else if (RESOURCE_DIM_TEX_3D)
+ else if (SrcTexDesc.Type == RESOURCE_DIM_TEX_3D)
{
pDeviceD3D11->CreateTextureFromD3DResource(static_cast<ID3D11Texture3D*>(pd3d11Texture), &pTextureFromNativeD3D11Handle);
++m_NumTexturesCreated;
@@ -94,7 +94,7 @@ void TestCreateObjFromNativeResD3D11::CreateBuffer(Diligent::IBuffer *pBuffer)
{
BufferDesc BuffDesc;
BuffDesc.Name = "Test buffer from D3D11 buffer";
- BuffDesc.Format = SrcBuffDesc.Format;
+ BuffDesc.ElementByteStride = SrcBuffDesc.ElementByteStride;
RefCntAutoPtr<IBuffer> pBufferFromNativeD3D11Handle;
pDeviceD3D11->CreateBufferFromD3DResource(pd3d11Buffer, BuffDesc, &pBufferFromNativeD3D11Handle);
++m_NumBuffersCreated;
diff --git a/Tests/TestApp/src/TestDrawCommands.cpp b/Tests/TestApp/src/TestDrawCommands.cpp
index f720730..664ad1f 100644
--- a/Tests/TestApp/src/TestDrawCommands.cpp
+++ b/Tests/TestApp/src/TestDrawCommands.cpp
@@ -759,7 +759,6 @@ void TestDrawCommands::Draw()
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.pIndirectDrawAttribs = m_pIndirectDrawArgs;
m_pDeviceContext->Draw(DrawAttrs);
}
@@ -773,7 +772,6 @@ void TestDrawCommands::Draw()
MappedData[3] = 0; // Start instance
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.pIndirectDrawAttribs = m_pIndirectDrawArgs;
m_pDeviceContext->Draw(DrawAttrs);
}
@@ -787,7 +785,6 @@ void TestDrawCommands::Draw()
MappedData[3] = 2; // Start instance
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.pIndirectDrawAttribs = m_pIndirectDrawArgs;
m_pDeviceContext->Draw(DrawAttrs);
}
@@ -815,7 +812,6 @@ void TestDrawCommands::Draw()
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.IsIndexed = true;
DrawAttrs.IndexType = VT_UINT32;
DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs;
@@ -833,7 +829,6 @@ void TestDrawCommands::Draw()
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.IsIndexed = true;
DrawAttrs.IndexType = VT_UINT32;
DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs;
@@ -851,7 +846,6 @@ void TestDrawCommands::Draw()
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.IsIndexed = true;
DrawAttrs.IndexType = VT_UINT32;
DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs;
@@ -869,7 +863,6 @@ void TestDrawCommands::Draw()
MappedData.Unmap();
DrawAttribs DrawAttrs;
- DrawAttrs.IsIndirect = true;
DrawAttrs.IsIndexed = true;
DrawAttrs.IndexType = VT_UINT32;
DrawAttrs.pIndirectDrawAttribs = m_pIndexedIndirectDrawArgs;
diff --git a/Tests/TestApp/src/TestShaderResourceLayout.cpp b/Tests/TestApp/src/TestShaderResourceLayout.cpp
index 2dc1cc6..9f00495 100644
--- a/Tests/TestApp/src/TestShaderResourceLayout.cpp
+++ b/Tests/TestApp/src/TestShaderResourceLayout.cpp
@@ -111,24 +111,32 @@ TestShaderResourceLayout::TestShaderResourceLayout( IRenderDevice *pDevice, IDev
}
RefCntAutoPtr<IBuffer> pUniformTexelBuff, pStorageTexelBuff;
- IBufferView *pUniformTexelBuffSRV = nullptr, *pStorageTexelBuffUAV = nullptr;
+ RefCntAutoPtr<IBufferView> pUniformTexelBuffSRV , pStorageTexelBuffUAV;
{
- Diligent::BufferDesc TxlBuffDesc;
+ BufferDesc TxlBuffDesc;
TxlBuffDesc.Name = "Uniform texel buffer test";
TxlBuffDesc.uiSizeInBytes = 256;
- TxlBuffDesc.BindFlags = BIND_SHADER_RESOURCE;
+ TxlBuffDesc.BindFlags = BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
TxlBuffDesc.Usage = USAGE_DEFAULT;
- TxlBuffDesc.Format.ValueType = VT_FLOAT32;
- TxlBuffDesc.Format.NumComponents = 4;
- TxlBuffDesc.Format.IsNormalized = false;
+ TxlBuffDesc.ElementByteStride = 16;
TxlBuffDesc.Mode = BUFFER_MODE_FORMATTED;
pDevice->CreateBuffer(TxlBuffDesc, BufferData{}, &pUniformTexelBuff);
- pUniformTexelBuffSRV = pUniformTexelBuff->GetDefaultView(BUFFER_VIEW_SHADER_RESOURCE);
+
+ BufferViewDesc TxlBuffViewDesc;
+ TxlBuffViewDesc.Name = "Uniform texel buffer SRV";
+ TxlBuffViewDesc.ViewType = BUFFER_VIEW_SHADER_RESOURCE;
+ TxlBuffViewDesc.Format.ValueType = VT_FLOAT32;
+ TxlBuffViewDesc.Format.NumComponents = 4;
+ TxlBuffViewDesc.Format.IsNormalized = false;
+ pUniformTexelBuff->CreateView(TxlBuffViewDesc, &pUniformTexelBuffSRV);
TxlBuffDesc.Name = "Storage texel buffer test";
TxlBuffDesc.BindFlags = BIND_UNORDERED_ACCESS;
pDevice->CreateBuffer(TxlBuffDesc, BufferData{}, &pStorageTexelBuff);
- pStorageTexelBuffUAV = pStorageTexelBuff->GetDefaultView(BUFFER_VIEW_UNORDERED_ACCESS);
+
+ TxlBuffViewDesc.Name = "Storage texel buffer UAV";
+ TxlBuffViewDesc.ViewType = BUFFER_VIEW_UNORDERED_ACCESS;
+ pUniformTexelBuff->CreateView(TxlBuffViewDesc, &pStorageTexelBuffUAV);
}
ResourceMappingDesc ResMappingDesc;
diff --git a/Tests/TestApp/src/TestShaderVarAccess.cpp b/Tests/TestApp/src/TestShaderVarAccess.cpp
index 5949dff..78791bf 100644
--- a/Tests/TestApp/src/TestShaderVarAccess.cpp
+++ b/Tests/TestApp/src/TestShaderVarAccess.cpp
@@ -124,26 +124,38 @@ TestShaderVarAccess::TestShaderVarAccess( IRenderDevice *pDevice, IDeviceContext
RefCntAutoPtr<IBuffer> pFormattedBuff0, pFormattedBuff[4];
IDeviceObject *pFormattedBuffSRV = nullptr, *pFormattedBuffUAV[4] = {}, *pFormattedBuffSRVs[4] = {};
+ RefCntAutoPtr<IBufferView> spFormattedBuffSRV, spFormattedBuffUAV[4], spFormattedBuffSRVs[4];
{
Diligent::BufferDesc TxlBuffDesc;
TxlBuffDesc.Name = "Uniform texel buffer test";
TxlBuffDesc.uiSizeInBytes = 256;
TxlBuffDesc.BindFlags = BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
TxlBuffDesc.Usage = USAGE_DEFAULT;
- TxlBuffDesc.Format.ValueType = VT_FLOAT32;
- TxlBuffDesc.Format.NumComponents = 4;
- TxlBuffDesc.Format.IsNormalized = false;
+ TxlBuffDesc.ElementByteStride = 16;
TxlBuffDesc.Mode = BUFFER_MODE_FORMATTED;
pDevice->CreateBuffer(TxlBuffDesc, BufferData{}, &pFormattedBuff0);
- pFormattedBuffSRV = pFormattedBuff0->GetDefaultView(BUFFER_VIEW_SHADER_RESOURCE);
+
+ Diligent::BufferViewDesc ViewDesc;
+ ViewDesc.ViewType = BUFFER_VIEW_SHADER_RESOURCE;
+ ViewDesc.Format.ValueType = VT_FLOAT32;
+ ViewDesc.Format.NumComponents = 4;
+ ViewDesc.Format.IsNormalized = false;
+ pFormattedBuff0->CreateView(ViewDesc, &spFormattedBuffSRV);
+ pFormattedBuffSRV = spFormattedBuffSRV;
for(size_t i=0; i < _countof(pFormattedBuff); ++i)
{
TxlBuffDesc.Name = "UAV buffer test";
TxlBuffDesc.BindFlags = BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
pDevice->CreateBuffer(TxlBuffDesc, BufferData{}, &(pFormattedBuff[i]));
- pFormattedBuffUAV[i] = pFormattedBuff[i]->GetDefaultView(BUFFER_VIEW_UNORDERED_ACCESS);
- pFormattedBuffSRVs[i] = pFormattedBuff[i]->GetDefaultView(BUFFER_VIEW_SHADER_RESOURCE);
+
+ ViewDesc.ViewType = BUFFER_VIEW_UNORDERED_ACCESS;
+ pFormattedBuff[i]->CreateView(ViewDesc, &(spFormattedBuffUAV[i]));
+ pFormattedBuffUAV[i] = spFormattedBuffUAV[i];
+
+ ViewDesc.ViewType = BUFFER_VIEW_SHADER_RESOURCE;
+ pFormattedBuff[i]->CreateView(ViewDesc, &(spFormattedBuffSRVs[i]));
+ pFormattedBuffSRVs[i] = spFormattedBuffSRVs[i];
}
}
diff --git a/Tests/TestApp/src/TestTextureCreation.cpp b/Tests/TestApp/src/TestTextureCreation.cpp
index 7544d76..70936a5 100644
--- a/Tests/TestApp/src/TestTextureCreation.cpp
+++ b/Tests/TestApp/src/TestTextureCreation.cpp
@@ -193,7 +193,7 @@ private:
TextureData &InitData)
{
- Uint32 PixelSize = PixelFormatAttribs.ComponentSize * PixelFormatAttribs.NumComponents;
+ Uint32 PixelSize = Uint32{PixelFormatAttribs.ComponentSize} * Uint32{PixelFormatAttribs.NumComponents};
assert( PixelSize == m_PixelSize );
Uint32 ArrSize = (TexDesc.Type == RESOURCE_DIM_TEX_3D) ? 1 : TexDesc.ArraySize;
@@ -713,7 +713,7 @@ TestTextureCreation::TestTextureCreation( IRenderDevice *pDevice, IDeviceContext
continue;
}
++m_NumFormatsTested;
- assert(CurrAttrs.PixelSize == Uint32{PixelFormatAttribs.ComponentSize} * PixelFormatAttribs.NumComponents ||
+ assert(CurrAttrs.PixelSize == Uint32{PixelFormatAttribs.ComponentSize} * Uint32{PixelFormatAttribs.NumComponents} ||
PixelFormatAttribs.ComponentType == COMPONENT_TYPE_COMPRESSED);
Verifier.Test(CurrAttrs.Fmt, CurrAttrs.PixelSize, CurrAttrs.BindFlags, CurrAttrs.TestDataUpload);
}
@@ -727,7 +727,7 @@ void TestTextureCreation::CheckFormatSize(TEXTURE_FORMAT *begin, TEXTURE_FORMAT
for(auto fmt = begin; fmt != end; ++fmt)
{
auto FmtAttrs = m_pDevice->GetTextureFormatInfo(*fmt);
- assert(Uint32{FmtAttrs.ComponentSize} * FmtAttrs.NumComponents == RefSize);
+ assert(Uint32{FmtAttrs.ComponentSize} * Uint32{FmtAttrs.NumComponents} == RefSize);
}
}
diff --git a/Tests/TestApp/src/TestTexturing.cpp b/Tests/TestApp/src/TestTexturing.cpp
index ba89b13..fdd79b8 100644
--- a/Tests/TestApp/src/TestTexturing.cpp
+++ b/Tests/TestApp/src/TestTexturing.cpp
@@ -49,7 +49,7 @@ void TestTexturing::GenerateTextureData(IRenderDevice *pRenderDevice, std::vecto
SubResouces.resize(TexDesc.MipLevels);
auto PixelFormatAttribs = pRenderDevice->GetTextureFormatInfoExt(TexDesc.Format);
- auto PixelSize = PixelFormatAttribs.ComponentSize * PixelFormatAttribs.NumComponents;
+ auto PixelSize = Uint32{PixelFormatAttribs.ComponentSize} * Uint32{PixelFormatAttribs.NumComponents};
for(Uint32 Level = 0; Level < TexDesc.MipLevels; ++Level)
{