Skip to content

Commit

Permalink
BufferD3D11: use GENERIC_READ initial state for dynamic buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Aug 24, 2023
1 parent 1b4a057 commit 2ebd6cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 Diligent Graphics LLC
* Copyright 2019-2023 Diligent Graphics LLC
* Copyright 2015-2019 Egor Yusov
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -129,7 +129,7 @@ BufferD3D11Impl::BufferD3D11Impl(IReferenceCounters* pRefCounters,
DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set buffer name");
}

SetState(RESOURCE_STATE_UNDEFINED);
SetState(m_Desc.Usage == USAGE_DYNAMIC ? RESOURCE_STATE_GENERIC_READ : RESOURCE_STATE_UNDEFINED);

// The memory is always coherent in Direct3D11
m_MemoryProperties = MEMORY_PROPERTY_HOST_COHERENT;
Expand Down

0 comments on commit 2ebd6cd

Please sign in to comment.