diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-10-08 16:56:09 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-10-08 16:56:09 +0000 |
| commit | 1eaf490aa7ca184e648a61eac3afc77e7a01b2f5 (patch) | |
| tree | 3191d564dcf0ca01bea325ac22336a83232d2369 /Tests/TestApp/src/TestShaderVarAccess.cpp | |
| parent | Updated core (Replaced error messages wit warnings when accessing inactive sh... (diff) | |
| download | DiligentEngine-1eaf490aa7ca184e648a61eac3afc77e7a01b2f5.tar.gz DiligentEngine-1eaf490aa7ca184e648a61eac3afc77e7a01b2f5.zip | |
Fixed warnings related to RW buffers in TestShaderVarAccess; updated core
Diffstat (limited to 'Tests/TestApp/src/TestShaderVarAccess.cpp')
| -rw-r--r-- | Tests/TestApp/src/TestShaderVarAccess.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Tests/TestApp/src/TestShaderVarAccess.cpp b/Tests/TestApp/src/TestShaderVarAccess.cpp index 1f59bfc..aa7e9d0 100644 --- a/Tests/TestApp/src/TestShaderVarAccess.cpp +++ b/Tests/TestApp/src/TestShaderVarAccess.cpp @@ -122,9 +122,10 @@ TestShaderVarAccess::TestShaderVarAccess( IRenderDevice *pDevice, IDeviceContext // pSBUAVs[i] = pStorgeBuffs[i]->GetDefaultView(BUFFER_VIEW_UNORDERED_ACCESS); //} - RefCntAutoPtr<IBuffer> pFormattedBuff0, pFormattedBuff[4]; + RefCntAutoPtr<IBuffer> pFormattedBuff0, pFormattedBuff[4], pRawBuff[2]; IDeviceObject *pFormattedBuffSRV = nullptr, *pFormattedBuffUAV[4] = {}, *pFormattedBuffSRVs[4] = {}; RefCntAutoPtr<IBufferView> spFormattedBuffSRV, spFormattedBuffUAV[4], spFormattedBuffSRVs[4]; + RefCntAutoPtr<IBufferView> spRawBuffUAV[2], spRawBuffSRVs[2]; { Diligent::BufferDesc TxlBuffDesc; TxlBuffDesc.Name = "Uniform texel buffer test"; @@ -157,6 +158,16 @@ TestShaderVarAccess::TestShaderVarAccess( IRenderDevice *pDevice, IDeviceContext pFormattedBuff[i]->CreateView(ViewDesc, &(spFormattedBuffSRVs[i])); pFormattedBuffSRVs[i] = spFormattedBuffSRVs[i]; } + + TxlBuffDesc.Mode = BUFFER_MODE_RAW; + ViewDesc.Format.ValueType = VT_UNDEFINED; + for(size_t i=0; i < _countof(pRawBuff); ++i) + { + TxlBuffDesc.Name = "Raw buffer test"; + pDevice->CreateBuffer(TxlBuffDesc, BufferData{}, &(pRawBuff[i])); + spRawBuffUAV[i] = pRawBuff[i]->GetDefaultView(BUFFER_VIEW_UNORDERED_ACCESS); + spRawBuffSRVs[i] = pRawBuff[i]->GetDefaultView(BUFFER_VIEW_SHADER_RESOURCE); + } } std::vector<ShaderVariableDesc> VarDesc = @@ -315,7 +326,7 @@ TestShaderVarAccess::TestShaderVarAccess( IRenderDevice *pDevice, IDeviceContext auto rwBuff_Static = pPS->GetShaderVariable("g_rwBuff_Static"); VERIFY_EXPR(rwBuff_Static->GetArraySize() == 1); VERIFY_EXPR(rwBuff_Static == pPS->GetShaderVariable(rwBuff_Static->GetName())); - rwBuff_Static->Set(pFormattedBuffUAV[0]); + rwBuff_Static->Set(spRawBuffUAV[0]); auto tex2D_Mut = pPS->GetShaderVariable("g_tex2D_Mut"); @@ -448,7 +459,7 @@ TestShaderVarAccess::TestShaderVarAccess( IRenderDevice *pDevice, IDeviceContext auto Buffer_Mut = pSRB->GetVariable(SHADER_TYPE_PIXEL, "g_Buffer_Mut"); VERIFY_EXPR(Buffer_Mut->GetArraySize() == 1); VERIFY_EXPR(Buffer_Mut == pSRB->GetVariable(SHADER_TYPE_PIXEL, Buffer_Mut->GetName())); - Buffer_Mut->Set(pFormattedBuffSRV); + Buffer_Mut->Set(spRawBuffSRVs[1]); auto Buffer_MutArr = pSRB->GetVariable(SHADER_TYPE_PIXEL, "g_Buffer_MutArr"); VERIFY_EXPR(Buffer_MutArr->GetArraySize() == 2); |
