diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-08-27 00:09:03 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-08-27 00:09:03 +0000 |
| commit | 57b27983564952bee0100dcce350361aa32c9494 (patch) | |
| tree | 99b7ff2a9464ad236578ea725bd7b1b8d858099a /Tests/TestApp/src/MTResourceCreationTest.cpp | |
| parent | Updated readme: organized projects into a table (diff) | |
| download | DiligentEngine-57b27983564952bee0100dcce350361aa32c9494.tar.gz DiligentEngine-57b27983564952bee0100dcce350361aa32c9494.zip | |
Updated core & tools (implemented raw buffers plus other improvements)
Diffstat (limited to 'Tests/TestApp/src/MTResourceCreationTest.cpp')
| -rw-r--r-- | Tests/TestApp/src/MTResourceCreationTest.cpp | 21 |
1 files changed, 15 insertions, 6 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); |
