From fe48cd7c5a5942f040e7c6ff0986726e437d30b9 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Tue, 23 Dec 2025 10:21:33 -0800 Subject: [PATCH] d3d12: Allow state promotion for non-simultaneous access textures Part-of: --- src/gallium/drivers/d3d12/d3d12_resource_state.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/d3d12/d3d12_resource_state.cpp b/src/gallium/drivers/d3d12/d3d12_resource_state.cpp index 9e2dfd15762..940a6099c93 100644 --- a/src/gallium/drivers/d3d12/d3d12_resource_state.cpp +++ b/src/gallium/drivers/d3d12/d3d12_resource_state.cpp @@ -157,7 +157,10 @@ resource_state_if_promoted(D3D12_RESOURCE_STATES desired_state, bool simultaneous_access, const d3d12_subresource_state *current_state) { - if (simultaneous_access) { + static constexpr D3D12_RESOURCE_STATES promotable_states = + D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_COPY_SOURCE | D3D12_RESOURCE_STATE_COPY_DEST; + + if (simultaneous_access || (desired_state & ~promotable_states) == D3D12_RESOURCE_STATE_COMMON) { // If the current state is COMMON... if (current_state->state == D3D12_RESOURCE_STATE_COMMON) // ...then promotion is allowed