Skip to content

Commit

Permalink
Don't use the Default Heap optimzation for static buffers on UMA devices
Browse files Browse the repository at this point in the history
Requires a change in d3d12translationlayer to add
ImmediateContext::m_architecture
  • Loading branch information
vdwtanner committed Mar 14, 2024
1 parent f060ab0 commit 8207338
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/9on12Resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,11 @@ namespace D3D9on12

const D3D12TranslationLayer::RESOURCE_USAGE UsageFlag = GetResourceUsage(createArgs.Flags, m_CpuAccessFlags);
D3D12_HEAP_TYPE HeapType = D3D12TranslationLayer::Resource::GetD3D12HeapType(UsageFlag, m_CpuAccessFlags);
if (HeapType == D3D12_HEAP_TYPE_UPLOAD && (createArgs.Flags.VertexBuffer || createArgs.Flags.IndexBuffer) &&
// We've seen some apps such as Unigine Valley experience corruption on systems with UMA when switching to HeapTypeDefault here, so skipping this optimization in that case for now
bool isUMA = m_pParentDevice->GetContext().m_architecture.isUMA;
if (!isUMA &&
HeapType == D3D12_HEAP_TYPE_UPLOAD &&
(createArgs.Flags.VertexBuffer || createArgs.Flags.IndexBuffer) &&
createArgs.Flags.HintStatic)
{
HeapType = D3D12_HEAP_TYPE_DEFAULT;
Expand Down

0 comments on commit 8207338

Please sign in to comment.