d3d12: Allow state promotion for non-simultaneous access textures

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39077>
This commit is contained in:
Jesse Natalie 2025-12-23 10:21:33 -08:00 committed by Marge Bot
parent 7f058c4740
commit fe48cd7c5a

View file

@ -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