Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use the Default Heap optimzation for static buffers on UMA devices #82

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading