Skip to content

Commit

Permalink
GLTF Renderer: use updated resource manager interface
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Aug 22, 2023
1 parent 48b4070 commit b08fd3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions GLTF_PBR_Renderer/src/GLTF_PBR_Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ void GLTF_PBR_Renderer::CreateResourceCacheSRB(IRenderDevice* pDevice,
{
if (auto* pVar = pSRB->GetVariableByName(SHADER_TYPE_PIXEL, VarName))
{
if (auto* pTexture = CacheUseInfo.pResourceMgr->GetTexture(Fmt, pDevice, pCtx))
if (auto* pTexture = CacheUseInfo.pResourceMgr->UpdateTexture(Fmt, pDevice, pCtx))
{
pVar->Set(pTexture->GetDefaultView(TEXTURE_VIEW_SHADER_RESOURCE));
}
Expand Down Expand Up @@ -869,15 +869,15 @@ void GLTF_PBR_Renderer::Begin(IRenderDevice* pDevice,
std::array<IBuffer*, 8> pVBs; // Do not zero-initialize
for (Uint32 i = 0; i < PoolDesc.NumElements; ++i)
{
pVBs[i] = pVertexPool->GetBuffer(i, pDevice, pCtx);
pVBs[i] = pVertexPool->Update(i, pDevice, pCtx);
if ((pVBs[i]->GetDesc().BindFlags & BIND_VERTEX_BUFFER) == 0)
pVBs[i] = nullptr;
}

pCtx->SetVertexBuffers(0, PoolDesc.NumElements, pVBs.data(), nullptr, RESOURCE_STATE_TRANSITION_MODE_TRANSITION, SET_VERTEX_BUFFERS_FLAG_RESET);
}

auto* pIndexBuffer = CacheUseInfo.pResourceMgr->GetIndexBuffer(pDevice, pCtx);
auto* pIndexBuffer = CacheUseInfo.pResourceMgr->UpdateIndexBuffer(pDevice, pCtx);
pCtx->SetIndexBuffer(pIndexBuffer, 0, RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
}

Expand Down

0 comments on commit b08fd3e

Please sign in to comment.