0
$\begingroup$

I am facing quite an odd issue trying to create a texture in dx12 via directxTex.Everything works well but after I upload my texture data I place a transition barrier to transition my barrier to be used as a PS resource as follows:

UpdateSubresources(m_cmdlist, m_texture.Get(), m_texuploadbuffer.Get(), 0, 0, ddssubresourcedata.size(), ddssubresourcedata.data());
        D3D12_RESOURCE_BARRIER texturebarrier = {};
        texturebarrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
        texturebarrier.Transition.pResource = m_texture.Get();
        texturebarrier.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
        texturebarrier.Transition.StateBefore = D3D12_RESOURCE_STATE_COPY_DEST;
        texturebarrier.Transition.StateAfter = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
        m_cmdlist->ResourceBarrier(1, &texturebarrier);

but to my surprise the transition barrier does not seems to transition my texture to another state,caches are not flushed either which is causing my texture to be black.I verified the same via a renderdoc capture & via GBV.I am pretty sure that the issue is on the GPU side execution because I verified the resource state from the CPU side by debug layer(debugcommandlist) and everything is clean.Can anyone suggest as to why GPU could be ignoring these barrier transition commands?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.