Skip to content

Commit 32b3de7

Browse files
Use IDeviceContext::TransitionResourceState for single-resource transitions
1 parent 16066e2 commit 32b3de7

11 files changed

Lines changed: 24 additions & 24 deletions

Components/src/BoundBoxRenderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2025 Diligent Graphics LLC
2+
* Copyright 2024-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -219,7 +219,7 @@ void BoundBoxRenderer::Prepare(IDeviceContext* pContext, const RenderAttribs& At
219219
*m_ShaderAttribs = ShaderAttribs;
220220
pContext->UpdateBuffer(m_RenderAttribsCB, 0, sizeof(BoundBoxShaderAttribs), m_ShaderAttribs.get(), RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
221221
StateTransitionDesc Barrier{m_RenderAttribsCB, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_CONSTANT_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
222-
pContext->TransitionResourceStates(1, &Barrier);
222+
pContext->TransitionResourceState(Barrier);
223223
}
224224
}
225225
else

Components/src/EnvMapRenderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2025 Diligent Graphics LLC
2+
* Copyright 2023-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -240,7 +240,7 @@ void EnvMapRenderer::Prepare(IDeviceContext* pContext,
240240

241241
pContext->UpdateBuffer(m_RenderAttribsCB, 0, sizeof(EnvMapShaderAttribs), m_ShaderAttribs.get(), RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
242242
StateTransitionDesc Barrier{m_RenderAttribsCB, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_CONSTANT_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
243-
pContext->TransitionResourceStates(1, &Barrier);
243+
pContext->TransitionResourceState(Barrier);
244244
}
245245
}
246246
else

Hydrogent/src/HnGeometryPool.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2025 Diligent Graphics LLC
2+
* Copyright 2024-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -374,7 +374,7 @@ class HnGeometryPool::VertexData final : public GeometryPoolData
374374
if (!m_PoolAllocation)
375375
{
376376
StateTransitionDesc Barrier{Stream.Buffer, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_VERTEX_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
377-
pContext->TransitionResourceStates(1, &Barrier);
377+
pContext->TransitionResourceState(Barrier);
378378
}
379379
}
380380

@@ -728,7 +728,7 @@ class HnGeometryPool::IndexData final : public GeometryPoolData
728728
if (!m_Suballocation)
729729
{
730730
StateTransitionDesc Barrier{pBuffer, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_INDEX_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
731-
pContext->TransitionResourceStates(1, &Barrier);
731+
pContext->TransitionResourceState(Barrier);
732732
}
733733

734734
m_StagingData.reset();

Hydrogent/src/HnMaterial.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 Diligent Graphics LLC
2+
* Copyright 2023-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -1378,7 +1378,7 @@ void HnMaterial::EndResourceUpdate(HnRenderDelegate& RenderDelegate)
13781378
IDeviceContext* pContext = RenderDelegate.GetDeviceContext();
13791379
IBuffer* pBuffer = SRBCache->CommitUpdates(RenderDelegate.GetDevice(), pContext);
13801380
StateTransitionDesc Barrier{pBuffer, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_CONSTANT_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
1381-
pContext->TransitionResourceStates(1, &Barrier);
1381+
pContext->TransitionResourceState(Barrier);
13821382
}
13831383
else
13841384
{

Hydrogent/src/HnRenderDelegate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2025 Diligent Graphics LLC
2+
* Copyright 2023-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -518,7 +518,7 @@ HnRenderDelegate::HnRenderDelegate(const CreateInfo& CI) :
518518

519519
const RESOURCE_STATE ShadowMapState = m_pDevice->GetDeviceInfo().IsVulkanDevice() ? RESOURCE_STATE_DEPTH_READ : RESOURCE_STATE_SHADER_RESOURCE;
520520
StateTransitionDesc Barrier{pDummyShadowMap, RESOURCE_STATE_UNKNOWN, ShadowMapState, STATE_TRANSITION_FLAG_UPDATE_STATE};
521-
CI.pContext->TransitionResourceStates(1, &Barrier);
521+
CI.pContext->TransitionResourceState(Barrier);
522522
}
523523

524524
if (m_USDRenderer->GetSettings().OITLayerCount > 0)

Hydrogent/src/HnRenderPass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2025 Diligent Graphics LLC
2+
* Copyright 2023-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -385,7 +385,7 @@ void HnRenderPass::WriteJointsDataBatch(RenderState& State, Uint32 BatchIdx, PBR
385385
{
386386
State.pCtx->UpdateBuffer(pJointsCB, 0, JointsDataSize, m_JointsData.data(), RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
387387
StateTransitionDesc Barrier{pJointsCB, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_CONSTANT_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
388-
State.pCtx->TransitionResourceStates(1, &Barrier);
388+
State.pCtx->TransitionResourceState(Barrier);
389389
}
390390
}
391391

@@ -580,7 +580,7 @@ HnRenderPass::EXECUTE_RESULT HnRenderPass::Execute(HnRenderPassState& RPState, c
580580
{
581581
State.pCtx->UpdateBuffer(pPrimitiveAttribsCB, 0, AttribsBufferOffset, m_PrimitiveAttribsData.data(), RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
582582
StateTransitionDesc Barrier{pPrimitiveAttribsCB, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_CONSTANT_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
583-
State.pCtx->TransitionResourceStates(1, &Barrier);
583+
State.pCtx->TransitionResourceState(Barrier);
584584
}
585585
AttribsBufferOffset = 0;
586586

Hydrogent/src/HnTextureRegistry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 Diligent Graphics LLC
2+
* Copyright 2023-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -174,7 +174,7 @@ void HnTextureRegistry::TextureHandle::Initialize(IRenderDevice*
174174
if (m_pTexture)
175175
{
176176
StateTransitionDesc Barrier{m_pTexture, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_SHADER_RESOURCE, STATE_TRANSITION_FLAG_UPDATE_STATE};
177-
pContext->TransitionResourceStates(1, &Barrier);
177+
pContext->TransitionResourceState(Barrier);
178178
}
179179

180180
// Set the IsInitialized flag even if the texture creation failed

Hydrogent/src/Tasks/HnBeginMainPassTask.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Diligent Graphics LLC
2+
* Copyright 2024-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -89,7 +89,7 @@ void HnBeginMainPassTask::Execute(pxr::HdTaskContext* TaskCtx)
8989
StateTransitionDesc Barrier{ShadowMapMgr->GetShadowTexture(), RESOURCE_STATE_UNKNOWN,
9090
DeviceInfo.IsD3DDevice() ? RESOURCE_STATE_SHADER_RESOURCE : RESOURCE_STATE_DEPTH_READ,
9191
STATE_TRANSITION_FLAG_UPDATE_STATE};
92-
pCtx->TransitionResourceStates(1, &Barrier);
92+
pCtx->TransitionResourceState(Barrier);
9393
}
9494

9595
HnRenderPassState* RP_OpaqueSelected = GetRenderPassState(TaskCtx, HnRenderResourceTokens->renderPass_OpaqueSelected);

Hydrogent/src/Tasks/HnComputeDepthBoundsTask.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2025 Diligent Graphics LLC
2+
* Copyright 2025-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -177,7 +177,7 @@ void HnComputeDepthBoundsTask::Execute(pxr::HdTaskContext* TaskCtx)
177177
pFrameAttribsCB, offsetof(HLSL::CameraAttribs, fSceneNearZ), sizeof(HLSL::DepthRangeI), RESOURCE_STATE_TRANSITION_MODE_TRANSITION);
178178

179179
StateTransitionDesc Barrier{pFrameAttribsCB, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_CONSTANT_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
180-
pCtx->TransitionResourceStates(1, &Barrier);
180+
pCtx->TransitionResourceState(Barrier);
181181
}
182182
else
183183
{

Hydrogent/src/Tasks/HnRenderShadowsTask.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024-2025 Diligent Graphics LLC
2+
* Copyright 2024-2026 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -218,7 +218,7 @@ void HnRenderShadowsTask::PrepareClearDepthVB(const HnRenderDelegate& RenderDele
218218
}
219219

220220
StateTransitionDesc Barrier{m_ClearDepthVB, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_VERTEX_BUFFER, STATE_TRANSITION_FLAG_UPDATE_STATE};
221-
RenderDelegate.GetDeviceContext()->TransitionResourceStates(1, &Barrier);
221+
RenderDelegate.GetDeviceContext()->TransitionResourceState(Barrier);
222222
}
223223

224224
void HnRenderShadowsTask::Prepare(pxr::HdTaskContext* TaskCtx,

0 commit comments

Comments
 (0)